From 0273eb6e1c961ea09e766c60e4a6ac6e7d60a321 Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Mon, 9 Aug 2021 02:21:10 +0000 Subject: [PATCH] CodeGen from PR 15566 in Azure/azure-rest-api-specs Merge 075493b6955de7880fb7a69eef437f8e20c4b6ec into 7384176da46425e7899708f263e0598b851358c2 --- src/databoxedge/HISTORY.rst | 8 + src/databoxedge/README.md | 366 ++ src/databoxedge/azext_databoxedge/__init__.py | 50 + src/databoxedge/azext_databoxedge/action.py | 17 + .../azext_databoxedge/azext_metadata.json | 4 + src/databoxedge/azext_databoxedge/custom.py | 17 + .../azext_databoxedge/generated/__init__.py | 12 + .../generated/_client_factory.py | 92 + .../azext_databoxedge/generated/_help.py | 1330 ++++ .../azext_databoxedge/generated/_params.py | 630 ++ .../generated/_validators.py | 9 + .../azext_databoxedge/generated/action.py | 347 + .../azext_databoxedge/generated/commands.py | 257 + .../azext_databoxedge/generated/custom.py | 982 +++ .../azext_databoxedge/manual/__init__.py | 12 + .../azext_databoxedge/tests/__init__.py | 116 + .../tests/latest/__init__.py | 12 + .../tests/latest/example_steps.py | 906 +++ .../tests/latest/test_databoxedge_scenario.py | 215 + .../vendored_sdks/__init__.py | 12 + .../vendored_sdks/databoxedge/__init__.py | 16 + .../databoxedge/_configuration.py | 70 + .../_data_box_edge_management_client.py | 164 + .../vendored_sdks/databoxedge/aio/__init__.py | 10 + .../databoxedge/aio/_configuration.py | 66 + .../aio/_data_box_edge_management_client.py | 158 + .../databoxedge/aio/operations/__init__.py | 51 + .../aio/operations/_addons_operations.py | 450 ++ .../aio/operations/_alerts_operations.py | 180 + .../operations/_available_skus_operations.py | 110 + .../_bandwidth_schedules_operations.py | 428 ++ .../aio/operations/_containers_operations.py | 580 ++ .../aio/operations/_devices_operations.py | 1305 ++++ .../_diagnostic_settings_operations.py | 397 ++ .../aio/operations/_jobs_operations.py | 105 + .../_monitoring_config_operations.py | 440 ++ .../aio/operations/_nodes_operations.py | 116 + .../databoxedge/aio/operations/_operations.py | 106 + .../_operations_status_operations.py | 105 + .../aio/operations/_orders_operations.py | 478 ++ .../aio/operations/_roles_operations.py | 428 ++ .../aio/operations/_shares_operations.py | 551 ++ ..._storage_account_credentials_operations.py | 430 ++ .../_storage_accounts_operations.py | 434 ++ .../_support_packages_operations.py | 163 + .../aio/operations/_triggers_operations.py | 434 ++ .../aio/operations/_users_operations.py | 434 ++ .../databoxedge/models/__init__.py | 516 ++ .../_data_box_edge_management_client_enums.py | 620 ++ .../databoxedge/models/_models.py | 5381 ++++++++++++++++ .../databoxedge/models/_models_py3.py | 5716 +++++++++++++++++ .../databoxedge/operations/__init__.py | 51 + .../operations/_addons_operations.py | 460 ++ .../operations/_alerts_operations.py | 186 + .../operations/_available_skus_operations.py | 115 + .../_bandwidth_schedules_operations.py | 438 ++ .../operations/_containers_operations.py | 592 ++ .../operations/_devices_operations.py | 1330 ++++ .../_diagnostic_settings_operations.py | 407 ++ .../operations/_jobs_operations.py | 110 + .../_monitoring_config_operations.py | 450 ++ .../operations/_nodes_operations.py | 121 + .../databoxedge/operations/_operations.py | 111 + .../_operations_status_operations.py | 110 + .../operations/_orders_operations.py | 489 ++ .../operations/_roles_operations.py | 438 ++ .../operations/_shares_operations.py | 563 ++ ..._storage_account_credentials_operations.py | 440 ++ .../_storage_accounts_operations.py | 444 ++ .../_support_packages_operations.py | 169 + .../operations/_triggers_operations.py | 444 ++ .../operations/_users_operations.py | 444 ++ .../vendored_sdks/databoxedge/py.typed | 1 + src/databoxedge/report.md | 1341 ++++ src/databoxedge/setup.cfg | 1 + src/databoxedge/setup.py | 58 + 76 files changed, 35149 insertions(+) create mode 100644 src/databoxedge/HISTORY.rst create mode 100644 src/databoxedge/README.md create mode 100644 src/databoxedge/azext_databoxedge/__init__.py create mode 100644 src/databoxedge/azext_databoxedge/action.py create mode 100644 src/databoxedge/azext_databoxedge/azext_metadata.json create mode 100644 src/databoxedge/azext_databoxedge/custom.py create mode 100644 src/databoxedge/azext_databoxedge/generated/__init__.py create mode 100644 src/databoxedge/azext_databoxedge/generated/_client_factory.py create mode 100644 src/databoxedge/azext_databoxedge/generated/_help.py create mode 100644 src/databoxedge/azext_databoxedge/generated/_params.py create mode 100644 src/databoxedge/azext_databoxedge/generated/_validators.py create mode 100644 src/databoxedge/azext_databoxedge/generated/action.py create mode 100644 src/databoxedge/azext_databoxedge/generated/commands.py create mode 100644 src/databoxedge/azext_databoxedge/generated/custom.py create mode 100644 src/databoxedge/azext_databoxedge/manual/__init__.py create mode 100644 src/databoxedge/azext_databoxedge/tests/__init__.py create mode 100644 src/databoxedge/azext_databoxedge/tests/latest/__init__.py create mode 100644 src/databoxedge/azext_databoxedge/tests/latest/example_steps.py create mode 100644 src/databoxedge/azext_databoxedge/tests/latest/test_databoxedge_scenario.py create mode 100644 src/databoxedge/azext_databoxedge/vendored_sdks/__init__.py create mode 100644 src/databoxedge/azext_databoxedge/vendored_sdks/databoxedge/__init__.py create mode 100644 src/databoxedge/azext_databoxedge/vendored_sdks/databoxedge/_configuration.py create mode 100644 src/databoxedge/azext_databoxedge/vendored_sdks/databoxedge/_data_box_edge_management_client.py create mode 100644 src/databoxedge/azext_databoxedge/vendored_sdks/databoxedge/aio/__init__.py create mode 100644 src/databoxedge/azext_databoxedge/vendored_sdks/databoxedge/aio/_configuration.py create mode 100644 src/databoxedge/azext_databoxedge/vendored_sdks/databoxedge/aio/_data_box_edge_management_client.py create mode 100644 src/databoxedge/azext_databoxedge/vendored_sdks/databoxedge/aio/operations/__init__.py create mode 100644 src/databoxedge/azext_databoxedge/vendored_sdks/databoxedge/aio/operations/_addons_operations.py create mode 100644 src/databoxedge/azext_databoxedge/vendored_sdks/databoxedge/aio/operations/_alerts_operations.py create mode 100644 src/databoxedge/azext_databoxedge/vendored_sdks/databoxedge/aio/operations/_available_skus_operations.py create mode 100644 src/databoxedge/azext_databoxedge/vendored_sdks/databoxedge/aio/operations/_bandwidth_schedules_operations.py create mode 100644 src/databoxedge/azext_databoxedge/vendored_sdks/databoxedge/aio/operations/_containers_operations.py create mode 100644 src/databoxedge/azext_databoxedge/vendored_sdks/databoxedge/aio/operations/_devices_operations.py create mode 100644 src/databoxedge/azext_databoxedge/vendored_sdks/databoxedge/aio/operations/_diagnostic_settings_operations.py create mode 100644 src/databoxedge/azext_databoxedge/vendored_sdks/databoxedge/aio/operations/_jobs_operations.py create mode 100644 src/databoxedge/azext_databoxedge/vendored_sdks/databoxedge/aio/operations/_monitoring_config_operations.py create mode 100644 src/databoxedge/azext_databoxedge/vendored_sdks/databoxedge/aio/operations/_nodes_operations.py create mode 100644 src/databoxedge/azext_databoxedge/vendored_sdks/databoxedge/aio/operations/_operations.py create mode 100644 src/databoxedge/azext_databoxedge/vendored_sdks/databoxedge/aio/operations/_operations_status_operations.py create mode 100644 src/databoxedge/azext_databoxedge/vendored_sdks/databoxedge/aio/operations/_orders_operations.py create mode 100644 src/databoxedge/azext_databoxedge/vendored_sdks/databoxedge/aio/operations/_roles_operations.py create mode 100644 src/databoxedge/azext_databoxedge/vendored_sdks/databoxedge/aio/operations/_shares_operations.py create mode 100644 src/databoxedge/azext_databoxedge/vendored_sdks/databoxedge/aio/operations/_storage_account_credentials_operations.py create mode 100644 src/databoxedge/azext_databoxedge/vendored_sdks/databoxedge/aio/operations/_storage_accounts_operations.py create mode 100644 src/databoxedge/azext_databoxedge/vendored_sdks/databoxedge/aio/operations/_support_packages_operations.py create mode 100644 src/databoxedge/azext_databoxedge/vendored_sdks/databoxedge/aio/operations/_triggers_operations.py create mode 100644 src/databoxedge/azext_databoxedge/vendored_sdks/databoxedge/aio/operations/_users_operations.py create mode 100644 src/databoxedge/azext_databoxedge/vendored_sdks/databoxedge/models/__init__.py create mode 100644 src/databoxedge/azext_databoxedge/vendored_sdks/databoxedge/models/_data_box_edge_management_client_enums.py create mode 100644 src/databoxedge/azext_databoxedge/vendored_sdks/databoxedge/models/_models.py create mode 100644 src/databoxedge/azext_databoxedge/vendored_sdks/databoxedge/models/_models_py3.py create mode 100644 src/databoxedge/azext_databoxedge/vendored_sdks/databoxedge/operations/__init__.py create mode 100644 src/databoxedge/azext_databoxedge/vendored_sdks/databoxedge/operations/_addons_operations.py create mode 100644 src/databoxedge/azext_databoxedge/vendored_sdks/databoxedge/operations/_alerts_operations.py create mode 100644 src/databoxedge/azext_databoxedge/vendored_sdks/databoxedge/operations/_available_skus_operations.py create mode 100644 src/databoxedge/azext_databoxedge/vendored_sdks/databoxedge/operations/_bandwidth_schedules_operations.py create mode 100644 src/databoxedge/azext_databoxedge/vendored_sdks/databoxedge/operations/_containers_operations.py create mode 100644 src/databoxedge/azext_databoxedge/vendored_sdks/databoxedge/operations/_devices_operations.py create mode 100644 src/databoxedge/azext_databoxedge/vendored_sdks/databoxedge/operations/_diagnostic_settings_operations.py create mode 100644 src/databoxedge/azext_databoxedge/vendored_sdks/databoxedge/operations/_jobs_operations.py create mode 100644 src/databoxedge/azext_databoxedge/vendored_sdks/databoxedge/operations/_monitoring_config_operations.py create mode 100644 src/databoxedge/azext_databoxedge/vendored_sdks/databoxedge/operations/_nodes_operations.py create mode 100644 src/databoxedge/azext_databoxedge/vendored_sdks/databoxedge/operations/_operations.py create mode 100644 src/databoxedge/azext_databoxedge/vendored_sdks/databoxedge/operations/_operations_status_operations.py create mode 100644 src/databoxedge/azext_databoxedge/vendored_sdks/databoxedge/operations/_orders_operations.py create mode 100644 src/databoxedge/azext_databoxedge/vendored_sdks/databoxedge/operations/_roles_operations.py create mode 100644 src/databoxedge/azext_databoxedge/vendored_sdks/databoxedge/operations/_shares_operations.py create mode 100644 src/databoxedge/azext_databoxedge/vendored_sdks/databoxedge/operations/_storage_account_credentials_operations.py create mode 100644 src/databoxedge/azext_databoxedge/vendored_sdks/databoxedge/operations/_storage_accounts_operations.py create mode 100644 src/databoxedge/azext_databoxedge/vendored_sdks/databoxedge/operations/_support_packages_operations.py create mode 100644 src/databoxedge/azext_databoxedge/vendored_sdks/databoxedge/operations/_triggers_operations.py create mode 100644 src/databoxedge/azext_databoxedge/vendored_sdks/databoxedge/operations/_users_operations.py create mode 100644 src/databoxedge/azext_databoxedge/vendored_sdks/databoxedge/py.typed create mode 100644 src/databoxedge/report.md create mode 100644 src/databoxedge/setup.cfg create mode 100644 src/databoxedge/setup.py diff --git a/src/databoxedge/HISTORY.rst b/src/databoxedge/HISTORY.rst new file mode 100644 index 00000000000..1c139576ba0 --- /dev/null +++ b/src/databoxedge/HISTORY.rst @@ -0,0 +1,8 @@ +.. :changelog: + +Release History +=============== + +0.1.0 +++++++ +* Initial release. diff --git a/src/databoxedge/README.md b/src/databoxedge/README.md new file mode 100644 index 00000000000..abbf52af928 --- /dev/null +++ b/src/databoxedge/README.md @@ -0,0 +1,366 @@ +# Azure CLI databoxedge Extension # +This is the extension for databoxedge + +### How to use ### +Install this extension using the below CLI command +``` +az extension add --name databoxedge +``` + +### Included Features ### +#### databoxedge available-sku #### +##### List ##### +``` +az databoxedge available-sku list +``` +#### databoxedge device #### +##### Create ##### +``` +az databoxedge device create --location "WUS" --sku name="Edge" tier="Standard" --name "testedgedevice" \ + --resource-group "GroupForEdgeAutomation" +``` +##### Show ##### +``` +az databoxedge device show --name "testedgedevice" --resource-group "GroupForEdgeAutomation" +``` +##### List ##### +``` +az databoxedge device list --resource-group "GroupForEdgeAutomation" +``` +##### Update ##### +``` +az databoxedge device update --name "testedgedevice" \ + --id "/subscriptions/0d44739e-0563-474f-97e7-24a0cdb23b29/resourceGroups/rapvs-rg/providers/Microsoft.AzureStack/linkedSubscriptions/ca014ddc-5cf2-45f8-b390-e901e4a0ae87" \ + --resource-group "GroupForEdgeAutomation" +``` +##### Create-or-update-security-setting ##### +``` +az databoxedge device create-or-update-security-setting --name "testedgedevice" --resource-group "AzureVM" \ + --device-admin-password encryption-algorithm="AES256" encryption-cert-thumbprint="" value="" +``` +##### Download-update ##### +``` +az databoxedge device download-update --name "testedgedevice" --resource-group "GroupForEdgeAutomation" +``` +##### Generate-certificate ##### +``` +az databoxedge device generate-certificate --name "testedgedevice" --resource-group "GroupForEdgeAutomation" +``` +##### Get-extended-information ##### +``` +az databoxedge device get-extended-information --name "testedgedevice" --resource-group "GroupForEdgeAutomation" +``` +##### Install-update ##### +``` +az databoxedge device install-update --name "testedgedevice" --resource-group "GroupForEdgeAutomation" +``` +##### Scan-for-update ##### +``` +az databoxedge device scan-for-update --name "testedgedevice" --resource-group "GroupForEdgeAutomation" +``` +##### Show-network-setting ##### +``` +az databoxedge device show-network-setting --name "testedgedevice" --resource-group "GroupForEdgeAutomation" +``` +##### Show-update-summary ##### +``` +az databoxedge device show-update-summary --name "testedgedevice" --resource-group "GroupForEdgeAutomation" +``` +##### Update-extended-information ##### +``` +az databoxedge device update-extended-information --name "testedgedevice" --resource-group "GroupForEdgeAutomation" +``` +##### Upload-certificate ##### +``` +az databoxedge device upload-certificate --name "testedgedevice" \ + --certificate "MIIC9DCCAdygAwIBAgIQWJae7GNjiI9Mcv/gJyrOPTANBgkqhkiG9w0BAQUFADASMRAwDgYDVQQDDAdXaW5kb3dzMB4XDTE4MTEyNzAwMTA0NVoXDTIxMTEyODAwMTA0NVowEjEQMA4GA1UEAwwHV2luZG93czCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAKxkRExqxf0qH1avnyORptIbRC2yQwqe3EIbJ2FPKr5jtAppGeX/dGKrFSnX+7/0HFr77aJHafdpEAtOiLyJ4zCAVs0obZCCIq4qJdmjYUTU0UXH/w/YzXfQA0d9Zh9AN+NJBX9xj05NzgsT24fkgsK2v6mWJQXT7YcWAsl5sEYPnx1e+MrupNyVSL/RUJmrS+etJSysHtFeWRhsUhVAs1DD5ExJvBLU3WH0IsojEvpXcjrutB5/MDQNrd/StGI6WovoSSPH7FyT9tgERx+q+Yg3YUGzfaIPCctlrRGehcdtzdNoKd0rsX62yCq0U6POoSfwe22NJu41oAUMd7e6R8cCAwEAAaNGMEQwEwYDVR0lBAwwCgYIKwYBBQUHAwIwHQYDVR0OBBYEFDd0VxnS3LnMIfwc7xW4b4IZWG5GMA4GA1UdDwEB/wQEAwIFIDANBgkqhkiG9w0BAQUFAAOCAQEAPQRby2u9celvtvL/DLEb5Vt3/tPStRQC5MyTD62L5RT/q8E6EMCXVZNkXF5WlWucLJi/18tY+9PNgP9xWLJh7kpSWlWdi9KPtwMqKDlEH8L2TnQdjimt9XuiCrTnoFy/1X2BGLY/rCaUJNSd15QCkz2xeW+Z+YSk2GwAc/A/4YfNpqSIMfNuPrT76o02VdD9WmJUA3fS/HY0sU9qgQRS/3F5/0EPS+HYQ0SvXCK9tggcCd4O050ytNBMJC9qMOJ7yE0iOrFfOJSCfDAuPhn/rHFh79Kn1moF+/CE+nc0/2RPiLC8r54/rt5dYyyxJDfXg0a3VrrX39W69WZGW5OXiw==" \ + --resource-group "GroupForEdgeAutomation" +``` +##### Delete ##### +``` +az databoxedge device delete --name "testedgedevice" --resource-group "GroupForEdgeAutomation" +``` +#### databoxedge alert #### +##### List ##### +``` +az databoxedge alert list --device-name "testedgedevice" --resource-group "GroupForEdgeAutomation" +``` +##### Show ##### +``` +az databoxedge alert show --name "159a00c7-8543-4343-9435-263ac87df3bb" --device-name "testedgedevice" \ + --resource-group "GroupForEdgeAutomation" +``` +#### databoxedge bandwidth-schedule #### +##### Create ##### +``` +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" +``` +##### Show ##### +``` +az databoxedge bandwidth-schedule show --name "bandwidth-1" --device-name "testedgedevice" \ + --resource-group "GroupForEdgeAutomation" +``` +##### List ##### +``` +az databoxedge bandwidth-schedule list --device-name "testedgedevice" --resource-group "GroupForEdgeAutomation" +``` +##### Delete ##### +``` +az databoxedge bandwidth-schedule delete --name "bandwidth-1" --device-name "testedgedevice" \ + --resource-group "GroupForEdgeAutomation" +``` +#### databoxedge diagnostic-setting #### +##### Update-diagnostic-proactive-log-collection-setting ##### +``` +az databoxedge diagnostic-setting update-diagnostic-proactive-log-collection-setting --device-name "testedgedevice" \ + --user-consent "Enabled" --resource-group "GroupForEdgeAutomation" +``` +##### Update-diagnostic-remote-support-setting ##### +``` +az databoxedge diagnostic-setting update-diagnostic-remote-support-setting --device-name "testedgedevice" \ + --remote-support-settings-list access-level="ReadWrite" expiration-time-stamp-in-utc="2021-07-07T00:00:00+00:00" remote-application-type="Powershell" \ + --resource-group "GroupForEdgeAutomation" +``` +##### Show-diagnostic-proactive-log-collection-setting ##### +``` +az databoxedge diagnostic-setting show-diagnostic-proactive-log-collection-setting --device-name "testedgedevice" \ + --resource-group "GroupForEdgeAutomation" +``` +##### Show-diagnostic-remote-support-setting ##### +``` +az databoxedge diagnostic-setting show-diagnostic-remote-support-setting --device-name "testedgedevice" \ + --resource-group "GroupForEdgeAutomation" +``` +#### databoxedge job #### +##### Show ##### +``` +az databoxedge job show --name "159a00c7-8543-4343-9435-263ac87df3bb" --device-name "testedgedevice" \ + --resource-group "GroupForEdgeAutomation" +``` +#### databoxedge node #### +##### List ##### +``` +az databoxedge node list --device-name "testedgedevice" --resource-group "GroupForEdgeAutomation" +``` +#### databoxedge operation-status #### +##### Show ##### +``` +az databoxedge operation-status show --name "159a00c7-8543-4343-9435-263ac87df3bb" --device-name "testedgedevice" \ + --resource-group "GroupForEdgeAutomation" +``` +#### databoxedge order #### +##### Create ##### +``` +az databoxedge order create --device-name "testedgedevice" \ + --contact-information company-name="Microsoft" contact-person="John Mcclane" email-list="john@microsoft.com" phone="(800) 426-9400" \ + --shipping-address address-line1="Microsoft Corporation" address-line2="One Microsoft Way" address-line3="Redmond" city="WA" country="USA" postal-code="98052" state="WA" \ + --resource-group "GroupForEdgeAutomation" +``` +##### Show ##### +``` +az databoxedge order show --device-name "testedgedevice" --resource-group "GroupForEdgeAutomation" +``` +##### List ##### +``` +az databoxedge order list --device-name "testedgedevice" --resource-group "GroupForEdgeAutomation" +``` +##### List-dc-access-code ##### +``` +az databoxedge order list-dc-access-code --device-name "testedgedevice" --resource-group "GroupForEdgeAutomation" +``` +##### Delete ##### +``` +az databoxedge order delete --device-name "testedgedevice" --resource-group "GroupForEdgeAutomation" +``` +#### databoxedge role #### +##### Create ##### +``` +az databoxedge role create --name "IoTRole1" --device-name "testedgedevice" --resource-group "GroupForEdgeAutomation" \ + --role "{\\"kind\\":\\"IOT\\",\\"properties\\":{\\"hostPlatform\\":\\"Linux\\",\\"ioTDeviceDetails\\":{\\"authentication\\":{\\"symmetricKey\\":{\\"connectionString\\":{\\"encryptionAlgorithm\\":\\"AES256\\",\\"encryptionCertThumbprint\\":\\"348586569999244\\",\\"value\\":\\"Encrypted<>\\"}}},\\"deviceId\\":\\"iotdevice\\",\\"ioTHostHub\\":\\"iothub.azure-devices.net\\"},\\"ioTEdgeDeviceDetails\\":{\\"authentication\\":{\\"symmetricKey\\":{\\"connectionString\\":{\\"encryptionAlgorithm\\":\\"AES256\\",\\"encryptionCertThumbprint\\":\\"1245475856069999244\\",\\"value\\":\\"Encrypted<>\\"}}},\\"deviceId\\":\\"iotEdge\\",\\"ioTHostHub\\":\\"iothub.azure-devices.net\\"},\\"roleStatus\\":\\"Enabled\\",\\"shareMappings\\":[]}}" +``` +##### Show ##### +``` +az databoxedge role show --name "IoTRole1" --device-name "testedgedevice" --resource-group "GroupForEdgeAutomation" +``` +##### List ##### +``` +az databoxedge role list --device-name "testedgedevice" --resource-group "GroupForEdgeAutomation" +``` +##### Delete ##### +``` +az databoxedge role delete --name "IoTRole1" --device-name "testedgedevice" --resource-group "GroupForEdgeAutomation" +``` +#### databoxedge addon #### +##### Create ##### +``` +az databoxedge addon create \ + --addon "{\\"kind\\":\\"ArcForKubernetes\\",\\"properties\\":{\\"resourceGroupName\\":\\"GroupForEdgeAutomation\\",\\"resourceLocation\\":\\"EastUS\\",\\"resourceName\\":\\"testedgedevice\\",\\"subscriptionId\\":\\"4385cf00-2d3a-425a-832f-f4285b1c9dce\\"}}" \ + --name "arcName" --device-name "testedgedevice" --resource-group "GroupForEdgeAutomation" \ + --role-name "KubernetesRole" +``` +##### Show ##### +``` +az databoxedge addon show --name "arcName" --device-name "testedgedevice" --resource-group "GroupForEdgeAutomation" \ + --role-name "KubernetesRole" +``` +##### List ##### +``` +az databoxedge addon list --device-name "testedgedevice" --resource-group "GroupForEdgeAutomation" \ + --role-name "IoTRole1" +``` +##### Delete ##### +``` +az databoxedge addon delete --name "arcName" --device-name "testedgedevice" --resource-group "GroupForEdgeAutomation" \ + --role-name "KubernetesRole" +``` +#### databoxedge monitoring-config #### +##### Create ##### +``` +az databoxedge monitoring-config create --device-name "testedgedevice" \ + --metric-configurations "[{\\"counterSets\\":[{\\"counters\\":[{\\"name\\":\\"test\\"}]}],\\"mdmAccount\\":\\"test\\",\\"metricNameSpace\\":\\"test\\",\\"resourceId\\":\\"test\\"}]" \ + --resource-group "GroupForEdgeAutomation" --role-name "testrole" +``` +##### Show ##### +``` +az databoxedge monitoring-config show --device-name "testedgedevice" --resource-group "GroupForEdgeAutomation" \ + --role-name "testrole" +``` +##### List ##### +``` +az databoxedge monitoring-config list --device-name "testedgedevice" --resource-group "GroupForEdgeAutomation" \ + --role-name "testrole" +``` +##### Delete ##### +``` +az databoxedge monitoring-config delete --device-name "testedgedevice" --resource-group "GroupForEdgeAutomation" \ + --role-name "testrole" +``` +#### databoxedge share #### +##### Create ##### +``` +az databoxedge share create --name "smbshare" --device-name "testedgedevice" --resource-group "GroupForEdgeAutomation" \ + --description "" --access-protocol "SMB" \ + --azure-container-info container-name="testContainerSMB" data-format="BlockBlob" storage-account-credential-id="/subscriptions/4385cf00-2d3a-425a-832f-f4285b1c9dce/resourceGroups/GroupForEdgeAutomation/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/testedgedevice/storageAccountCredentials/sac1" \ + --data-policy "Cloud" --monitoring-status "Enabled" --share-status "Online" \ + --user-access-rights access-type="Change" user-id="/subscriptions/4385cf00-2d3a-425a-832f-f4285b1c9dce/resourceGroups/GroupForEdgeAutomation/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/testedgedevice/users/user2" +``` +##### Show ##### +``` +az databoxedge share show --name "smbshare" --device-name "testedgedevice" --resource-group "GroupForEdgeAutomation" +``` +##### List ##### +``` +az databoxedge share list --device-name "testedgedevice" --resource-group "GroupForEdgeAutomation" +``` +##### Refresh ##### +``` +az databoxedge share refresh --name "smbshare" --device-name "testedgedevice" --resource-group "GroupForEdgeAutomation" +``` +##### Delete ##### +``` +az databoxedge share delete --name "smbshare" --device-name "testedgedevice" --resource-group "GroupForEdgeAutomation" +``` +#### databoxedge storage-account-credentials #### +##### List ##### +``` +az databoxedge storage-account-credentials list --device-name "testedgedevice" \ + --resource-group "GroupForEdgeAutomation" +``` +##### Show ##### +``` +az databoxedge storage-account-credentials show --name "sac1" --device-name "testedgedevice" \ + --resource-group "GroupForEdgeAutomation" +``` +##### Delete ##### +``` +az databoxedge storage-account-credentials delete --name "sac1" --device-name "testedgedevice" \ + --resource-group "GroupForEdgeAutomation" +``` +#### databoxedge storage-account #### +##### List ##### +``` +az databoxedge storage-account list --device-name "testedgedevice" --resource-group "GroupForEdgeAutomation" +``` +##### Show ##### +``` +az databoxedge storage-account show --device-name "testedgedevice" --resource-group "GroupForEdgeAutomation" \ + --name "blobstorageaccount1" +``` +##### Delete ##### +``` +az databoxedge storage-account delete --device-name "testedgedevice" --resource-group "GroupForEdgeAutomation" \ + --name "storageaccount1" +``` +#### databoxedge container #### +##### Create ##### +``` +az databoxedge container create --data-format "BlockBlob" --name "blobcontainer1" --device-name "testedgedevice" \ + --resource-group "GroupForEdgeAutomation" --storage-account-name "storageaccount1" +``` +##### Show ##### +``` +az databoxedge container show --name "blobcontainer1" --device-name "testedgedevice" \ + --resource-group "GroupForEdgeAutomation" --storage-account-name "storageaccount1" +``` +##### List ##### +``` +az databoxedge container list --device-name "testedgedevice" --resource-group "GroupForEdgeAutomation" \ + --storage-account-name "storageaccount1" +``` +##### Refresh ##### +``` +az databoxedge container refresh --name "blobcontainer1" --device-name "testedgedevice" \ + --resource-group "GroupForEdgeAutomation" --storage-account-name "storageaccount1" +``` +##### Delete ##### +``` +az databoxedge container delete --name "blobcontainer1" --device-name "testedgedevice" \ + --resource-group "GroupForEdgeAutomation" --storage-account-name "storageaccount1" +``` +#### databoxedge trigger #### +##### Create ##### +``` +az databoxedge trigger create --name "trigger1" --device-name "testedgedevice" \ + --resource-group "GroupForEdgeAutomation" \ + --file-event-trigger custom-context-tag="CustomContextTags-1235346475" role-id="/subscriptions/4385cf00-2d3a-425a-832f-f4285b1c9dce/resourceGroups/GroupForEdgeAutomation/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/testedgedevice/roles/role1" share-id="/subscriptions/4385cf00-2d3a-425a-832f-f4285b1c9dce/resourceGroups/GroupForEdgeAutomation/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/testedgedevice/shares/share1" +``` +##### Show ##### +``` +az databoxedge trigger show --name "trigger1" --device-name "testedgedevice" --resource-group "GroupForEdgeAutomation" +``` +##### List ##### +``` +az databoxedge trigger list --device-name "testedgedevice" --resource-group "GroupForEdgeAutomation" +``` +##### Delete ##### +``` +az databoxedge trigger delete --name "trigger1" --device-name "testedgedevice" \ + --resource-group "GroupForEdgeAutomation" +``` +#### databoxedge support-package #### +##### Trigger-support-package ##### +``` +az databoxedge support-package trigger-support-package --device-name "testedgedevice" \ + --resource-group "GroupForEdgeAutomation" --include "DefaultWithDumps" \ + --maximum-time-stamp "2018-12-18T02:19:51.4270267Z" --minimum-time-stamp "2018-12-18T02:18:51.4270267Z" +``` +#### databoxedge user #### +##### Create ##### +``` +az databoxedge user create --name "user1" --device-name "testedgedevice" --resource-group "GroupForEdgeAutomation" \ + --encrypted-password encryption-algorithm="None" encryption-cert-thumbprint="blah" value="" \ + --user-type "Share" +``` +##### Show ##### +``` +az databoxedge user show --name "user1" --device-name "testedgedevice" --resource-group "GroupForEdgeAutomation" +``` +##### List ##### +``` +az databoxedge user list --device-name "testedgedevice" --resource-group "GroupForEdgeAutomation" +``` +##### Delete ##### +``` +az databoxedge user delete --name "user1" --device-name "testedgedevice" --resource-group "GroupForEdgeAutomation" +``` \ No newline at end of file diff --git a/src/databoxedge/azext_databoxedge/__init__.py b/src/databoxedge/azext_databoxedge/__init__.py new file mode 100644 index 00000000000..6f3d0071ce2 --- /dev/null +++ b/src/databoxedge/azext_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 azext_databoxedge.generated._help import helps # pylint: disable=unused-import +try: + from azext_databoxedge.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 azext_databoxedge.generated._client_factory import cf_databoxedge_cl + databoxedge_custom = CliCommandType( + operations_tmpl='azext_databoxedge.custom#{}', + client_factory=cf_databoxedge_cl) + parent = super(DataBoxEdgeManagementClientCommandsLoader, self) + parent.__init__(cli_ctx=cli_ctx, custom_command_type=databoxedge_custom) + + def load_command_table(self, args): + from azext_databoxedge.generated.commands import load_command_table + load_command_table(self, args) + try: + from azext_databoxedge.manual.commands import load_command_table as load_command_table_manual + load_command_table_manual(self, args) + except ImportError: + pass + return self.command_table + + def load_arguments(self, command): + from azext_databoxedge.generated._params import load_arguments + load_arguments(self, command) + try: + from azext_databoxedge.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/databoxedge/azext_databoxedge/action.py b/src/databoxedge/azext_databoxedge/action.py new file mode 100644 index 00000000000..d95d53bf711 --- /dev/null +++ b/src/databoxedge/azext_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/databoxedge/azext_databoxedge/azext_metadata.json b/src/databoxedge/azext_databoxedge/azext_metadata.json new file mode 100644 index 00000000000..cfc30c747c7 --- /dev/null +++ b/src/databoxedge/azext_databoxedge/azext_metadata.json @@ -0,0 +1,4 @@ +{ + "azext.isExperimental": true, + "azext.minCliCoreVersion": "2.15.0" +} \ No newline at end of file diff --git a/src/databoxedge/azext_databoxedge/custom.py b/src/databoxedge/azext_databoxedge/custom.py new file mode 100644 index 00000000000..dbe9d5f9742 --- /dev/null +++ b/src/databoxedge/azext_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/databoxedge/azext_databoxedge/generated/__init__.py b/src/databoxedge/azext_databoxedge/generated/__init__.py new file mode 100644 index 00000000000..c9cfdc73e77 --- /dev/null +++ b/src/databoxedge/azext_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/databoxedge/azext_databoxedge/generated/_client_factory.py b/src/databoxedge/azext_databoxedge/generated/_client_factory.py new file mode 100644 index 00000000000..528a26de95d --- /dev/null +++ b/src/databoxedge/azext_databoxedge/generated/_client_factory.py @@ -0,0 +1,92 @@ +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# 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 azext_databoxedge.vendored_sdks.databoxedge import DataBoxEdgeManagementClient + return get_mgmt_service_client(cli_ctx, + DataBoxEdgeManagementClient) + + +def cf_available_sku(cli_ctx, *_): + return cf_databoxedge_cl(cli_ctx).available_skus + + +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_diagnostic_setting(cli_ctx, *_): + return cf_databoxedge_cl(cli_ctx).diagnostic_settings + + +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_operation_status(cli_ctx, *_): + return cf_databoxedge_cl(cli_ctx).operations_status + + +def cf_order(cli_ctx, *_): + return cf_databoxedge_cl(cli_ctx).orders + + +def cf_role(cli_ctx, *_): + return cf_databoxedge_cl(cli_ctx).roles + + +def cf_addon(cli_ctx, *_): + return cf_databoxedge_cl(cli_ctx).addons + + +def cf_monitoring_config(cli_ctx, *_): + return cf_databoxedge_cl(cli_ctx).monitoring_config + + +def cf_share(cli_ctx, *_): + return cf_databoxedge_cl(cli_ctx).shares + + +def cf_storage_account_credentials(cli_ctx, *_): + return cf_databoxedge_cl(cli_ctx).storage_account_credentials + + +def cf_storage_account(cli_ctx, *_): + return cf_databoxedge_cl(cli_ctx).storage_accounts + + +def cf_container(cli_ctx, *_): + return cf_databoxedge_cl(cli_ctx).containers + + +def cf_trigger(cli_ctx, *_): + return cf_databoxedge_cl(cli_ctx).triggers + + +def cf_support_package(cli_ctx, *_): + return cf_databoxedge_cl(cli_ctx).support_packages + + +def cf_user(cli_ctx, *_): + return cf_databoxedge_cl(cli_ctx).users diff --git a/src/databoxedge/azext_databoxedge/generated/_help.py b/src/databoxedge/azext_databoxedge/generated/_help.py new file mode 100644 index 00000000000..a51c74413c1 --- /dev/null +++ b/src/databoxedge/azext_databoxedge/generated/_help.py @@ -0,0 +1,1330 @@ +# -------------------------------------------------------------------------- +# 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 available-sku'] = """ + type: group + short-summary: Manage available sku with databoxedge +""" + +helps['databoxedge available-sku list'] = """ + type: command + short-summary: "List all the available Skus and information related to them." + examples: + - name: AvailableSkus + text: |- + az databoxedge available-sku list +""" + +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 "WUS" --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" --id "/subscriptions/0d44739e-0563-474f-97e7-24a0cd\ +b23b29/resourceGroups/rapvs-rg/providers/Microsoft.AzureStack/linkedSubscriptions/ca014ddc-5cf2-45f8-b390-e901e4a0ae87"\ + --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 create-or-update-security-setting'] = """ + type: command + short-summary: "Updates the security settings on a Data Box Edge/Data Box Gateway device." + parameters: + - name: --device-admin-password + short-summary: "Device administrator password as an encrypted string (encrypted using RSA PKCS #1) is used to \ +sign into the local web UI of the device. The Actual password should have at least 8 characters that are a \ +combination of uppercase, lowercase, numeric, and special characters." + long-summary: | + Usage: --device-admin-password value=XX encryption-cert-thumbprint=XX encryption-algorithm=XX + + value: Required. The value of the secret. + encryption-cert-thumbprint: Thumbprint certificate used to encrypt \"Value\". If the value is unencrypted, \ +it will be null. + encryption-algorithm: Required. The algorithm used to encrypt "Value". + examples: + - name: CreateOrUpdateSecuritySettings + text: |- + az databoxedge device create-or-update-security-setting --name "testedgedevice" --resource-group \ +"AzureVM" --device-admin-password encryption-algorithm="AES256" encryption-cert-thumbprint="" \ +value="" +""" + +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 generate-certificate'] = """ + type: command + short-summary: "Generates certificate for activation key." + examples: + - name: GenerateCertificate + text: |- + az databoxedge device generate-certificate --name "testedgedevice" --resource-group \ +"GroupForEdgeAutomation" +""" + +helps['databoxedge device get-extended-information'] = """ + type: command + short-summary: "Gets additional information for the specified Azure Stack Edge/Data Box Gateway device." + examples: + - name: ExtendedInfoPost + text: |- + az databoxedge device get-extended-information --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-network-setting'] = """ + type: command + short-summary: "Gets the network settings of the specified Data Box Edge/Data Box Gateway device." + examples: + - name: NetworkSettingsGet + text: |- + az databoxedge device show-network-setting --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 update-extended-information'] = """ + type: command + short-summary: "Gets additional information for the specified Data Box Edge/Data Box Gateway device." + examples: + - name: GetUpdateExtendedInfo + text: |- + az databoxedge device update-extended-information --name "testedgedevice" --resource-group \ +"GroupForEdgeAutomation" +""" + +helps['databoxedge device upload-certificate'] = """ + type: command + short-summary: "Uploads registration certificate for the device." + examples: + - name: UploadCertificatePost + text: |- + az databoxedge device upload-certificate --name "testedgedevice" --certificate \ +"MIIC9DCCAdygAwIBAgIQWJae7GNjiI9Mcv/gJyrOPTANBgkqhkiG9w0BAQUFADASMRAwDgYDVQQDDAdXaW5kb3dzMB4XDTE4MTEyNzAwMTA0NVoXDTIxMT\ +EyODAwMTA0NVowEjEQMA4GA1UEAwwHV2luZG93czCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAKxkRExqxf0qH1avnyORptIbRC2yQwqe3EIbJ\ +2FPKr5jtAppGeX/dGKrFSnX+7/0HFr77aJHafdpEAtOiLyJ4zCAVs0obZCCIq4qJdmjYUTU0UXH/w/YzXfQA0d9Zh9AN+NJBX9xj05NzgsT24fkgsK2v6mW\ +JQXT7YcWAsl5sEYPnx1e+MrupNyVSL/RUJmrS+etJSysHtFeWRhsUhVAs1DD5ExJvBLU3WH0IsojEvpXcjrutB5/MDQNrd/StGI6WovoSSPH7FyT9tgERx+\ +q+Yg3YUGzfaIPCctlrRGehcdtzdNoKd0rsX62yCq0U6POoSfwe22NJu41oAUMd7e6R8cCAwEAAaNGMEQwEwYDVR0lBAwwCgYIKwYBBQUHAwIwHQYDVR0OBB\ +YEFDd0VxnS3LnMIfwc7xW4b4IZWG5GMA4GA1UdDwEB/wQEAwIFIDANBgkqhkiG9w0BAQUFAAOCAQEAPQRby2u9celvtvL/DLEb5Vt3/tPStRQC5MyTD62L5\ +RT/q8E6EMCXVZNkXF5WlWucLJi/18tY+9PNgP9xWLJh7kpSWlWdi9KPtwMqKDlEH8L2TnQdjimt9XuiCrTnoFy/1X2BGLY/rCaUJNSd15QCkz2xeW+Z+YSk\ +2GwAc/A/4YfNpqSIMfNuPrT76o02VdD9WmJUA3fS/HY0sU9qgQRS/3F5/0EPS+HYQ0SvXCK9tggcCd4O050ytNBMJC9qMOJ7yE0iOrFfOJSCfDAuPhn/rHF\ +h79Kn1moF+/CE+nc0/2RPiLC8r54/rt5dYyyxJDfXg0a3VrrX39W69WZGW5OXiw==" --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 deleted. + text: |- + az databoxedge device wait --name "testedgedevice" --resource-group "GroupForEdgeAutomation" --deleted + - 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 +""" + +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 diagnostic-setting'] = """ + type: group + short-summary: Manage diagnostic setting with databoxedge +""" + +helps['databoxedge diagnostic-setting show-diagnostic-proactive-log-collection-setting'] = """ + type: command + short-summary: "Gets the proactive log collection settings of the specified Data Box Edge/Data Box Gateway \ +device." + examples: + - name: GetDiagnosticProactiveLogCollectionSettings + text: |- + az databoxedge diagnostic-setting show-diagnostic-proactive-log-collection-setting --device-name \ +"testedgedevice" --resource-group "GroupForEdgeAutomation" +""" + +helps['databoxedge diagnostic-setting show-diagnostic-remote-support-setting'] = """ + type: command + short-summary: "Gets the diagnostic remote support settings of the specified Data Box Edge/Data Box Gateway \ +device." + examples: + - name: GetDiagnosticRemoteSupportSettings + text: |- + az databoxedge diagnostic-setting show-diagnostic-remote-support-setting --device-name "testedgedevice" \ +--resource-group "GroupForEdgeAutomation" +""" + +helps['databoxedge diagnostic-setting update-diagnostic-proactive-log-collection-setting'] = """ + type: command + short-summary: "Updates the proactive log collection settings on a Data Box Edge/Data Box Gateway device." + examples: + - name: UpdateDiagnosticProactiveLogCollectionSettings + text: |- + az databoxedge diagnostic-setting update-diagnostic-proactive-log-collection-setting --device-name \ +"testedgedevice" --user-consent "Enabled" --resource-group "GroupForEdgeAutomation" +""" + +helps['databoxedge diagnostic-setting update-diagnostic-remote-support-setting'] = """ + type: command + short-summary: "Updates the diagnostic remote support settings on a Data Box Edge/Data Box Gateway device." + parameters: + - name: --remote-support-settings-list + short-summary: "Remote support settings list according to the RemoteApplicationType" + long-summary: | + Usage: --remote-support-settings-list remote-application-type=XX access-level=XX \ +expiration-time-stamp-in-utc=XX + + remote-application-type: Remote application type + access-level: Access level allowed for this remote application type + expiration-time-stamp-in-utc: Expiration time stamp + + Multiple actions can be specified by using more than one --remote-support-settings-list argument. + examples: + - name: UpdateDiagnosticRemoteSupportSettings + text: |- + az databoxedge diagnostic-setting update-diagnostic-remote-support-setting --device-name \ +"testedgedevice" --remote-support-settings-list access-level="ReadWrite" expiration-time-stamp-in-utc="2021-07-07T00:00\ +:00+00:00" remote-application-type="Powershell" --resource-group "GroupForEdgeAutomation" +""" + +helps['databoxedge job'] = """ + type: group + short-summary: Manage job with databoxedge +""" + +helps['databoxedge job show'] = """ + 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 job show --name "159a00c7-8543-4343-9435-263ac87df3bb" --device-name "testedgedevice" \ +--resource-group "GroupForEdgeAutomation" +""" + +helps['databoxedge node'] = """ + type: group + short-summary: Manage node with databoxedge +""" + +helps['databoxedge node list'] = """ + type: command + short-summary: "Gets all the nodes currently configured under this Data Box Edge device." + examples: + - name: NodesGetAllInDevice + text: |- + az databoxedge node list --device-name "testedgedevice" --resource-group "GroupForEdgeAutomation" +""" + +helps['databoxedge operation-status'] = """ + type: group + short-summary: Manage operation status with databoxedge +""" + +helps['databoxedge operation-status show'] = """ + type: command + short-summary: "Gets the details of a specified job on a Data Box Edge/Data Box Gateway device." + examples: + - name: OperationsStatusGet + text: |- + az databoxedge operation-status show --name "159a00c7-8543-4343-9435-263ac87df3bb" --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." + parameters: + - name: --contact-information + short-summary: "The contact details." + long-summary: | + Usage: --contact-information contact-person=XX company-name=XX phone=XX email-list=XX + + contact-person: Required. The contact person name. + company-name: Required. The name of the company. + phone: Required. The phone number. + email-list: Required. The email list. + - name: --shipping-address + short-summary: "The shipping address." + long-summary: | + Usage: --shipping-address address-line1=XX address-line2=XX address-line3=XX postal-code=XX city=XX \ +state=XX country=XX + + address-line1: The address line1. + address-line2: The address line2. + address-line3: The address line3. + postal-code: The postal code. + city: The city name. + state: The state name. + country: Required. The country name. + examples: + - name: OrderPut + text: |- + az databoxedge order create --device-name "testedgedevice" --contact-information \ +company-name="Microsoft" contact-person="John Mcclane" email-list="john@microsoft.com" phone="(800) 426-9400" \ +--shipping-address address-line1="Microsoft Corporation" address-line2="One Microsoft Way" address-line3="Redmond" \ +city="WA" country="USA" postal-code="98052" state="WA" --resource-group "GroupForEdgeAutomation" +""" + +helps['databoxedge order update'] = """ + type: command + short-summary: "Update an order." + parameters: + - name: --contact-information + short-summary: "The contact details." + long-summary: | + Usage: --contact-information contact-person=XX company-name=XX phone=XX email-list=XX + + contact-person: Required. The contact person name. + company-name: Required. The name of the company. + phone: Required. The phone number. + email-list: Required. The email list. + - name: --shipping-address + short-summary: "The shipping address." + long-summary: | + Usage: --shipping-address address-line1=XX address-line2=XX address-line3=XX postal-code=XX city=XX \ +state=XX country=XX + + address-line1: The address line1. + address-line2: The address line2. + address-line3: The address line3. + postal-code: The postal code. + city: The city name. + state: The state name. + country: Required. The country name. +""" + +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 list-dc-access-code'] = """ + type: command + short-summary: "Gets the DCAccess Code." + examples: + - name: GetDCAccessCode + text: |- + az databoxedge order list-dc-access-code --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 role'] = """ + type: group + short-summary: Manage role with databoxedge +""" + +helps['databoxedge role list'] = """ + type: command + short-summary: "Lists all the roles configured in a Data Box Edge/Data Box Gateway device." + examples: + - name: RoleGetAllInDevice + text: |- + az databoxedge role list --device-name "testedgedevice" --resource-group "GroupForEdgeAutomation" +""" + +helps['databoxedge role show'] = """ + type: command + short-summary: "Gets a specific role by name." + examples: + - name: RoleGet + text: |- + az databoxedge role show --name "IoTRole1" --device-name "testedgedevice" --resource-group \ +"GroupForEdgeAutomation" +""" + +helps['databoxedge role create'] = """ + type: command + short-summary: "Create a role." + examples: + - name: RolePut + text: |- + az databoxedge role create --name "IoTRole1" --device-name "testedgedevice" --resource-group \ +"GroupForEdgeAutomation" --role "{\\"kind\\":\\"IOT\\",\\"properties\\":{\\"hostPlatform\\":\\"Linux\\",\\"ioTDeviceDet\ +ails\\":{\\"authentication\\":{\\"symmetricKey\\":{\\"connectionString\\":{\\"encryptionAlgorithm\\":\\"AES256\\",\\"en\ +cryptionCertThumbprint\\":\\"348586569999244\\",\\"value\\":\\"Encrypted<>\\"}}},\\"deviceId\\":\\"iotdevice\\",\\"ioTHostHub\ +\\":\\"iothub.azure-devices.net\\"},\\"ioTEdgeDeviceDetails\\":{\\"authentication\\":{\\"symmetricKey\\":{\\"connection\ +String\\":{\\"encryptionAlgorithm\\":\\"AES256\\",\\"encryptionCertThumbprint\\":\\"1245475856069999244\\",\\"value\\":\ +\\"Encrypted<>\\"}}},\\"deviceId\\":\\"iotEdge\\",\\"ioTHostHub\\":\\"iothub.azure-devices.net\\"},\\"roleStatus\\":\\"Enabled\ +\\",\\"shareMappings\\":[]}}" +""" + +helps['databoxedge role update'] = """ + type: command + short-summary: "Update a role." +""" + +helps['databoxedge role delete'] = """ + type: command + short-summary: "Deletes the role on the device." + examples: + - name: RoleDelete + text: |- + az databoxedge role delete --name "IoTRole1" --device-name "testedgedevice" --resource-group \ +"GroupForEdgeAutomation" +""" + +helps['databoxedge role wait'] = """ + type: command + short-summary: Place the CLI in a waiting state until a condition of the databoxedge role is met. + examples: + - name: Pause executing next line of CLI script until the databoxedge role is successfully created. + text: |- + az databoxedge role wait --name "IoTRole1" --device-name "testedgedevice" --resource-group \ +"GroupForEdgeAutomation" --created + - name: Pause executing next line of CLI script until the databoxedge role is successfully updated. + text: |- + az databoxedge role wait --name "IoTRole1" --device-name "testedgedevice" --resource-group \ +"GroupForEdgeAutomation" --updated + - name: Pause executing next line of CLI script until the databoxedge role is successfully deleted. + text: |- + az databoxedge role wait --name "IoTRole1" --device-name "testedgedevice" --resource-group \ +"GroupForEdgeAutomation" --deleted +""" + +helps['databoxedge addon'] = """ + type: group + short-summary: Manage addon with databoxedge +""" + +helps['databoxedge addon list'] = """ + type: command + short-summary: "Lists all the addons configured in the role." + examples: + - name: RoleListAddOns + text: |- + az databoxedge addon list --device-name "testedgedevice" --resource-group "GroupForEdgeAutomation" \ +--role-name "IoTRole1" +""" + +helps['databoxedge addon show'] = """ + type: command + short-summary: "Gets a specific addon by name." + examples: + - name: GetAddOns + text: |- + az databoxedge addon show --name "arcName" --device-name "testedgedevice" --resource-group \ +"GroupForEdgeAutomation" --role-name "KubernetesRole" +""" + +helps['databoxedge addon create'] = """ + type: command + short-summary: "Create a addon." + examples: + - name: PutAddOns + text: |- + az databoxedge addon create --addon "{\\"kind\\":\\"ArcForKubernetes\\",\\"properties\\":{\\"resourceGro\ +upName\\":\\"GroupForEdgeAutomation\\",\\"resourceLocation\\":\\"EastUS\\",\\"resourceName\\":\\"testedgedevice\\",\\"s\ +ubscriptionId\\":\\"4385cf00-2d3a-425a-832f-f4285b1c9dce\\"}}" --name "arcName" --device-name "testedgedevice" \ +--resource-group "GroupForEdgeAutomation" --role-name "KubernetesRole" +""" + +helps['databoxedge addon update'] = """ + type: command + short-summary: "Update a addon." +""" + +helps['databoxedge addon delete'] = """ + type: command + short-summary: "Deletes the addon on the device." + examples: + - name: DeleteAddOns + text: |- + az databoxedge addon delete --name "arcName" --device-name "testedgedevice" --resource-group \ +"GroupForEdgeAutomation" --role-name "KubernetesRole" +""" + +helps['databoxedge addon wait'] = """ + type: command + short-summary: Place the CLI in a waiting state until a condition of the databoxedge addon is met. + examples: + - name: Pause executing next line of CLI script until the databoxedge addon is successfully created. + text: |- + az databoxedge addon wait --name "arcName" --device-name "testedgedevice" --resource-group \ +"GroupForEdgeAutomation" --role-name "KubernetesRole" --created + - name: Pause executing next line of CLI script until the databoxedge addon is successfully updated. + text: |- + az databoxedge addon wait --name "arcName" --device-name "testedgedevice" --resource-group \ +"GroupForEdgeAutomation" --role-name "KubernetesRole" --updated + - name: Pause executing next line of CLI script until the databoxedge addon is successfully deleted. + text: |- + az databoxedge addon wait --name "arcName" --device-name "testedgedevice" --resource-group \ +"GroupForEdgeAutomation" --role-name "KubernetesRole" --deleted +""" + +helps['databoxedge monitoring-config'] = """ + type: group + short-summary: Manage monitoring config with databoxedge +""" + +helps['databoxedge monitoring-config list'] = """ + type: command + short-summary: "Lists metric configurations in a role." + examples: + - name: ListMonitoringConfig + text: |- + az databoxedge monitoring-config list --device-name "testedgedevice" --resource-group \ +"GroupForEdgeAutomation" --role-name "testrole" +""" + +helps['databoxedge monitoring-config show'] = """ + type: command + short-summary: "Gets a metric configuration of a role." + examples: + - name: GetMonitoringConfig + text: |- + az databoxedge monitoring-config show --device-name "testedgedevice" --resource-group \ +"GroupForEdgeAutomation" --role-name "testrole" +""" + +helps['databoxedge monitoring-config create'] = """ + type: command + short-summary: "Creates a new metric configuration or updates an existing one for a role." + examples: + - name: PutMonitoringConfig + text: |- + az databoxedge monitoring-config create --device-name "testedgedevice" --metric-configurations \ +"[{\\"counterSets\\":[{\\"counters\\":[{\\"name\\":\\"test\\"}]}],\\"mdmAccount\\":\\"test\\",\\"metricNameSpace\\":\\"\ +test\\",\\"resourceId\\":\\"test\\"}]" --resource-group "GroupForEdgeAutomation" --role-name "testrole" +""" + +helps['databoxedge monitoring-config update'] = """ + type: command + short-summary: "Update a new metric configuration or updates an existing one for a role." +""" + +helps['databoxedge monitoring-config delete'] = """ + type: command + short-summary: "deletes a new metric configuration for a role." + examples: + - name: DeleteMonitoringConfig + text: |- + az databoxedge monitoring-config delete --device-name "testedgedevice" --resource-group \ +"GroupForEdgeAutomation" --role-name "testrole" +""" + +helps['databoxedge monitoring-config wait'] = """ + type: command + short-summary: Place the CLI in a waiting state until a condition of the databoxedge monitoring-config is met. + examples: + - name: Pause executing next line of CLI script until the databoxedge monitoring-config is successfully created. + text: |- + az databoxedge monitoring-config wait --device-name "testedgedevice" --resource-group \ +"GroupForEdgeAutomation" --role-name "testrole" --created + - name: Pause executing next line of CLI script until the databoxedge monitoring-config is successfully updated. + text: |- + az databoxedge monitoring-config wait --device-name "testedgedevice" --resource-group \ +"GroupForEdgeAutomation" --role-name "testrole" --updated + - name: Pause executing next line of CLI script until the databoxedge monitoring-config is successfully deleted. + text: |- + az databoxedge monitoring-config wait --device-name "testedgedevice" --resource-group \ +"GroupForEdgeAutomation" --role-name "testrole" --deleted +""" + +helps['databoxedge share'] = """ + type: group + short-summary: Manage share with databoxedge +""" + +helps['databoxedge share list'] = """ + type: command + short-summary: "Lists all the shares in a Data Box Edge/Data Box Gateway device." + examples: + - name: ShareGetAllInDevice + text: |- + az databoxedge share list --device-name "testedgedevice" --resource-group "GroupForEdgeAutomation" +""" + +helps['databoxedge share show'] = """ + type: command + short-summary: "Gets a share by name." + examples: + - name: ShareGet + text: |- + az databoxedge share show --name "smbshare" --device-name "testedgedevice" --resource-group \ +"GroupForEdgeAutomation" +""" + +helps['databoxedge share create'] = """ + type: command + short-summary: "Creates a new share or updates an existing share on the device." + parameters: + - name: --azure-container-info + short-summary: "Azure container mapping for the share." + long-summary: | + Usage: --azure-container-info storage-account-credential-id=XX container-name=XX data-format=XX + + storage-account-credential-id: Required. ID of the storage account credential used to access storage. + container-name: Required. Container name (Based on the data format specified, this represents the name of \ +Azure Files/Page blob/Block blob). + data-format: Required. Storage format used for the file represented by the share. + - name: --user-access-rights + short-summary: "Mapping of users and corresponding access rights on the share (required for SMB protocol)." + long-summary: | + Usage: --user-access-rights user-id=XX access-type=XX + + user-id: Required. User ID (already existing in the device). + access-type: Required. Type of access to be allowed for the user. + + Multiple actions can be specified by using more than one --user-access-rights argument. + - name: --client-access-rights + short-summary: "List of IP addresses and corresponding access rights on the share(required for NFS protocol)." + long-summary: | + Usage: --client-access-rights client=XX access-permission=XX + + client: Required. IP of the client. + access-permission: Required. Type of access to be allowed for the client. + + Multiple actions can be specified by using more than one --client-access-rights argument. + - name: --refresh-details + short-summary: "Details of the refresh job on this share." + long-summary: | + Usage: --refresh-details in-progress-refresh-job-id=XX last-completed-refresh-job-time-in-utc=XX \ +error-manifest-file=XX last-job=XX + + in-progress-refresh-job-id: If a refresh job is currently in progress on this share or container, this \ +field indicates the ARM resource ID of that job. The field is empty if no job is in progress. + last-completed-refresh-job-time-in-utc: Indicates the completed time for the last refresh job on this \ +particular share or container, if any.This could be a failed job or a successful job. + error-manifest-file: Indicates the relative path of the error xml for the last refresh job on this \ +particular share or container, if any. This could be a failed job or a successful job. + last-job: Indicates the id of the last refresh job on this particular share or container,if any. This \ +could be a failed job or a successful job. + examples: + - name: SharePut + text: |- + az databoxedge share create --name "smbshare" --device-name "testedgedevice" --resource-group \ +"GroupForEdgeAutomation" --description "" --access-protocol "SMB" --azure-container-info \ +container-name="testContainerSMB" data-format="BlockBlob" storage-account-credential-id="/subscriptions/4385cf00-2d3a-4\ +25a-832f-f4285b1c9dce/resourceGroups/GroupForEdgeAutomation/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/testedge\ +device/storageAccountCredentials/sac1" --data-policy "Cloud" --monitoring-status "Enabled" --share-status "Online" \ +--user-access-rights access-type="Change" user-id="/subscriptions/4385cf00-2d3a-425a-832f-f4285b1c9dce/resourceGroups/G\ +roupForEdgeAutomation/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/testedgedevice/users/user2" +""" + +helps['databoxedge share update'] = """ + type: command + short-summary: "Update a new share or updates an existing share on the device." + parameters: + - name: --azure-container-info + short-summary: "Azure container mapping for the share." + long-summary: | + Usage: --azure-container-info storage-account-credential-id=XX container-name=XX data-format=XX + + storage-account-credential-id: Required. ID of the storage account credential used to access storage. + container-name: Required. Container name (Based on the data format specified, this represents the name of \ +Azure Files/Page blob/Block blob). + data-format: Required. Storage format used for the file represented by the share. + - name: --user-access-rights + short-summary: "Mapping of users and corresponding access rights on the share (required for SMB protocol)." + long-summary: | + Usage: --user-access-rights user-id=XX access-type=XX + + user-id: Required. User ID (already existing in the device). + access-type: Required. Type of access to be allowed for the user. + + Multiple actions can be specified by using more than one --user-access-rights argument. + - name: --client-access-rights + short-summary: "List of IP addresses and corresponding access rights on the share(required for NFS protocol)." + long-summary: | + Usage: --client-access-rights client=XX access-permission=XX + + client: Required. IP of the client. + access-permission: Required. Type of access to be allowed for the client. + + Multiple actions can be specified by using more than one --client-access-rights argument. + - name: --refresh-details + short-summary: "Details of the refresh job on this share." + long-summary: | + Usage: --refresh-details in-progress-refresh-job-id=XX last-completed-refresh-job-time-in-utc=XX \ +error-manifest-file=XX last-job=XX + + in-progress-refresh-job-id: If a refresh job is currently in progress on this share or container, this \ +field indicates the ARM resource ID of that job. The field is empty if no job is in progress. + last-completed-refresh-job-time-in-utc: Indicates the completed time for the last refresh job on this \ +particular share or container, if any.This could be a failed job or a successful job. + error-manifest-file: Indicates the relative path of the error xml for the last refresh job on this \ +particular share or container, if any. This could be a failed job or a successful job. + last-job: Indicates the id of the last refresh job on this particular share or container,if any. This \ +could be a failed job or a successful job. +""" + +helps['databoxedge share delete'] = """ + type: command + short-summary: "Deletes the share on the Data Box Edge/Data Box Gateway device." + examples: + - name: ShareDelete + text: |- + az databoxedge share delete --name "smbshare" --device-name "testedgedevice" --resource-group \ +"GroupForEdgeAutomation" +""" + +helps['databoxedge share refresh'] = """ + type: command + short-summary: "Refreshes the share metadata with the data from the cloud." + examples: + - name: ShareRefreshPost + text: |- + az databoxedge share refresh --name "smbshare" --device-name "testedgedevice" --resource-group \ +"GroupForEdgeAutomation" +""" + +helps['databoxedge share wait'] = """ + type: command + short-summary: Place the CLI in a waiting state until a condition of the databoxedge share is met. + examples: + - name: Pause executing next line of CLI script until the databoxedge share is successfully created. + text: |- + az databoxedge share wait --name "smbshare" --device-name "testedgedevice" --resource-group \ +"GroupForEdgeAutomation" --created + - name: Pause executing next line of CLI script until the databoxedge share is successfully updated. + text: |- + az databoxedge share wait --name "smbshare" --device-name "testedgedevice" --resource-group \ +"GroupForEdgeAutomation" --updated + - name: Pause executing next line of CLI script until the databoxedge share is successfully deleted. + text: |- + az databoxedge share wait --name "smbshare" --device-name "testedgedevice" --resource-group \ +"GroupForEdgeAutomation" --deleted +""" + +helps['databoxedge storage-account-credentials'] = """ + type: group + short-summary: Manage storage account credentials with databoxedge +""" + +helps['databoxedge storage-account-credentials list'] = """ + type: command + short-summary: "Gets all the storage account credentials in a Data Box Edge/Data Box Gateway device." + examples: + - name: SACGetAllInDevice + text: |- + az databoxedge storage-account-credentials list --device-name "testedgedevice" --resource-group \ +"GroupForEdgeAutomation" +""" + +helps['databoxedge storage-account-credentials show'] = """ + type: command + short-summary: "Gets the properties of the specified storage account credential." + examples: + - name: SACGet + text: |- + az databoxedge storage-account-credentials show --name "sac1" --device-name "testedgedevice" \ +--resource-group "GroupForEdgeAutomation" +""" + +helps['databoxedge storage-account-credentials delete'] = """ + type: command + short-summary: "Deletes the storage account credential." + examples: + - name: SACDelete + text: |- + az databoxedge storage-account-credentials delete --name "sac1" --device-name "testedgedevice" \ +--resource-group "GroupForEdgeAutomation" +""" + +helps['databoxedge storage-account-credentials wait'] = """ + type: command + short-summary: Place the CLI in a waiting state until a condition of the databoxedge storage-account-credentials \ +is met. + examples: + - name: Pause executing next line of CLI script until the databoxedge storage-account-credentials is \ +successfully deleted. + text: |- + az databoxedge storage-account-credentials wait --name "sac1" --device-name "testedgedevice" \ +--resource-group "GroupForEdgeAutomation" --deleted +""" + +helps['databoxedge storage-account'] = """ + type: group + short-summary: Manage storage account with databoxedge +""" + +helps['databoxedge storage-account list'] = """ + type: command + short-summary: "Lists all the StorageAccounts in a Data Box Edge/Data Box Gateway device." + examples: + - name: StorageAccountGetAllInDevice + text: |- + az databoxedge storage-account list --device-name "testedgedevice" --resource-group \ +"GroupForEdgeAutomation" +""" + +helps['databoxedge storage-account show'] = """ + type: command + short-summary: "Gets a StorageAccount by name." + examples: + - name: StorageAccountGet + text: |- + az databoxedge storage-account show --device-name "testedgedevice" --resource-group \ +"GroupForEdgeAutomation" --name "blobstorageaccount1" +""" + +helps['databoxedge storage-account delete'] = """ + type: command + short-summary: "Deletes the StorageAccount on the Data Box Edge/Data Box Gateway device." + examples: + - name: StorageAccountDelete + text: |- + az databoxedge storage-account delete --device-name "testedgedevice" --resource-group \ +"GroupForEdgeAutomation" --name "storageaccount1" +""" + +helps['databoxedge storage-account wait'] = """ + type: command + short-summary: Place the CLI in a waiting state until a condition of the databoxedge storage-account is met. + examples: + - name: Pause executing next line of CLI script until the databoxedge storage-account is successfully deleted. + text: |- + az databoxedge storage-account wait --device-name "testedgedevice" --resource-group \ +"GroupForEdgeAutomation" --name "blobstorageaccount1" --deleted +""" + +helps['databoxedge container'] = """ + type: group + short-summary: Manage container with databoxedge +""" + +helps['databoxedge container list'] = """ + type: command + short-summary: "Lists all the containers of a storage Account in a Data Box Edge/Data Box Gateway device." + examples: + - name: ContainerListAllInDevice + text: |- + az databoxedge container list --device-name "testedgedevice" --resource-group "GroupForEdgeAutomation" \ +--storage-account-name "storageaccount1" +""" + +helps['databoxedge container show'] = """ + type: command + short-summary: "Gets a container by name." + examples: + - name: ContainerGet + text: |- + az databoxedge container show --name "blobcontainer1" --device-name "testedgedevice" --resource-group \ +"GroupForEdgeAutomation" --storage-account-name "storageaccount1" +""" + +helps['databoxedge container create'] = """ + type: command + short-summary: "Creates a new container or updates an existing container on the device." + examples: + - name: ContainerPut + text: |- + az databoxedge container create --data-format "BlockBlob" --name "blobcontainer1" --device-name \ +"testedgedevice" --resource-group "GroupForEdgeAutomation" --storage-account-name "storageaccount1" +""" + +helps['databoxedge container update'] = """ + type: command + short-summary: "Update a new container or updates an existing container on the device." +""" + +helps['databoxedge container delete'] = """ + type: command + short-summary: "Deletes the container on the Data Box Edge/Data Box Gateway device." + examples: + - name: ContainerDelete + text: |- + az databoxedge container delete --name "blobcontainer1" --device-name "testedgedevice" --resource-group \ +"GroupForEdgeAutomation" --storage-account-name "storageaccount1" +""" + +helps['databoxedge container refresh'] = """ + type: command + short-summary: "Refreshes the container metadata with the data from the cloud." + examples: + - name: ContainerRefresh + text: |- + az databoxedge container refresh --name "blobcontainer1" --device-name "testedgedevice" \ +--resource-group "GroupForEdgeAutomation" --storage-account-name "storageaccount1" +""" + +helps['databoxedge container wait'] = """ + type: command + short-summary: Place the CLI in a waiting state until a condition of the databoxedge container is met. + examples: + - name: Pause executing next line of CLI script until the databoxedge container is successfully created. + text: |- + az databoxedge container wait --name "blobcontainer1" --device-name "testedgedevice" --resource-group \ +"GroupForEdgeAutomation" --storage-account-name "storageaccount1" --created + - name: Pause executing next line of CLI script until the databoxedge container is successfully updated. + text: |- + az databoxedge container wait --name "blobcontainer1" --device-name "testedgedevice" --resource-group \ +"GroupForEdgeAutomation" --storage-account-name "storageaccount1" --updated + - name: Pause executing next line of CLI script until the databoxedge container is successfully deleted. + text: |- + az databoxedge container wait --name "blobcontainer1" --device-name "testedgedevice" --resource-group \ +"GroupForEdgeAutomation" --storage-account-name "storageaccount1" --deleted +""" + +helps['databoxedge trigger'] = """ + type: group + short-summary: Manage trigger with databoxedge +""" + +helps['databoxedge trigger list'] = """ + type: command + short-summary: "Lists all the triggers configured in the device." + examples: + - name: TriggerGetAllInDevice + text: |- + az databoxedge trigger list --device-name "testedgedevice" --resource-group "GroupForEdgeAutomation" +""" + +helps['databoxedge trigger show'] = """ + type: command + short-summary: "Get a specific trigger by name." + examples: + - name: TriggerGet + text: |- + az databoxedge trigger show --name "trigger1" --device-name "testedgedevice" --resource-group \ +"GroupForEdgeAutomation" +""" + +helps['databoxedge trigger create'] = """ + type: command + short-summary: "Create a trigger." + parameters: + - name: --file-event-trigger + short-summary: "Trigger details." + long-summary: | + Usage: --file-event-trigger custom-context-tag=XX role-id=XX share-id=XX kind=XX + + custom-context-tag: A custom context tag typically used to correlate the trigger against its usage. For \ +example, if a periodic timer trigger is intended for certain specific IoT modules in the device, the tag can be the \ +name or the image URL of the module. + role-id: Required. Compute role ID. + share-id: Required. File share ID. + kind: Required. Trigger Kind. + - name: --periodic-timer-event-trigger + short-summary: "Trigger details." + long-summary: | + Usage: --periodic-timer-event-trigger custom-context-tag=XX role-id=XX start-time=XX schedule=XX topic=XX \ +kind=XX + + custom-context-tag: A custom context tag typically used to correlate the trigger against its usage. For \ +example, if a periodic timer trigger is intended for certain specific IoT modules in the device, the tag can be the \ +name or the image URL of the module. + role-id: Required. Compute role ID. + start-time: Required. The time of the day that results in a valid trigger. Schedule is computed with \ +reference to the time specified upto seconds. If timezone is not specified the time will considered to be in device \ +timezone. The value will always be returned as UTC time. + schedule: Required. Periodic frequency at which timer event needs to be raised. Supports daily, hourly, \ +minutes, and seconds. + topic: Topic where periodic events are published to IoT device. + kind: Required. Trigger Kind. + examples: + - name: TriggerPut + text: |- + az databoxedge trigger create --name "trigger1" --device-name "testedgedevice" --resource-group \ +"GroupForEdgeAutomation" --file-event-trigger custom-context-tag="CustomContextTags-1235346475" \ +role-id="/subscriptions/4385cf00-2d3a-425a-832f-f4285b1c9dce/resourceGroups/GroupForEdgeAutomation/providers/Microsoft.\ +DataBoxEdge/dataBoxEdgeDevices/testedgedevice/roles/role1" share-id="/subscriptions/4385cf00-2d3a-425a-832f-f4285b1c9dc\ +e/resourceGroups/GroupForEdgeAutomation/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/testedgedevice/shares/share1\ +" +""" + +helps['databoxedge trigger update'] = """ + type: command + short-summary: "Update a trigger." + parameters: + - name: --file-event-trigger + short-summary: "Trigger details." + long-summary: | + Usage: --file-event-trigger custom-context-tag=XX role-id=XX share-id=XX kind=XX + + custom-context-tag: A custom context tag typically used to correlate the trigger against its usage. For \ +example, if a periodic timer trigger is intended for certain specific IoT modules in the device, the tag can be the \ +name or the image URL of the module. + role-id: Required. Compute role ID. + share-id: Required. File share ID. + kind: Required. Trigger Kind. + - name: --periodic-timer-event-trigger + short-summary: "Trigger details." + long-summary: | + Usage: --periodic-timer-event-trigger custom-context-tag=XX role-id=XX start-time=XX schedule=XX topic=XX \ +kind=XX + + custom-context-tag: A custom context tag typically used to correlate the trigger against its usage. For \ +example, if a periodic timer trigger is intended for certain specific IoT modules in the device, the tag can be the \ +name or the image URL of the module. + role-id: Required. Compute role ID. + start-time: Required. The time of the day that results in a valid trigger. Schedule is computed with \ +reference to the time specified upto seconds. If timezone is not specified the time will considered to be in device \ +timezone. The value will always be returned as UTC time. + schedule: Required. Periodic frequency at which timer event needs to be raised. Supports daily, hourly, \ +minutes, and seconds. + topic: Topic where periodic events are published to IoT device. + kind: Required. Trigger Kind. +""" + +helps['databoxedge trigger delete'] = """ + type: command + short-summary: "Deletes the trigger on the gateway device." + examples: + - name: TriggerDelete + text: |- + az databoxedge trigger delete --name "trigger1" --device-name "testedgedevice" --resource-group \ +"GroupForEdgeAutomation" +""" + +helps['databoxedge trigger wait'] = """ + type: command + short-summary: Place the CLI in a waiting state until a condition of the databoxedge trigger is met. + examples: + - name: Pause executing next line of CLI script until the databoxedge trigger is successfully created. + text: |- + az databoxedge trigger wait --name "trigger1" --device-name "testedgedevice" --resource-group \ +"GroupForEdgeAutomation" --created + - name: Pause executing next line of CLI script until the databoxedge trigger is successfully updated. + text: |- + az databoxedge trigger wait --name "trigger1" --device-name "testedgedevice" --resource-group \ +"GroupForEdgeAutomation" --updated + - name: Pause executing next line of CLI script until the databoxedge trigger is successfully deleted. + text: |- + az databoxedge trigger wait --name "trigger1" --device-name "testedgedevice" --resource-group \ +"GroupForEdgeAutomation" --deleted +""" + +helps['databoxedge support-package'] = """ + type: group + short-summary: Manage support package with databoxedge +""" + +helps['databoxedge support-package trigger-support-package'] = """ + type: command + short-summary: "Triggers support package on the device." + examples: + - name: TriggerSupportPackage + text: |- + az databoxedge support-package trigger-support-package --device-name "testedgedevice" --resource-group \ +"GroupForEdgeAutomation" --include "DefaultWithDumps" --maximum-time-stamp "2018-12-18T02:19:51.4270267Z" \ +--minimum-time-stamp "2018-12-18T02:18:51.4270267Z" +""" + +helps['databoxedge user'] = """ + type: group + short-summary: Manage user with databoxedge +""" + +helps['databoxedge user list'] = """ + type: command + short-summary: "Gets all the users registered on a Data Box Edge/Data Box Gateway device." + examples: + - name: UserGetAllInDevice + text: |- + az databoxedge user list --device-name "testedgedevice" --resource-group "GroupForEdgeAutomation" +""" + +helps['databoxedge user show'] = """ + type: command + short-summary: "Gets the properties of the specified user." + examples: + - name: UserGet + text: |- + az databoxedge user show --name "user1" --device-name "testedgedevice" --resource-group \ +"GroupForEdgeAutomation" +""" + +helps['databoxedge user create'] = """ + type: command + short-summary: "Creates a new user or updates an existing user's information on a Data Box Edge/Data Box Gateway \ +device." + parameters: + - name: --encrypted-password + short-summary: "The password details." + long-summary: | + Usage: --encrypted-password value=XX encryption-cert-thumbprint=XX encryption-algorithm=XX + + value: Required. The value of the secret. + encryption-cert-thumbprint: Thumbprint certificate used to encrypt \"Value\". If the value is unencrypted, \ +it will be null. + encryption-algorithm: Required. The algorithm used to encrypt "Value". + examples: + - name: UserPut + text: |- + az databoxedge user create --name "user1" --device-name "testedgedevice" --resource-group \ +"GroupForEdgeAutomation" --encrypted-password encryption-algorithm="None" encryption-cert-thumbprint="blah" \ +value="" --user-type "Share" +""" + +helps['databoxedge user update'] = """ + type: command + short-summary: "Update a new user or updates an existing user's information on a Data Box Edge/Data Box Gateway \ +device." + parameters: + - name: --encrypted-password + short-summary: "The password details." + long-summary: | + Usage: --encrypted-password value=XX encryption-cert-thumbprint=XX encryption-algorithm=XX + + value: Required. The value of the secret. + encryption-cert-thumbprint: Thumbprint certificate used to encrypt \"Value\". If the value is unencrypted, \ +it will be null. + encryption-algorithm: Required. The algorithm used to encrypt "Value". +""" + +helps['databoxedge user delete'] = """ + type: command + short-summary: "Deletes the user on a databox edge/gateway device." + examples: + - name: UserDelete + text: |- + az databoxedge user delete --name "user1" --device-name "testedgedevice" --resource-group \ +"GroupForEdgeAutomation" +""" + +helps['databoxedge user wait'] = """ + type: command + short-summary: Place the CLI in a waiting state until a condition of the databoxedge user is met. + examples: + - name: Pause executing next line of CLI script until the databoxedge user is successfully created. + text: |- + az databoxedge user wait --name "user1" --device-name "testedgedevice" --resource-group \ +"GroupForEdgeAutomation" --created + - name: Pause executing next line of CLI script until the databoxedge user is successfully updated. + text: |- + az databoxedge user wait --name "user1" --device-name "testedgedevice" --resource-group \ +"GroupForEdgeAutomation" --updated + - name: Pause executing next line of CLI script until the databoxedge user is successfully deleted. + text: |- + az databoxedge user wait --name "user1" --device-name "testedgedevice" --resource-group \ +"GroupForEdgeAutomation" --deleted +""" diff --git a/src/databoxedge/azext_databoxedge/generated/_params.py b/src/databoxedge/azext_databoxedge/generated/_params.py new file mode 100644 index 00000000000..4095ba47eca --- /dev/null +++ b/src/databoxedge/azext_databoxedge/generated/_params.py @@ -0,0 +1,630 @@ +# -------------------------------------------------------------------------- +# 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, + validate_file_or_dict +) +from azext_databoxedge.action import ( + AddSku, + AddDeviceAdminPassword, + AddRemoteSupportSettingsList, + AddContactInformation, + AddShippingAddress, + AddAzureContainerInfo, + AddUserAccessRights, + AddClientAccessRights, + AddRefreshDetails, + AddFileEventTrigger, + AddPeriodicTimerEventTrigger +) + + +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('kind', arg_type=get_enum_type(['AzureDataBoxGateway', 'AzureStackEdge', 'AzureStackHub', + 'AzureModularDataCentre']), help='The kind of the device.') + c.argument('data_box_edge_device_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('type_', options_list=['--type'], arg_type=get_enum_type(['GeoZoneReplication', 'ZoneReplication']), + help='DataResidencyType enum', arg_group='Data Residency') + c.argument('msi_identity_type', arg_type=get_enum_type(['None', 'SystemAssigned', 'UserAssigned']), + help='Identity type', arg_group='Identity') + + 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) + c.argument('id_', options_list=['--id'], type=str, help='The path ID that uniquely identifies the subscription ' + 'of the edge profile.', arg_group='Edge Profile Subscription') + c.argument('type_', options_list=['--type'], arg_type=get_enum_type(['None', 'SystemAssigned', + 'UserAssigned']), help='Identity type', + arg_group='Identity') + + 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 create-or-update-security-setting') 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('device_admin_password', action=AddDeviceAdminPassword, nargs='+', help='Device administrator ' + 'password as an encrypted string (encrypted using RSA PKCS #1) is used to sign into the local web ' + 'UI of the device. The Actual password should have at least 8 characters that are a combination of ' + 'uppercase, lowercase, numeric, and special characters.') + + 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 generate-certificate') 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 get-extended-information') 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-network-setting') 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 update-extended-information') 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('client_secret_store_id', type=str, help='The Key Vault ARM Id for client secrets') + c.argument('client_secret_store_url', type=str, help='The url to access the Client Key Vault') + c.argument('channel_integrity_key_name', type=str, help='The name for Channel Integrity Key stored in the ' + 'Client Key Vault') + c.argument('channel_integrity_key_version', type=str, help='The version of Channel Integrity Key stored in the ' + 'Client Key Vault') + c.argument('sync_status', arg_type=get_enum_type(['KeyVaultSynced', 'KeyVaultSyncFailed', + 'KeyVaultNotConfigured', 'KeyVaultSyncPending', + 'KeyVaultSyncing', 'KeyVaultNotSynced']), help='For changing ' + 'or to initiate the resync to key-vault set the status to KeyVaultSyncPending, rest of the status ' + 'will not be applicable.') + + with self.argument_context('databoxedge device upload-certificate') 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('authentication_type', arg_type=get_enum_type(['Invalid', 'AzureActiveDirectory']), help='The ' + 'authentication type.') + c.argument('certificate', type=str, help='The base64 encoded certificate raw data.') + + 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', 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', type=str, help='The device name.', id_part='name') + c.argument('name', 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', 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', type=str, help='The device name.', id_part='name') + c.argument('name', 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', type=str, help='The device name.') + c.argument('name', 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', type=str, help='The device name.', id_part='name') + c.argument('name', 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', type=str, help='The device name.', id_part='name') + c.argument('name', 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', type=str, help='The device name.', id_part='name') + c.argument('name', 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 diagnostic-setting show-diagnostic-proactive-log-collection-setting') as c: + c.argument('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 diagnostic-setting show-diagnostic-remote-support-setting') as c: + c.argument('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 diagnostic-setting update-diagnostic-proactive-log-collection-setting') as c: + c.argument('device_name', type=str, help='The device name.', id_part='name') + c.argument('resource_group_name', resource_group_name_type) + c.argument('user_consent', arg_type=get_enum_type(['Enabled', 'Disabled']), help='Proactive diagnostic ' + 'collection consent flag') + + with self.argument_context('databoxedge diagnostic-setting update-diagnostic-remote-support-setting') as c: + c.argument('device_name', type=str, help='The device name.', id_part='name') + c.argument('resource_group_name', resource_group_name_type) + c.argument('remote_support_settings_list', action=AddRemoteSupportSettingsList, nargs='+', help='Remote ' + 'support settings list according to the RemoteApplicationType') + + with self.argument_context('databoxedge job show') as c: + c.argument('device_name', type=str, help='The device name.', id_part='name') + c.argument('name', 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 node list') as c: + c.argument('device_name', type=str, help='The device name.') + c.argument('resource_group_name', resource_group_name_type) + + with self.argument_context('databoxedge operation-status show') as c: + c.argument('device_name', type=str, help='The device name.', id_part='name') + c.argument('name', 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 order list') as c: + c.argument('device_name', 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', 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', type=str, help='The order details of a device.') + c.argument('resource_group_name', resource_group_name_type) + c.argument('contact_information', action=AddContactInformation, nargs='+', help='The contact details.') + c.argument('shipping_address', action=AddShippingAddress, nargs='+', help='The shipping address.') + c.argument('shipment_type', arg_type=get_enum_type(['NotApplicable', 'ShippedToCustomer', 'SelfPickup']), + help='ShipmentType of the order') + + with self.argument_context('databoxedge order update') as c: + c.argument('device_name', type=str, help='The order details of a device.', id_part='name') + c.argument('resource_group_name', resource_group_name_type) + c.argument('contact_information', action=AddContactInformation, nargs='+', help='The contact details.') + c.argument('shipping_address', action=AddShippingAddress, nargs='+', help='The shipping address.') + c.argument('shipment_type', arg_type=get_enum_type(['NotApplicable', 'ShippedToCustomer', 'SelfPickup']), + help='ShipmentType of the order') + c.ignore('order') + + with self.argument_context('databoxedge order delete') as c: + c.argument('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 order list-dc-access-code') as c: + c.argument('device_name', type=str, help='The device name') + c.argument('resource_group_name', resource_group_name_type) + + with self.argument_context('databoxedge order wait') as c: + c.argument('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 role list') as c: + c.argument('device_name', type=str, help='The device name.') + c.argument('resource_group_name', resource_group_name_type) + + with self.argument_context('databoxedge role show') as c: + c.argument('device_name', type=str, help='The device name.', id_part='name') + c.argument('name', type=str, help='The role name.', id_part='child_name_1') + c.argument('resource_group_name', resource_group_name_type) + + with self.argument_context('databoxedge role create') as c: + c.argument('device_name', type=str, help='The device name.') + c.argument('name', type=str, help='The role name.') + c.argument('resource_group_name', resource_group_name_type) + c.argument('role', type=validate_file_or_dict, help='The role properties. Expected value: ' + 'json-string/@json-file.') + + with self.argument_context('databoxedge role update') as c: + c.argument('device_name', type=str, help='The device name.', id_part='name') + c.argument('name', type=str, help='The role name.', id_part='child_name_1') + c.argument('resource_group_name', resource_group_name_type) + c.argument('role', type=validate_file_or_dict, help='The role properties. Expected value: ' + 'json-string/@json-file.') + + with self.argument_context('databoxedge role delete') as c: + c.argument('device_name', type=str, help='The device name.', id_part='name') + c.argument('name', type=str, help='The role name.', id_part='child_name_1') + c.argument('resource_group_name', resource_group_name_type) + + with self.argument_context('databoxedge role wait') as c: + c.argument('device_name', type=str, help='The device name.', id_part='name') + c.argument('name', type=str, help='The role name.', id_part='child_name_1') + c.argument('resource_group_name', resource_group_name_type) + + with self.argument_context('databoxedge addon list') as c: + c.argument('device_name', type=str, help='The device name.') + c.argument('role_name', type=str, help='The role name.') + c.argument('resource_group_name', resource_group_name_type) + + with self.argument_context('databoxedge addon show') as c: + c.argument('device_name', type=str, help='The device name.', id_part='name') + c.argument('role_name', type=str, help='The role name.', id_part='child_name_1') + c.argument('addon_name', options_list=['--name', '-n', '--addon-name'], type=str, help='The addon name.', + id_part='child_name_2') + c.argument('resource_group_name', resource_group_name_type) + + with self.argument_context('databoxedge addon create') as c: + c.argument('device_name', type=str, help='The device name.') + c.argument('role_name', type=str, help='The role name.') + c.argument('addon_name', options_list=['--name', '-n', '--addon-name'], type=str, help='The addon name.') + c.argument('resource_group_name', resource_group_name_type) + c.argument('addon', type=validate_file_or_dict, help='The addon properties. Expected value: ' + 'json-string/@json-file.') + + with self.argument_context('databoxedge addon update') as c: + c.argument('device_name', type=str, help='The device name.', id_part='name') + c.argument('role_name', type=str, help='The role name.', id_part='child_name_1') + c.argument('addon_name', options_list=['--name', '-n', '--addon-name'], type=str, help='The addon name.', + id_part='child_name_2') + c.argument('resource_group_name', resource_group_name_type) + c.argument('addon', type=validate_file_or_dict, help='The addon properties. Expected value: ' + 'json-string/@json-file.') + + with self.argument_context('databoxedge addon delete') as c: + c.argument('device_name', type=str, help='The device name.', id_part='name') + c.argument('role_name', type=str, help='The role name.', id_part='child_name_1') + c.argument('addon_name', options_list=['--name', '-n', '--addon-name'], type=str, help='The addon name.', + id_part='child_name_2') + c.argument('resource_group_name', resource_group_name_type) + + with self.argument_context('databoxedge addon wait') as c: + c.argument('device_name', type=str, help='The device name.', id_part='name') + c.argument('role_name', type=str, help='The role name.', id_part='child_name_1') + c.argument('addon_name', options_list=['--name', '-n', '--addon-name'], type=str, help='The addon name.', + id_part='child_name_2') + c.argument('resource_group_name', resource_group_name_type) + + with self.argument_context('databoxedge monitoring-config list') as c: + c.argument('device_name', type=str, help='The device name.') + c.argument('role_name', type=str, help='The role name.') + c.argument('resource_group_name', resource_group_name_type) + + with self.argument_context('databoxedge monitoring-config show') as c: + c.argument('device_name', type=str, help='The device name.', id_part='name') + c.argument('role_name', type=str, help='The role name.', id_part='child_name_1') + c.argument('resource_group_name', resource_group_name_type) + + with self.argument_context('databoxedge monitoring-config create') as c: + c.argument('device_name', type=str, help='The device name.') + c.argument('role_name', type=str, help='The role name.') + c.argument('resource_group_name', resource_group_name_type) + c.argument('metric_configurations', type=validate_file_or_dict, help='The metrics configuration details ' + 'Expected value: json-string/@json-file.') + + with self.argument_context('databoxedge monitoring-config update') as c: + c.argument('device_name', type=str, help='The device name.', id_part='name') + c.argument('role_name', type=str, help='The role name.', id_part='child_name_1') + c.argument('resource_group_name', resource_group_name_type) + c.argument('metric_configurations', type=validate_file_or_dict, help='The metrics configuration details ' + 'Expected value: json-string/@json-file.') + c.ignore('monitoring_metric_configuration') + + with self.argument_context('databoxedge monitoring-config delete') as c: + c.argument('device_name', type=str, help='The device name.', id_part='name') + c.argument('role_name', type=str, help='The role name.', id_part='child_name_1') + c.argument('resource_group_name', resource_group_name_type) + + with self.argument_context('databoxedge monitoring-config wait') as c: + c.argument('device_name', type=str, help='The device name.', id_part='name') + c.argument('role_name', type=str, help='The role name.', id_part='child_name_1') + c.argument('resource_group_name', resource_group_name_type) + + with self.argument_context('databoxedge share list') as c: + c.argument('device_name', type=str, help='The device name.') + c.argument('resource_group_name', resource_group_name_type) + + with self.argument_context('databoxedge share show') as c: + c.argument('device_name', type=str, help='The device name.', id_part='name') + c.argument('name', type=str, help='The share name.', id_part='child_name_1') + c.argument('resource_group_name', resource_group_name_type) + + with self.argument_context('databoxedge share create') as c: + c.argument('device_name', type=str, help='The device name.') + c.argument('name', type=str, help='The share name.') + c.argument('resource_group_name', resource_group_name_type) + c.argument('description', type=str, help='Description for the share.') + c.argument('share_status', arg_type=get_enum_type(['Offline', 'Unknown', 'OK', 'Updating', 'NeedsAttention']), + help='Current status of the share.') + c.argument('monitoring_status', arg_type=get_enum_type(['Enabled', 'Disabled']), help='Current monitoring ' + 'status of the share.') + c.argument('azure_container_info', action=AddAzureContainerInfo, nargs='+', help='Azure container mapping for ' + 'the share.') + c.argument('access_protocol', arg_type=get_enum_type(['SMB', 'NFS']), help='Access protocol to be used by the ' + 'share.') + c.argument('user_access_rights', action=AddUserAccessRights, nargs='+', help='Mapping of users and ' + 'corresponding access rights on the share (required for SMB protocol).') + c.argument('client_access_rights', action=AddClientAccessRights, nargs='+', help='List of IP addresses and ' + 'corresponding access rights on the share(required for NFS protocol).') + c.argument('refresh_details', action=AddRefreshDetails, nargs='+', help='Details of the refresh job on this ' + 'share.') + c.argument('data_policy', arg_type=get_enum_type(['Cloud', 'Local']), help='Data policy of the share.') + + with self.argument_context('databoxedge share update') as c: + c.argument('device_name', type=str, help='The device name.', id_part='name') + c.argument('name', type=str, help='The share name.', id_part='child_name_1') + c.argument('resource_group_name', resource_group_name_type) + c.argument('description', type=str, help='Description for the share.') + c.argument('share_status', arg_type=get_enum_type(['Offline', 'Unknown', 'OK', 'Updating', 'NeedsAttention']), + help='Current status of the share.') + c.argument('monitoring_status', arg_type=get_enum_type(['Enabled', 'Disabled']), help='Current monitoring ' + 'status of the share.') + c.argument('azure_container_info', action=AddAzureContainerInfo, nargs='+', help='Azure container mapping for ' + 'the share.') + c.argument('access_protocol', arg_type=get_enum_type(['SMB', 'NFS']), help='Access protocol to be used by the ' + 'share.') + c.argument('user_access_rights', action=AddUserAccessRights, nargs='+', help='Mapping of users and ' + 'corresponding access rights on the share (required for SMB protocol).') + c.argument('client_access_rights', action=AddClientAccessRights, nargs='+', help='List of IP addresses and ' + 'corresponding access rights on the share(required for NFS protocol).') + c.argument('refresh_details', action=AddRefreshDetails, nargs='+', help='Details of the refresh job on this ' + 'share.') + c.argument('data_policy', arg_type=get_enum_type(['Cloud', 'Local']), help='Data policy of the share.') + c.ignore('share') + + with self.argument_context('databoxedge share delete') as c: + c.argument('device_name', type=str, help='The device name.', id_part='name') + c.argument('name', type=str, help='The share name.', id_part='child_name_1') + c.argument('resource_group_name', resource_group_name_type) + + with self.argument_context('databoxedge share refresh') as c: + c.argument('device_name', type=str, help='The device name.', id_part='name') + c.argument('name', type=str, help='The share name.', id_part='child_name_1') + c.argument('resource_group_name', resource_group_name_type) + + with self.argument_context('databoxedge share wait') as c: + c.argument('device_name', type=str, help='The device name.', id_part='name') + c.argument('name', type=str, help='The share name.', id_part='child_name_1') + c.argument('resource_group_name', resource_group_name_type) + + with self.argument_context('databoxedge storage-account-credentials list') as c: + c.argument('device_name', type=str, help='The device name.') + c.argument('resource_group_name', resource_group_name_type) + + with self.argument_context('databoxedge storage-account-credentials show') as c: + c.argument('device_name', type=str, help='The device name.', id_part='name') + c.argument('name', type=str, help='The storage account credential name.', id_part='child_name_1') + c.argument('resource_group_name', resource_group_name_type) + + with self.argument_context('databoxedge storage-account-credentials delete') as c: + c.argument('device_name', type=str, help='The device name.', id_part='name') + c.argument('name', type=str, help='The storage account credential name.', id_part='child_name_1') + c.argument('resource_group_name', resource_group_name_type) + + with self.argument_context('databoxedge storage-account-credentials wait') as c: + c.argument('device_name', type=str, help='The device name.', id_part='name') + c.argument('name', type=str, help='The storage account credential name.', id_part='child_name_1') + c.argument('resource_group_name', resource_group_name_type) + + with self.argument_context('databoxedge storage-account list') as c: + c.argument('device_name', type=str, help='The device name.') + c.argument('resource_group_name', resource_group_name_type) + + with self.argument_context('databoxedge storage-account show') as c: + c.argument('device_name', type=str, help='The device name.', id_part='name') + c.argument('storage_account_name', options_list=['--name', '-n', '--storage-account-name'], type=str, + help='The storage account name.', id_part='child_name_1') + c.argument('resource_group_name', resource_group_name_type) + + with self.argument_context('databoxedge storage-account delete') as c: + c.argument('device_name', type=str, help='The device name.', id_part='name') + c.argument('storage_account_name', options_list=['--name', '-n', '--storage-account-name'], type=str, + help='The StorageAccount name.', id_part='child_name_1') + c.argument('resource_group_name', resource_group_name_type) + + with self.argument_context('databoxedge storage-account wait') as c: + c.argument('device_name', type=str, help='The device name.', id_part='name') + c.argument('storage_account_name', options_list=['--name', '-n', '--storage-account-name'], type=str, + help='The storage account name.', id_part='child_name_1') + c.argument('resource_group_name', resource_group_name_type) + + with self.argument_context('databoxedge container list') as c: + c.argument('device_name', type=str, help='The device name.') + c.argument('storage_account_name', type=str, help='The storage Account name.') + c.argument('resource_group_name', resource_group_name_type) + + with self.argument_context('databoxedge container show') as c: + c.argument('device_name', type=str, help='The device name.', id_part='name') + c.argument('storage_account_name', type=str, help='The Storage Account Name', id_part='child_name_1') + c.argument('container_name', options_list=['--name', '-n', '--container-name'], type=str, help='The container ' + 'Name', id_part='child_name_2') + c.argument('resource_group_name', resource_group_name_type) + + with self.argument_context('databoxedge container create') as c: + c.argument('device_name', type=str, help='The device name.') + c.argument('storage_account_name', type=str, help='The Storage Account Name') + c.argument('container_name', options_list=['--name', '-n', '--container-name'], type=str, help='The container ' + 'name.') + c.argument('resource_group_name', resource_group_name_type) + c.argument('data_format', arg_type=get_enum_type(['BlockBlob', 'PageBlob', 'AzureFile']), help='DataFormat for ' + 'Container') + + with self.argument_context('databoxedge container update') as c: + c.argument('device_name', type=str, help='The device name.', id_part='name') + c.argument('storage_account_name', type=str, help='The Storage Account Name', id_part='child_name_1') + c.argument('container_name', options_list=['--name', '-n', '--container-name'], type=str, help='The container ' + 'name.', id_part='child_name_2') + c.argument('resource_group_name', resource_group_name_type) + c.argument('data_format', arg_type=get_enum_type(['BlockBlob', 'PageBlob', 'AzureFile']), help='DataFormat for ' + 'Container') + c.ignore('container') + + with self.argument_context('databoxedge container delete') as c: + c.argument('device_name', type=str, help='The device name.', id_part='name') + c.argument('storage_account_name', type=str, help='The Storage Account Name', id_part='child_name_1') + c.argument('container_name', options_list=['--name', '-n', '--container-name'], type=str, help='The container ' + 'name.', id_part='child_name_2') + c.argument('resource_group_name', resource_group_name_type) + + with self.argument_context('databoxedge container refresh') as c: + c.argument('device_name', type=str, help='The device name.', id_part='name') + c.argument('storage_account_name', type=str, help='The Storage Account Name', id_part='child_name_1') + c.argument('container_name', options_list=['--name', '-n', '--container-name'], type=str, help='The container ' + 'name.', id_part='child_name_2') + c.argument('resource_group_name', resource_group_name_type) + + with self.argument_context('databoxedge container wait') as c: + c.argument('device_name', type=str, help='The device name.', id_part='name') + c.argument('storage_account_name', type=str, help='The Storage Account Name', id_part='child_name_1') + c.argument('container_name', options_list=['--name', '-n', '--container-name'], type=str, help='The container ' + 'Name', id_part='child_name_2') + c.argument('resource_group_name', resource_group_name_type) + + with self.argument_context('databoxedge trigger list') as c: + c.argument('device_name', type=str, help='The device name.') + c.argument('resource_group_name', resource_group_name_type) + c.argument('filter_', options_list=['--filter'], type=str, help='Specify $filter=\'CustomContextTag eq \' ' + 'to filter on custom context tag property') + + with self.argument_context('databoxedge trigger show') as c: + c.argument('device_name', type=str, help='The device name.', id_part='name') + c.argument('name', type=str, help='The trigger name.', id_part='child_name_1') + c.argument('resource_group_name', resource_group_name_type) + + with self.argument_context('databoxedge trigger create') as c: + c.argument('device_name', type=str, help='Creates or updates a trigger') + c.argument('name', type=str, help='The trigger name.') + c.argument('resource_group_name', resource_group_name_type) + c.argument('file_event_trigger', action=AddFileEventTrigger, nargs='+', help='Trigger details.', + arg_group='Trigger') + c.argument('periodic_timer_event_trigger', action=AddPeriodicTimerEventTrigger, nargs='+', help='Trigger ' + 'details.', arg_group='Trigger') + + with self.argument_context('databoxedge trigger update') as c: + c.argument('device_name', type=str, help='Creates or updates a trigger', id_part='name') + c.argument('name', type=str, help='The trigger name.', id_part='child_name_1') + c.argument('resource_group_name', resource_group_name_type) + c.argument('file_event_trigger', action=AddFileEventTrigger, nargs='+', help='Trigger details.', + arg_group='Trigger') + c.argument('periodic_timer_event_trigger', action=AddPeriodicTimerEventTrigger, nargs='+', help='Trigger ' + 'details.', arg_group='Trigger') + + with self.argument_context('databoxedge trigger delete') as c: + c.argument('device_name', type=str, help='The device name.', id_part='name') + c.argument('name', type=str, help='The trigger name.', id_part='child_name_1') + c.argument('resource_group_name', resource_group_name_type) + + with self.argument_context('databoxedge trigger wait') as c: + c.argument('device_name', type=str, help='The device name.', id_part='name') + c.argument('name', type=str, help='The trigger name.', id_part='child_name_1') + c.argument('resource_group_name', resource_group_name_type) + + with self.argument_context('databoxedge support-package trigger-support-package') as c: + c.argument('device_name', type=str, help='The device name.', id_part='name') + c.argument('resource_group_name', resource_group_name_type) + c.argument('minimum_time_stamp', help='MinimumTimeStamp from where logs need to be collected') + c.argument('maximum_time_stamp', help='MaximumTimeStamp until where logs need to be collected') + c.argument('include', type=str, help='Type of files, which need to be included in the logs This will contain ' + 'the type of logs (Default/DefaultWithDumps/None/All/DefaultWithArchived) or a comma separated list ' + 'of log types that are required') + + with self.argument_context('databoxedge user list') as c: + c.argument('device_name', type=str, help='The device name.') + c.argument('resource_group_name', resource_group_name_type) + c.argument('filter_', options_list=['--filter'], type=str, help='Specify $filter=\'Type eq \' to filter ' + 'on user type property') + + with self.argument_context('databoxedge user show') as c: + c.argument('device_name', type=str, help='The device name.', id_part='name') + c.argument('name', type=str, help='The user name.', id_part='child_name_1') + c.argument('resource_group_name', resource_group_name_type) + + with self.argument_context('databoxedge user create') as c: + c.argument('device_name', type=str, help='The device name.') + c.argument('name', type=str, help='The user name.') + c.argument('resource_group_name', resource_group_name_type) + c.argument('encrypted_password', action=AddDeviceAdminPassword, nargs='+', help='The password details.') + c.argument('user_type', arg_type=get_enum_type(['Share', 'LocalManagement', 'ARM']), help='Type of the user.') + + with self.argument_context('databoxedge user update') as c: + c.argument('device_name', type=str, help='The device name.', id_part='name') + c.argument('name', type=str, help='The user name.', id_part='child_name_1') + c.argument('resource_group_name', resource_group_name_type) + c.argument('encrypted_password', action=AddDeviceAdminPassword, nargs='+', help='The password details.') + c.argument('user_type', arg_type=get_enum_type(['Share', 'LocalManagement', 'ARM']), help='Type of the user.') + c.ignore('user') + + with self.argument_context('databoxedge user delete') as c: + c.argument('device_name', type=str, help='The device name.', id_part='name') + c.argument('name', type=str, help='The user name.', id_part='child_name_1') + c.argument('resource_group_name', resource_group_name_type) + + with self.argument_context('databoxedge user wait') as c: + c.argument('device_name', type=str, help='The device name.', id_part='name') + c.argument('name', type=str, help='The user name.', id_part='child_name_1') + c.argument('resource_group_name', resource_group_name_type) diff --git a/src/databoxedge/azext_databoxedge/generated/_validators.py b/src/databoxedge/azext_databoxedge/generated/_validators.py new file mode 100644 index 00000000000..b33a44c1ebf --- /dev/null +++ b/src/databoxedge/azext_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/databoxedge/azext_databoxedge/generated/action.py b/src/databoxedge/azext_databoxedge/generated/action.py new file mode 100644 index 00000000000..21bcb277f21 --- /dev/null +++ b/src/databoxedge/azext_databoxedge/generated/action.py @@ -0,0 +1,347 @@ +# -------------------------------------------------------------------------- +# 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 + + +class AddDeviceAdminPassword(argparse.Action): + def __call__(self, parser, namespace, values, option_string=None): + action = self.get_action(values, option_string) + namespace.device_admin_password = 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 == 'value': + d['value'] = v[0] + elif kl == 'encryption-cert-thumbprint': + d['encryption_cert_thumbprint'] = v[0] + elif kl == 'encryption-algorithm': + d['encryption_algorithm'] = v[0] + else: + raise CLIError('Unsupported Key {} is provided for parameter device_admin_password. All possible keys ' + 'are: value, encryption-cert-thumbprint, encryption-algorithm'.format(k)) + return d + + +class AddRemoteSupportSettingsList(argparse._AppendAction): + def __call__(self, parser, namespace, values, option_string=None): + action = self.get_action(values, option_string) + super(AddRemoteSupportSettingsList, self).__call__(parser, namespace, action, option_string) + + def get_action(self, values, option_string): # pylint: disable=no-self-use + try: + properties = defaultdict(list) + for (k, v) in (x.split('=', 1) for x in values): + properties[k].append(v) + properties = dict(properties) + except ValueError: + raise CLIError('usage error: {} [KEY=VALUE ...]'.format(option_string)) + d = {} + for k in properties: + kl = k.lower() + v = properties[k] + if kl == 'remote-application-type': + d['remote_application_type'] = v[0] + elif kl == 'access-level': + d['access_level'] = v[0] + elif kl == 'expiration-time-stamp-in-utc': + d['expiration_time_stamp_in_utc'] = v[0] + else: + raise CLIError('Unsupported Key {} is provided for parameter remote_support_settings_list. All ' + 'possible keys are: remote-application-type, access-level, expiration-time-stamp-in-utc' + .format(k)) + return d + + +class AddContactInformation(argparse.Action): + def __call__(self, parser, namespace, values, option_string=None): + action = self.get_action(values, option_string) + namespace.contact_information = 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 == 'contact-person': + d['contact_person'] = v[0] + elif kl == 'company-name': + d['company_name'] = v[0] + elif kl == 'phone': + d['phone'] = v[0] + elif kl == 'email-list': + d['email_list'] = v + else: + raise CLIError('Unsupported Key {} is provided for parameter contact_information. All possible keys ' + 'are: contact-person, company-name, phone, email-list'.format(k)) + return d + + +class AddShippingAddress(argparse.Action): + def __call__(self, parser, namespace, values, option_string=None): + action = self.get_action(values, option_string) + namespace.shipping_address = action + + def get_action(self, values, option_string): # pylint: disable=no-self-use + try: + properties = defaultdict(list) + for (k, v) in (x.split('=', 1) for x in values): + properties[k].append(v) + properties = dict(properties) + except ValueError: + raise CLIError('usage error: {} [KEY=VALUE ...]'.format(option_string)) + d = {} + for k in properties: + kl = k.lower() + v = properties[k] + if kl == 'address-line1': + d['address_line1'] = v[0] + elif kl == 'address-line2': + d['address_line2'] = v[0] + elif kl == 'address-line3': + d['address_line3'] = v[0] + elif kl == 'postal-code': + d['postal_code'] = v[0] + elif kl == 'city': + d['city'] = v[0] + elif kl == 'state': + d['state'] = v[0] + elif kl == 'country': + d['country'] = v[0] + else: + raise CLIError('Unsupported Key {} is provided for parameter shipping_address. All possible keys are: ' + 'address-line1, address-line2, address-line3, postal-code, city, state, country'.format(k)) + return d + + +class AddAzureContainerInfo(argparse.Action): + def __call__(self, parser, namespace, values, option_string=None): + action = self.get_action(values, option_string) + namespace.azure_container_info = action + + def get_action(self, values, option_string): # pylint: disable=no-self-use + try: + properties = defaultdict(list) + for (k, v) in (x.split('=', 1) for x in values): + properties[k].append(v) + properties = dict(properties) + except ValueError: + raise CLIError('usage error: {} [KEY=VALUE ...]'.format(option_string)) + d = {} + for k in properties: + kl = k.lower() + v = properties[k] + if kl == 'storage-account-credential-id': + d['storage_account_credential_id'] = v[0] + elif kl == 'container-name': + d['container_name'] = v[0] + elif kl == 'data-format': + d['data_format'] = v[0] + else: + raise CLIError('Unsupported Key {} is provided for parameter azure_container_info. All possible keys ' + 'are: storage-account-credential-id, container-name, data-format'.format(k)) + return d + + +class AddUserAccessRights(argparse._AppendAction): + def __call__(self, parser, namespace, values, option_string=None): + action = self.get_action(values, option_string) + super(AddUserAccessRights, self).__call__(parser, namespace, action, option_string) + + def get_action(self, values, option_string): # pylint: disable=no-self-use + try: + properties = defaultdict(list) + for (k, v) in (x.split('=', 1) for x in values): + properties[k].append(v) + properties = dict(properties) + except ValueError: + raise CLIError('usage error: {} [KEY=VALUE ...]'.format(option_string)) + d = {} + for k in properties: + kl = k.lower() + v = properties[k] + if kl == 'user-id': + d['user_id'] = v[0] + elif kl == 'access-type': + d['access_type'] = v[0] + else: + raise CLIError('Unsupported Key {} is provided for parameter user_access_rights. All possible keys ' + 'are: user-id, access-type'.format(k)) + return d + + +class AddClientAccessRights(argparse._AppendAction): + def __call__(self, parser, namespace, values, option_string=None): + action = self.get_action(values, option_string) + super(AddClientAccessRights, self).__call__(parser, namespace, action, option_string) + + def get_action(self, values, option_string): # pylint: disable=no-self-use + try: + properties = defaultdict(list) + for (k, v) in (x.split('=', 1) for x in values): + properties[k].append(v) + properties = dict(properties) + except ValueError: + raise CLIError('usage error: {} [KEY=VALUE ...]'.format(option_string)) + d = {} + for k in properties: + kl = k.lower() + v = properties[k] + if kl == 'client': + d['client'] = v[0] + elif kl == 'access-permission': + d['access_permission'] = v[0] + else: + raise CLIError('Unsupported Key {} is provided for parameter client_access_rights. All possible keys ' + 'are: client, access-permission'.format(k)) + return d + + +class AddRefreshDetails(argparse.Action): + def __call__(self, parser, namespace, values, option_string=None): + action = self.get_action(values, option_string) + namespace.refresh_details = 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 == 'in-progress-refresh-job-id': + d['in_progress_refresh_job_id'] = v[0] + elif kl == 'last-completed-refresh-job-time-in-utc': + d['last_completed_refresh_job_time_in_utc'] = v[0] + elif kl == 'error-manifest-file': + d['error_manifest_file'] = v[0] + elif kl == 'last-job': + d['last_job'] = v[0] + else: + raise CLIError('Unsupported Key {} is provided for parameter refresh_details. All possible keys are: ' + 'in-progress-refresh-job-id, last-completed-refresh-job-time-in-utc, ' + 'error-manifest-file, last-job'.format(k)) + return d + + +class AddFileEventTrigger(argparse.Action): + def __call__(self, parser, namespace, values, option_string=None): + action = self.get_action(values, option_string) + namespace.file_event_trigger = 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 == 'custom-context-tag': + d['custom_context_tag'] = v[0] + elif kl == 'role-id': + d['role_id'] = v[0] + elif kl == 'share-id': + d['share_id'] = v[0] + else: + raise CLIError('Unsupported Key {} is provided for parameter file_event_trigger. All possible keys ' + 'are: custom-context-tag, role-id, share-id'.format(k)) + d['kind'] = 'FileEvent' + return d + + +class AddPeriodicTimerEventTrigger(argparse.Action): + def __call__(self, parser, namespace, values, option_string=None): + action = self.get_action(values, option_string) + namespace.periodic_timer_event_trigger = 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 == 'custom-context-tag': + d['custom_context_tag'] = v[0] + elif kl == 'role-id': + d['role_id'] = v[0] + elif kl == 'start-time': + d['start_time'] = v[0] + elif kl == 'schedule': + d['schedule'] = v[0] + elif kl == 'topic': + d['topic'] = v[0] + else: + raise CLIError('Unsupported Key {} is provided for parameter periodic_timer_event_trigger. All ' + 'possible keys are: custom-context-tag, role-id, start-time, schedule, topic'.format(k)) + d['kind'] = 'PeriodicTimerEvent' + return d diff --git a/src/databoxedge/azext_databoxedge/generated/commands.py b/src/databoxedge/azext_databoxedge/generated/commands.py new file mode 100644 index 00000000000..f5437edc052 --- /dev/null +++ b/src/databoxedge/azext_databoxedge/generated/commands.py @@ -0,0 +1,257 @@ +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- +# pylint: disable=too-many-statements +# pylint: disable=too-many-locals + +from azure.cli.core.commands import CliCommandType + + +def load_command_table(self, _): + + from azext_databoxedge.generated._client_factory import cf_available_sku + databoxedge_available_sku = CliCommandType( + operations_tmpl='azext_databoxedge.vendored_sdks.databoxedge.operations._available_skus_operations#AvailableSku' + 'sOperations.{}', + client_factory=cf_available_sku) + with self.command_group('databoxedge available-sku', databoxedge_available_sku, + client_factory=cf_available_sku) as g: + g.custom_command('list', 'databoxedge_available_sku_list') + + from azext_databoxedge.generated._client_factory import cf_device + databoxedge_device = CliCommandType( + operations_tmpl='azext_databoxedge.vendored_sdks.databoxedge.operations._devices_operations#DevicesOperations.{' + '}', + client_factory=cf_device) + with self.command_group('databoxedge device', databoxedge_device, client_factory=cf_device) as g: + g.custom_command('list', 'databoxedge_device_list') + g.custom_show_command('show', 'databoxedge_device_show') + g.custom_command('create', 'databoxedge_device_create') + g.custom_command('update', 'databoxedge_device_update') + g.custom_command('delete', 'databoxedge_device_delete', supports_no_wait=True, confirmation=True) + g.custom_command('create-or-update-security-setting', 'databoxedge_device_create_or_update_security_setting', + supports_no_wait=True) + g.custom_command('download-update', 'databoxedge_device_download_update', supports_no_wait=True) + g.custom_command('generate-certificate', 'databoxedge_device_generate_certificate') + g.custom_command('get-extended-information', 'databoxedge_device_get_extended_information') + 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-network-setting', 'databoxedge_device_show_network_setting') + g.custom_command('show-update-summary', 'databoxedge_device_show_update_summary') + g.custom_command('update-extended-information', 'databoxedge_device_update_extended_information') + g.custom_command('upload-certificate', 'databoxedge_device_upload_certificate') + g.custom_wait_command('wait', 'databoxedge_device_show') + + from azext_databoxedge.generated._client_factory import cf_alert + databoxedge_alert = CliCommandType( + operations_tmpl='azext_databoxedge.vendored_sdks.databoxedge.operations._alerts_operations#AlertsOperations.{}', + client_factory=cf_alert) + with self.command_group('databoxedge alert', databoxedge_alert, client_factory=cf_alert) as g: + g.custom_command('list', 'databoxedge_alert_list') + g.custom_show_command('show', 'databoxedge_alert_show') + + from azext_databoxedge.generated._client_factory import cf_bandwidth_schedule + databoxedge_bandwidth_schedule = CliCommandType( + operations_tmpl='azext_databoxedge.vendored_sdks.databoxedge.operations._bandwidth_schedules_operations#Bandwid' + 'thSchedulesOperations.{}', + client_factory=cf_bandwidth_schedule) + with self.command_group('databoxedge bandwidth-schedule', databoxedge_bandwidth_schedule, + client_factory=cf_bandwidth_schedule) 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', setter_name='begin_create_or_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 azext_databoxedge.generated._client_factory import cf_diagnostic_setting + databoxedge_diagnostic_setting = CliCommandType( + operations_tmpl='azext_databoxedge.vendored_sdks.databoxedge.operations._diagnostic_settings_operations#Diagnos' + 'ticSettingsOperations.{}', + client_factory=cf_diagnostic_setting) + with self.command_group('databoxedge diagnostic-setting', databoxedge_diagnostic_setting, + client_factory=cf_diagnostic_setting) as g: + g.custom_command('show-diagnostic-proactive-log-collection-setting', 'databoxedge_diagnostic_setting_show_diagn' + 'ostic_proactive_log_collection_setting') + g.custom_command('show-diagnostic-remote-support-setting', 'databoxedge_diagnostic_setting_show_diagnostic_remo' + 'te_support_setting') + g.custom_command('update-diagnostic-proactive-log-collection-setting', 'databoxedge_diagnostic_setting_update_d' + 'iagnostic_proactive_log_collection_setting') + g.custom_command('update-diagnostic-remote-support-setting', 'databoxedge_diagnostic_setting_update_diagnostic_' + 'remote_support_setting') + + from azext_databoxedge.generated._client_factory import cf_job + databoxedge_job = CliCommandType( + operations_tmpl='azext_databoxedge.vendored_sdks.databoxedge.operations._jobs_operations#JobsOperations.{}', + client_factory=cf_job) + with self.command_group('databoxedge job', databoxedge_job, client_factory=cf_job) as g: + g.custom_show_command('show', 'databoxedge_job_show') + + from azext_databoxedge.generated._client_factory import cf_node + databoxedge_node = CliCommandType( + operations_tmpl='azext_databoxedge.vendored_sdks.databoxedge.operations._nodes_operations#NodesOperations.{}', + client_factory=cf_node) + with self.command_group('databoxedge node', databoxedge_node, client_factory=cf_node) as g: + g.custom_command('list', 'databoxedge_node_list') + + from azext_databoxedge.generated._client_factory import cf_operation_status + databoxedge_operation_status = CliCommandType( + operations_tmpl='azext_databoxedge.vendored_sdks.databoxedge.operations._operations_status_operations#Operation' + 'sStatusOperations.{}', + client_factory=cf_operation_status) + with self.command_group('databoxedge operation-status', databoxedge_operation_status, + client_factory=cf_operation_status) as g: + g.custom_show_command('show', 'databoxedge_operation_status_show') + + from azext_databoxedge.generated._client_factory import cf_order + databoxedge_order = CliCommandType( + operations_tmpl='azext_databoxedge.vendored_sdks.databoxedge.operations._orders_operations#OrdersOperations.{}', + client_factory=cf_order) + with self.command_group('databoxedge order', databoxedge_order, client_factory=cf_order) 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', setter_name='begin_create_or_update', + 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_command('list-dc-access-code', 'databoxedge_order_list_dc_access_code') + g.custom_wait_command('wait', 'databoxedge_order_show') + + from azext_databoxedge.generated._client_factory import cf_role + databoxedge_role = CliCommandType( + operations_tmpl='azext_databoxedge.vendored_sdks.databoxedge.operations._roles_operations#RolesOperations.{}', + client_factory=cf_role) + with self.command_group('databoxedge role', databoxedge_role, client_factory=cf_role) as g: + g.custom_command('list', 'databoxedge_role_list') + g.custom_show_command('show', 'databoxedge_role_show') + g.custom_command('create', 'databoxedge_role_create', supports_no_wait=True) + g.custom_command('update', 'databoxedge_role_update', supports_no_wait=True) + g.custom_command('delete', 'databoxedge_role_delete', supports_no_wait=True, confirmation=True) + g.custom_wait_command('wait', 'databoxedge_role_show') + + from azext_databoxedge.generated._client_factory import cf_addon + databoxedge_addon = CliCommandType( + operations_tmpl='azext_databoxedge.vendored_sdks.databoxedge.operations._addons_operations#AddonsOperations.{}', + client_factory=cf_addon) + with self.command_group('databoxedge addon', databoxedge_addon, client_factory=cf_addon) as g: + g.custom_command('list', 'databoxedge_addon_list') + g.custom_show_command('show', 'databoxedge_addon_show') + g.custom_command('create', 'databoxedge_addon_create', supports_no_wait=True) + g.custom_command('update', 'databoxedge_addon_update', supports_no_wait=True) + g.custom_command('delete', 'databoxedge_addon_delete', supports_no_wait=True, confirmation=True) + g.custom_wait_command('wait', 'databoxedge_addon_show') + + from azext_databoxedge.generated._client_factory import cf_monitoring_config + databoxedge_monitoring_config = CliCommandType( + operations_tmpl='azext_databoxedge.vendored_sdks.databoxedge.operations._monitoring_config_operations#Monitorin' + 'gConfigOperations.{}', + client_factory=cf_monitoring_config) + with self.command_group('databoxedge monitoring-config', databoxedge_monitoring_config, + client_factory=cf_monitoring_config) as g: + g.custom_command('list', 'databoxedge_monitoring_config_list') + g.custom_show_command('show', 'databoxedge_monitoring_config_show') + g.custom_command('create', 'databoxedge_monitoring_config_create', supports_no_wait=True) + g.generic_update_command('update', setter_arg_name='monitoring_metric_configuration', + setter_name='begin_create_or_update', + custom_func_name='databoxedge_monitoring_config_update', supports_no_wait=True) + g.custom_command('delete', 'databoxedge_monitoring_config_delete', supports_no_wait=True, confirmation=True) + g.custom_wait_command('wait', 'databoxedge_monitoring_config_show') + + from azext_databoxedge.generated._client_factory import cf_share + databoxedge_share = CliCommandType( + operations_tmpl='azext_databoxedge.vendored_sdks.databoxedge.operations._shares_operations#SharesOperations.{}', + client_factory=cf_share) + with self.command_group('databoxedge share', databoxedge_share, client_factory=cf_share) as g: + g.custom_command('list', 'databoxedge_share_list') + g.custom_show_command('show', 'databoxedge_share_show') + g.custom_command('create', 'databoxedge_share_create', supports_no_wait=True) + g.generic_update_command('update', setter_arg_name='share', setter_name='begin_create_or_update', + custom_func_name='databoxedge_share_update', supports_no_wait=True) + g.custom_command('delete', 'databoxedge_share_delete', supports_no_wait=True, confirmation=True) + g.custom_command('refresh', 'databoxedge_share_refresh', supports_no_wait=True) + g.custom_wait_command('wait', 'databoxedge_share_show') + + from azext_databoxedge.generated._client_factory import cf_storage_account_credentials + databoxedge_storage_account_credentials = CliCommandType( + operations_tmpl='azext_databoxedge.vendored_sdks.databoxedge.operations._storage_account_credentials_operations' + '#StorageAccountCredentialsOperations.{}', + client_factory=cf_storage_account_credentials) + with self.command_group('databoxedge storage-account-credentials', databoxedge_storage_account_credentials, + client_factory=cf_storage_account_credentials) as g: + g.custom_command('list', 'databoxedge_storage_account_credentials_list') + g.custom_show_command('show', 'databoxedge_storage_account_credentials_show') + g.custom_command('delete', 'databoxedge_storage_account_credentials_delete', supports_no_wait=True, + confirmation=True) + g.custom_wait_command('wait', 'databoxedge_storage_account_credentials_show') + + from azext_databoxedge.generated._client_factory import cf_storage_account + databoxedge_storage_account = CliCommandType( + operations_tmpl='azext_databoxedge.vendored_sdks.databoxedge.operations._storage_accounts_operations#StorageAcc' + 'ountsOperations.{}', + client_factory=cf_storage_account) + with self.command_group('databoxedge storage-account', databoxedge_storage_account, + client_factory=cf_storage_account) as g: + g.custom_command('list', 'databoxedge_storage_account_list') + g.custom_show_command('show', 'databoxedge_storage_account_show') + g.custom_command('delete', 'databoxedge_storage_account_delete', supports_no_wait=True, confirmation=True) + g.custom_wait_command('wait', 'databoxedge_storage_account_show') + + from azext_databoxedge.generated._client_factory import cf_container + databoxedge_container = CliCommandType( + operations_tmpl='azext_databoxedge.vendored_sdks.databoxedge.operations._containers_operations#ContainersOperat' + 'ions.{}', + client_factory=cf_container) + with self.command_group('databoxedge container', databoxedge_container, client_factory=cf_container) as g: + g.custom_command('list', 'databoxedge_container_list') + g.custom_show_command('show', 'databoxedge_container_show') + g.custom_command('create', 'databoxedge_container_create', supports_no_wait=True) + g.generic_update_command('update', setter_arg_name='container', setter_name='begin_create_or_update', + custom_func_name='databoxedge_container_update', supports_no_wait=True) + g.custom_command('delete', 'databoxedge_container_delete', supports_no_wait=True, confirmation=True) + g.custom_command('refresh', 'databoxedge_container_refresh', supports_no_wait=True) + g.custom_wait_command('wait', 'databoxedge_container_show') + + from azext_databoxedge.generated._client_factory import cf_trigger + databoxedge_trigger = CliCommandType( + operations_tmpl='azext_databoxedge.vendored_sdks.databoxedge.operations._triggers_operations#TriggersOperations' + '.{}', + client_factory=cf_trigger) + with self.command_group('databoxedge trigger', databoxedge_trigger, client_factory=cf_trigger) as g: + g.custom_command('list', 'databoxedge_trigger_list') + g.custom_show_command('show', 'databoxedge_trigger_show') + g.custom_command('create', 'databoxedge_trigger_create', supports_no_wait=True) + g.custom_command('update', 'databoxedge_trigger_update', supports_no_wait=True) + g.custom_command('delete', 'databoxedge_trigger_delete', supports_no_wait=True, confirmation=True) + g.custom_wait_command('wait', 'databoxedge_trigger_show') + + from azext_databoxedge.generated._client_factory import cf_support_package + databoxedge_support_package = CliCommandType( + operations_tmpl='azext_databoxedge.vendored_sdks.databoxedge.operations._support_packages_operations#SupportPac' + 'kagesOperations.{}', + client_factory=cf_support_package) + with self.command_group('databoxedge support-package', databoxedge_support_package, + client_factory=cf_support_package) as g: + g.custom_command('trigger-support-package', 'databoxedge_support_package_trigger_support_package') + + from azext_databoxedge.generated._client_factory import cf_user + databoxedge_user = CliCommandType( + operations_tmpl='azext_databoxedge.vendored_sdks.databoxedge.operations._users_operations#UsersOperations.{}', + client_factory=cf_user) + with self.command_group('databoxedge user', databoxedge_user, client_factory=cf_user) as g: + g.custom_command('list', 'databoxedge_user_list') + g.custom_show_command('show', 'databoxedge_user_show') + g.custom_command('create', 'databoxedge_user_create', supports_no_wait=True) + g.generic_update_command('update', setter_arg_name='user', setter_name='begin_create_or_update', + custom_func_name='databoxedge_user_update', supports_no_wait=True) + g.custom_command('delete', 'databoxedge_user_delete', supports_no_wait=True, confirmation=True) + g.custom_wait_command('wait', 'databoxedge_user_show') + + with self.command_group('databoxedge', is_experimental=True): + pass diff --git a/src/databoxedge/azext_databoxedge/generated/custom.py b/src/databoxedge/azext_databoxedge/generated/custom.py new file mode 100644 index 00000000000..d795c571ad8 --- /dev/null +++ b/src/databoxedge/azext_databoxedge/generated/custom.py @@ -0,0 +1,982 @@ +# -------------------------------------------------------------------------- +# 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=unused-argument + +from knack.util import CLIError +from azure.cli.core.util import sdk_no_wait + + +def databoxedge_available_sku_list(client): + return client.list() + + +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, + kind=None, + data_box_edge_device_status=None, + type_=None, + msi_identity_type=None): + 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['kind'] = kind + data_box_edge_device['data_box_edge_device_status'] = data_box_edge_device_status + data_box_edge_device['data_residency'] = {} + data_box_edge_device['data_residency']['type'] = type_ + data_box_edge_device['identity'] = {} + data_box_edge_device['identity']['type'] = msi_identity_type + return 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, + id_=None, + type_=None): + parameters = {} + parameters['tags'] = tags + parameters['subscription'] = {} + parameters['subscription']['id'] = id_ + parameters['identity'] = {} + parameters['identity']['type'] = type_ + return client.update(device_name=device_name, + resource_group_name=resource_group_name, + parameters=parameters) + + +def databoxedge_device_delete(client, + device_name, + resource_group_name, + no_wait=False): + return sdk_no_wait(no_wait, + client.begin_delete, + device_name=device_name, + resource_group_name=resource_group_name) + + +def databoxedge_device_create_or_update_security_setting(client, + device_name, + resource_group_name, + device_admin_password, + no_wait=False): + security_settings = {} + security_settings['device_admin_password'] = device_admin_password + return sdk_no_wait(no_wait, + client.begin_create_or_update_security_settings, + device_name=device_name, + resource_group_name=resource_group_name, + security_settings=security_settings) + + +def databoxedge_device_download_update(client, + device_name, + resource_group_name, + no_wait=False): + return sdk_no_wait(no_wait, + client.begin_download_updates, + device_name=device_name, + resource_group_name=resource_group_name) + + +def databoxedge_device_generate_certificate(client, + device_name, + resource_group_name): + return client.generate_certificate(device_name=device_name, + resource_group_name=resource_group_name) + + +def databoxedge_device_get_extended_information(client, + device_name, + resource_group_name): + return client.get_extended_information(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.begin_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.begin_scan_for_updates, + device_name=device_name, + resource_group_name=resource_group_name) + + +def databoxedge_device_show_network_setting(client, + device_name, + resource_group_name): + return client.get_network_settings(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_device_update_extended_information(client, + device_name, + resource_group_name, + client_secret_store_id=None, + client_secret_store_url=None, + channel_integrity_key_name=None, + channel_integrity_key_version=None, + sync_status=None): + parameters = {} + parameters['client_secret_store_id'] = client_secret_store_id + parameters['client_secret_store_url'] = client_secret_store_url + parameters['channel_integrity_key_name'] = channel_integrity_key_name + parameters['channel_integrity_key_version'] = channel_integrity_key_version + parameters['sync_status'] = sync_status + return client.update_extended_information(device_name=device_name, + resource_group_name=resource_group_name, + parameters=parameters) + + +def databoxedge_device_upload_certificate(client, + device_name, + resource_group_name, + certificate, + authentication_type=None): + parameters = {} + parameters['authentication_type'] = authentication_type + parameters['certificate'] = certificate + return client.upload_certificate(device_name=device_name, + resource_group_name=resource_group_name, + parameters=parameters) + + +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.begin_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.begin_delete, + device_name=device_name, + name=name, + resource_group_name=resource_group_name) + + +def databoxedge_diagnostic_setting_show_diagnostic_proactive_log_collection_setting(client, + device_name, + resource_group_name): + return client.get_diagnostic_proactive_log_collection_settings(device_name=device_name, + resource_group_name=resource_group_name) + + +def databoxedge_diagnostic_setting_show_diagnostic_remote_support_setting(client, + device_name, + resource_group_name): + return client.get_diagnostic_remote_support_settings(device_name=device_name, + resource_group_name=resource_group_name) + + +def databoxedge_diagnostic_setting_update_diagnostic_proactive_log_collection_setting(client, + device_name, + resource_group_name, + user_consent): + proactive_log_collection_settings = {} + proactive_log_collection_settings['user_consent'] = user_consent + return client.begin_update_diagnostic_proactive_log_collection_settings(device_name=device_name, + resource_group_name=resource_group_name, + proactive_log_collection_settings=proactive_log_collection_settings) + + +def databoxedge_diagnostic_setting_update_diagnostic_remote_support_setting(client, + device_name, + resource_group_name, + remote_support_settings_list=None): + diagnostic_remote_support_settings = {} + diagnostic_remote_support_settings['remote_support_settings_list'] = remote_support_settings_list + return client.begin_update_diagnostic_remote_support_settings(device_name=device_name, + resource_group_name=resource_group_name, + diagnostic_remote_support_settings=diagnostic_remote_support_settings) + + +def databoxedge_job_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_node_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_operation_status_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_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, + contact_information=None, + shipping_address=None, + shipment_type=None, + no_wait=False): + order = {} + order['contact_information'] = contact_information + order['shipping_address'] = shipping_address + order['shipment_type'] = shipment_type + return sdk_no_wait(no_wait, + client.begin_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, + contact_information=None, + shipping_address=None, + shipment_type=None, + no_wait=False): + if contact_information is not None: + instance.contact_information = contact_information + if shipping_address is not None: + instance.shipping_address = shipping_address + if shipment_type is not None: + instance.shipment_type = shipment_type + return instance + + +def databoxedge_order_delete(client, + device_name, + resource_group_name, + no_wait=False): + return sdk_no_wait(no_wait, + client.begin_delete, + device_name=device_name, + resource_group_name=resource_group_name) + + +def databoxedge_order_list_dc_access_code(client, + device_name, + resource_group_name): + return client.list_dc_access_code(device_name=device_name, + resource_group_name=resource_group_name) + + +def databoxedge_role_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_role_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_role_create(client, + device_name, + name, + resource_group_name, + role, + no_wait=False): + return sdk_no_wait(no_wait, + client.begin_create_or_update, + device_name=device_name, + name=name, + resource_group_name=resource_group_name, + role=role) + + +def databoxedge_role_update(client, + device_name, + name, + resource_group_name, + role, + no_wait=False): + return sdk_no_wait(no_wait, + client.begin_create_or_update, + device_name=device_name, + name=name, + resource_group_name=resource_group_name, + role=role) + + +def databoxedge_role_delete(client, + device_name, + name, + resource_group_name, + no_wait=False): + return sdk_no_wait(no_wait, + client.begin_delete, + device_name=device_name, + name=name, + resource_group_name=resource_group_name) + + +def databoxedge_addon_list(client, + device_name, + role_name, + resource_group_name): + return client.list_by_role(device_name=device_name, + role_name=role_name, + resource_group_name=resource_group_name) + + +def databoxedge_addon_show(client, + device_name, + role_name, + addon_name, + resource_group_name): + return client.get(device_name=device_name, + role_name=role_name, + addon_name=addon_name, + resource_group_name=resource_group_name) + + +def databoxedge_addon_create(client, + device_name, + role_name, + addon_name, + resource_group_name, + addon, + no_wait=False): + return sdk_no_wait(no_wait, + client.begin_create_or_update, + device_name=device_name, + role_name=role_name, + addon_name=addon_name, + resource_group_name=resource_group_name, + addon=addon) + + +def databoxedge_addon_update(client, + device_name, + role_name, + addon_name, + resource_group_name, + addon, + no_wait=False): + return sdk_no_wait(no_wait, + client.begin_create_or_update, + device_name=device_name, + role_name=role_name, + addon_name=addon_name, + resource_group_name=resource_group_name, + addon=addon) + + +def databoxedge_addon_delete(client, + device_name, + role_name, + addon_name, + resource_group_name, + no_wait=False): + return sdk_no_wait(no_wait, + client.begin_delete, + device_name=device_name, + role_name=role_name, + addon_name=addon_name, + resource_group_name=resource_group_name) + + +def databoxedge_monitoring_config_list(client, + device_name, + role_name, + resource_group_name): + return client.list(device_name=device_name, + role_name=role_name, + resource_group_name=resource_group_name) + + +def databoxedge_monitoring_config_show(client, + device_name, + role_name, + resource_group_name): + return client.get(device_name=device_name, + role_name=role_name, + resource_group_name=resource_group_name) + + +def databoxedge_monitoring_config_create(client, + device_name, + role_name, + resource_group_name, + metric_configurations, + no_wait=False): + monitoring_metric_configuration = {} + monitoring_metric_configuration['metric_configurations'] = metric_configurations + return sdk_no_wait(no_wait, + client.begin_create_or_update, + device_name=device_name, + role_name=role_name, + resource_group_name=resource_group_name, + monitoring_metric_configuration=monitoring_metric_configuration) + + +def databoxedge_monitoring_config_update(instance, + device_name, + role_name, + resource_group_name, + metric_configurations, + no_wait=False): + if metric_configurations is not None: + instance.metric_configurations = metric_configurations + return instance + + +def databoxedge_monitoring_config_delete(client, + device_name, + role_name, + resource_group_name, + no_wait=False): + return sdk_no_wait(no_wait, + client.begin_delete, + device_name=device_name, + role_name=role_name, + resource_group_name=resource_group_name) + + +def databoxedge_share_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_share_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_share_create(client, + device_name, + name, + resource_group_name, + share_status, + monitoring_status, + access_protocol, + description=None, + azure_container_info=None, + user_access_rights=None, + client_access_rights=None, + refresh_details=None, + data_policy=None, + no_wait=False): + share = {} + share['description'] = description + share['share_status'] = share_status + share['monitoring_status'] = monitoring_status + share['azure_container_info'] = azure_container_info + share['access_protocol'] = access_protocol + share['user_access_rights'] = user_access_rights + share['client_access_rights'] = client_access_rights + share['refresh_details'] = refresh_details + share['data_policy'] = data_policy + return sdk_no_wait(no_wait, + client.begin_create_or_update, + device_name=device_name, + name=name, + resource_group_name=resource_group_name, + share=share) + + +def databoxedge_share_update(instance, + device_name, + name, + resource_group_name, + share_status, + monitoring_status, + access_protocol, + description=None, + azure_container_info=None, + user_access_rights=None, + client_access_rights=None, + refresh_details=None, + data_policy=None, + no_wait=False): + if description is not None: + instance.description = description + if share_status is not None: + instance.share_status = share_status + if monitoring_status is not None: + instance.monitoring_status = monitoring_status + if azure_container_info is not None: + instance.azure_container_info = azure_container_info + if access_protocol is not None: + instance.access_protocol = access_protocol + if user_access_rights is not None: + instance.user_access_rights = user_access_rights + if client_access_rights is not None: + instance.client_access_rights = client_access_rights + if refresh_details is not None: + instance.refresh_details = refresh_details + if data_policy is not None: + instance.data_policy = data_policy + return instance + + +def databoxedge_share_delete(client, + device_name, + name, + resource_group_name, + no_wait=False): + return sdk_no_wait(no_wait, + client.begin_delete, + device_name=device_name, + name=name, + resource_group_name=resource_group_name) + + +def databoxedge_share_refresh(client, + device_name, + name, + resource_group_name, + no_wait=False): + return sdk_no_wait(no_wait, + client.begin_refresh, + device_name=device_name, + name=name, + resource_group_name=resource_group_name) + + +def databoxedge_storage_account_credentials_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_storage_account_credentials_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_storage_account_credentials_delete(client, + device_name, + name, + resource_group_name, + no_wait=False): + return sdk_no_wait(no_wait, + client.begin_delete, + device_name=device_name, + name=name, + resource_group_name=resource_group_name) + + +def databoxedge_storage_account_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_storage_account_show(client, + device_name, + storage_account_name, + resource_group_name): + return client.get(device_name=device_name, + storage_account_name=storage_account_name, + resource_group_name=resource_group_name) + + +def databoxedge_storage_account_delete(client, + device_name, + storage_account_name, + resource_group_name, + no_wait=False): + return sdk_no_wait(no_wait, + client.begin_delete, + device_name=device_name, + storage_account_name=storage_account_name, + resource_group_name=resource_group_name) + + +def databoxedge_container_list(client, + device_name, + storage_account_name, + resource_group_name): + return client.list_by_storage_account(device_name=device_name, + storage_account_name=storage_account_name, + resource_group_name=resource_group_name) + + +def databoxedge_container_show(client, + device_name, + storage_account_name, + container_name, + resource_group_name): + return client.get(device_name=device_name, + storage_account_name=storage_account_name, + container_name=container_name, + resource_group_name=resource_group_name) + + +def databoxedge_container_create(client, + device_name, + storage_account_name, + container_name, + resource_group_name, + data_format, + no_wait=False): + container = {} + container['data_format'] = data_format + return sdk_no_wait(no_wait, + client.begin_create_or_update, + device_name=device_name, + storage_account_name=storage_account_name, + container_name=container_name, + resource_group_name=resource_group_name, + container=container) + + +def databoxedge_container_update(instance, + device_name, + storage_account_name, + container_name, + resource_group_name, + data_format, + no_wait=False): + if data_format is not None: + instance.data_format = data_format + return instance + + +def databoxedge_container_delete(client, + device_name, + storage_account_name, + container_name, + resource_group_name, + no_wait=False): + return sdk_no_wait(no_wait, + client.begin_delete, + device_name=device_name, + storage_account_name=storage_account_name, + container_name=container_name, + resource_group_name=resource_group_name) + + +def databoxedge_container_refresh(client, + device_name, + storage_account_name, + container_name, + resource_group_name, + no_wait=False): + return sdk_no_wait(no_wait, + client.begin_refresh, + device_name=device_name, + storage_account_name=storage_account_name, + container_name=container_name, + resource_group_name=resource_group_name) + + +def databoxedge_trigger_list(client, + device_name, + resource_group_name, + filter_=None): + return client.list_by_data_box_edge_device(device_name=device_name, + resource_group_name=resource_group_name, + filter=filter_) + + +def databoxedge_trigger_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_trigger_create(client, + device_name, + name, + resource_group_name, + file_event_trigger=None, + periodic_timer_event_trigger=None, + no_wait=False): + all_trigger = [] + if file_event_trigger is not None: + all_trigger.append(file_event_trigger) + if periodic_timer_event_trigger is not None: + all_trigger.append(periodic_timer_event_trigger) + if len(all_trigger) > 1: + raise CLIError('at most one of file_event_trigger, periodic_timer_event_trigger is needed for trigger!') + if len(all_trigger) != 1: + raise CLIError('trigger is required. but none of file_event_trigger, periodic_timer_event_trigger is provided!') + trigger = all_trigger[0] if len(all_trigger) == 1 else None + return sdk_no_wait(no_wait, + client.begin_create_or_update, + device_name=device_name, + name=name, + resource_group_name=resource_group_name, + trigger=trigger) + + +def databoxedge_trigger_update(client, + device_name, + name, + resource_group_name, + file_event_trigger=None, + periodic_timer_event_trigger=None, + no_wait=False): + all_trigger = [] + if file_event_trigger is not None: + all_trigger.append(file_event_trigger) + if periodic_timer_event_trigger is not None: + all_trigger.append(periodic_timer_event_trigger) + if len(all_trigger) > 1: + raise CLIError('at most one of file_event_trigger, periodic_timer_event_trigger is needed for trigger!') + if len(all_trigger) != 1: + raise CLIError('trigger is required. but none of file_event_trigger, periodic_timer_event_trigger is provided!') + trigger = all_trigger[0] if len(all_trigger) == 1 else None + return sdk_no_wait(no_wait, + client.begin_create_or_update, + device_name=device_name, + name=name, + resource_group_name=resource_group_name, + trigger=trigger) + + +def databoxedge_trigger_delete(client, + device_name, + name, + resource_group_name, + no_wait=False): + return sdk_no_wait(no_wait, + client.begin_delete, + device_name=device_name, + name=name, + resource_group_name=resource_group_name) + + +def databoxedge_support_package_trigger_support_package(client, + device_name, + resource_group_name, + minimum_time_stamp=None, + maximum_time_stamp=None, + include=None): + trigger_support_package_request = {} + trigger_support_package_request['minimum_time_stamp'] = minimum_time_stamp + trigger_support_package_request['maximum_time_stamp'] = maximum_time_stamp + trigger_support_package_request['include'] = include + return client.begin_trigger_support_package(device_name=device_name, + resource_group_name=resource_group_name, + trigger_support_package_request=trigger_support_package_request) + + +def databoxedge_user_list(client, + device_name, + resource_group_name, + filter_=None): + return client.list_by_data_box_edge_device(device_name=device_name, + resource_group_name=resource_group_name, + filter=filter_) + + +def databoxedge_user_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_user_create(client, + device_name, + name, + resource_group_name, + user_type, + encrypted_password=None, + no_wait=False): + user = {} + user['encrypted_password'] = encrypted_password + user['user_type'] = user_type + return sdk_no_wait(no_wait, + client.begin_create_or_update, + device_name=device_name, + name=name, + resource_group_name=resource_group_name, + user=user) + + +def databoxedge_user_update(instance, + device_name, + name, + resource_group_name, + user_type, + encrypted_password=None, + no_wait=False): + if encrypted_password is not None: + instance.encrypted_password = encrypted_password + if user_type is not None: + instance.user_type = user_type + return instance + + +def databoxedge_user_delete(client, + device_name, + name, + resource_group_name, + no_wait=False): + return sdk_no_wait(no_wait, + client.begin_delete, + device_name=device_name, + name=name, + resource_group_name=resource_group_name) diff --git a/src/databoxedge/azext_databoxedge/manual/__init__.py b/src/databoxedge/azext_databoxedge/manual/__init__.py new file mode 100644 index 00000000000..c9cfdc73e77 --- /dev/null +++ b/src/databoxedge/azext_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/databoxedge/azext_databoxedge/tests/__init__.py b/src/databoxedge/azext_databoxedge/tests/__init__.py new file mode 100644 index 00000000000..70488e93851 --- /dev/null +++ b/src/databoxedge/azext_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/databoxedge/azext_databoxedge/tests/latest/__init__.py b/src/databoxedge/azext_databoxedge/tests/latest/__init__.py new file mode 100644 index 00000000000..c9cfdc73e77 --- /dev/null +++ b/src/databoxedge/azext_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/databoxedge/azext_databoxedge/tests/latest/example_steps.py b/src/databoxedge/azext_databoxedge/tests/latest/example_steps.py new file mode 100644 index 00000000000..9944e0e7eb3 --- /dev/null +++ b/src/databoxedge/azext_databoxedge/tests/latest/example_steps.py @@ -0,0 +1,906 @@ +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + + +from .. import try_manual + + +# EXAMPLE: /Devices/put/DataBoxEdgeDevicePut +@try_manual +def step_device_create(test, rg_2, rg, rg_3, checks=None): + if checks is None: + checks = [] + test.cmd('az databoxedge device create ' + '--location "WUS" ' + '--sku name="Edge" tier="Standard" ' + '--name "{myDevice}" ' + '--resource-group "{rg}"', + checks=checks) + + +# EXAMPLE: /Devices/get/DataBoxEdgeDeviceGetByName +@try_manual +def step_device_show(test, rg_2, rg, rg_3, 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_2, rg, rg_3, 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_2, rg, rg_3, checks=None): + if checks is None: + checks = [] + test.cmd('az databoxedge device list ' + '-g ""', + checks=checks) + + +# EXAMPLE: /Devices/get/NetworkSettingsGet +@try_manual +def step_device_show_network_setting(test, rg_2, rg, rg_3, checks=None): + if checks is None: + checks = [] + test.cmd('az databoxedge device show-network-setting ' + '--name "{myDevice}" ' + '--resource-group "{rg}"', + checks=checks) + + +# EXAMPLE: /Devices/get/UpdateSummaryGet +@try_manual +def step_device_show_update_summary(test, rg_2, rg, rg_3, 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_2, rg, rg_3, checks=None): + if checks is None: + checks = [] + test.cmd('az databoxedge device update ' + '--name "{myDevice}" ' + '--id "/subscriptions/{subscription_id}/resourceGroups/{rg_2}/providers/Microsoft.AzureStack/linkedSubscri' + 'ptions/ca014ddc-5cf2-45f8-b390-e901e4a0ae87" ' + '--resource-group "{rg}"', + checks=checks) + + +# EXAMPLE: /Devices/post/CreateOrUpdateSecuritySettings +@try_manual +def step_device_create_or_update_security_setting(test, rg_2, rg, rg_3, checks=None): + if checks is None: + checks = [] + test.cmd('az databoxedge device create-or-update-security-setting ' + '--name "{myDevice}" ' + '--resource-group "{rg_3}" ' + '--device-admin-password encryption-algorithm="AES256" encryption-cert-thumbprint="" ' + 'value=""', + checks=checks) + + +# EXAMPLE: /Devices/post/DownloadUpdatesPost +@try_manual +def step_device_download_update(test, rg_2, rg, rg_3, checks=None): + if checks is None: + checks = [] + test.cmd('az databoxedge device download-update ' + '--name "{myDevice}" ' + '--resource-group "{rg}"', + checks=checks) + + +# EXAMPLE: /Devices/post/ExtendedInfoPost +@try_manual +def step_device_get_extended_information(test, rg_2, rg, rg_3, checks=None): + if checks is None: + checks = [] + test.cmd('az databoxedge device get-extended-information ' + '--name "{myDevice}" ' + '--resource-group "{rg}"', + checks=checks) + + +# EXAMPLE: /Devices/post/GenerateCertificate +@try_manual +def step_device_generate_certificate(test, rg_2, rg, rg_3, checks=None): + if checks is None: + checks = [] + test.cmd('az databoxedge device generate-certificate ' + '--name "{myDevice}" ' + '--resource-group "{rg}"', + checks=checks) + + +# EXAMPLE: /Devices/post/GetUpdateExtendedInfo +@try_manual +def step_device_update_extended_information(test, rg_2, rg, rg_3, checks=None): + if checks is None: + checks = [] + test.cmd('az databoxedge device update-extended-information ' + '--name "{myDevice}" ' + '--resource-group "{rg}"', + checks=checks) + + +# EXAMPLE: /Devices/post/InstallUpdatesPost +@try_manual +def step_device_install_update(test, rg_2, rg, rg_3, 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_2, rg, rg_3, checks=None): + if checks is None: + checks = [] + test.cmd('az databoxedge device scan-for-update ' + '--name "{myDevice}" ' + '--resource-group "{rg}"', + checks=checks) + + +# EXAMPLE: /Devices/post/UploadCertificatePost +@try_manual +def step_device_upload_certificate(test, rg_2, rg, rg_3, checks=None): + if checks is None: + checks = [] + test.cmd('az databoxedge device upload-certificate ' + '--name "{myDevice}" ' + '--certificate "MIIC9DCCAdygAwIBAgIQWJae7GNjiI9Mcv/gJyrOPTANBgkqhkiG9w0BAQUFADASMRAwDgYDVQQDDAdXaW5kb3dzMB' + '4XDTE4MTEyNzAwMTA0NVoXDTIxMTEyODAwMTA0NVowEjEQMA4GA1UEAwwHV2luZG93czCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQo' + 'CggEBAKxkRExqxf0qH1avnyORptIbRC2yQwqe3EIbJ2FPKr5jtAppGeX/dGKrFSnX+7/0HFr77aJHafdpEAtOiLyJ4zCAVs0obZCCIq4q' + 'JdmjYUTU0UXH/w/YzXfQA0d9Zh9AN+NJBX9xj05NzgsT24fkgsK2v6mWJQXT7YcWAsl5sEYPnx1e+MrupNyVSL/RUJmrS+etJSysHtFeW' + 'RhsUhVAs1DD5ExJvBLU3WH0IsojEvpXcjrutB5/MDQNrd/StGI6WovoSSPH7FyT9tgERx+q+Yg3YUGzfaIPCctlrRGehcdtzdNoKd0rsX' + '62yCq0U6POoSfwe22NJu41oAUMd7e6R8cCAwEAAaNGMEQwEwYDVR0lBAwwCgYIKwYBBQUHAwIwHQYDVR0OBBYEFDd0VxnS3LnMIfwc7xW' + '4b4IZWG5GMA4GA1UdDwEB/wQEAwIFIDANBgkqhkiG9w0BAQUFAAOCAQEAPQRby2u9celvtvL/DLEb5Vt3/tPStRQC5MyTD62L5RT/q8E6' + 'EMCXVZNkXF5WlWucLJi/18tY+9PNgP9xWLJh7kpSWlWdi9KPtwMqKDlEH8L2TnQdjimt9XuiCrTnoFy/1X2BGLY/rCaUJNSd15QCkz2xe' + 'W+Z+YSk2GwAc/A/4YfNpqSIMfNuPrT76o02VdD9WmJUA3fS/HY0sU9qgQRS/3F5/0EPS+HYQ0SvXCK9tggcCd4O050ytNBMJC9qMOJ7yE' + '0iOrFfOJSCfDAuPhn/rHFh79Kn1moF+/CE+nc0/2RPiLC8r54/rt5dYyyxJDfXg0a3VrrX39W69WZGW5OXiw==" ' + '--resource-group "{rg}"', + checks=checks) + + +# EXAMPLE: /Addons/put/PutAddOns +@try_manual +def step_addon_create(test, rg_2, rg, rg_3, checks=None): + if checks is None: + checks = [] + test.cmd('az databoxedge addon create ' + '--addon "{{\\"kind\\":\\"ArcForKubernetes\\",\\"properties\\":{{\\"resourceGroupName\\":\\"{rg}\\",\\"res' + 'ourceLocation\\":\\"EastUS\\",\\"resourceName\\":\\"{myDevice}\\",\\"subscriptionId\\":\\"4385cf00-2d3a-4' + '25a-832f-f4285b1c9dce\\"}}}}" ' + '--name "{myAddon}" ' + '--device-name "{myDevice}" ' + '--resource-group "{rg}" ' + '--role-name "{myRole2}"', + checks=checks) + + +# EXAMPLE: /Addons/get/GetAddOns +@try_manual +def step_addon_show(test, rg_2, rg, rg_3, checks=None): + if checks is None: + checks = [] + test.cmd('az databoxedge addon show ' + '--name "{myAddon}" ' + '--device-name "{myDevice}" ' + '--resource-group "{rg}" ' + '--role-name "{myRole2}"', + checks=checks) + + +# EXAMPLE: /Addons/get/RoleListAddOns +@try_manual +def step_addon_list(test, rg_2, rg, rg_3, checks=None): + if checks is None: + checks = [] + test.cmd('az databoxedge addon list ' + '--device-name "{myDevice}" ' + '--resource-group "{rg}" ' + '--role-name "{myRole}"', + checks=checks) + + +# EXAMPLE: /Addons/delete/DeleteAddOns +@try_manual +def step_addon_delete(test, rg_2, rg, rg_3, checks=None): + if checks is None: + checks = [] + test.cmd('az databoxedge addon delete -y ' + '--name "{myAddon}" ' + '--device-name "{myDevice}" ' + '--resource-group "{rg}" ' + '--role-name "{myRole2}"', + checks=checks) + + +# EXAMPLE: /Alerts/get/AlertGet +@try_manual +def step_alert_show(test, rg_2, rg, rg_3, 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_2, rg, rg_3, checks=None): + if checks is None: + checks = [] + test.cmd('az databoxedge alert list ' + '--device-name "{myDevice}" ' + '--resource-group "{rg}"', + checks=checks) + + +# EXAMPLE: /AvailableSkus/get/AvailableSkus +@try_manual +def step_available_sku_list(test, rg_2, rg, rg_3, checks=None): + if checks is None: + checks = [] + test.cmd('az databoxedge available-sku list', + checks=checks) + + +# EXAMPLE: /BandwidthSchedules/put/BandwidthSchedulePut +@try_manual +def step_bandwidth_schedule_create(test, rg_2, rg, rg_3, 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_2, rg, rg_3, 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_2, rg, rg_3, 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_2, rg, rg_3, 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: /Containers/put/ContainerPut +@try_manual +def step_container_create(test, rg_2, rg, rg_3, checks=None): + if checks is None: + checks = [] + test.cmd('az databoxedge container create ' + '--data-format "BlockBlob" ' + '--name "{myContainer}" ' + '--device-name "{myDevice}" ' + '--resource-group "{rg}" ' + '--storage-account-name "{sa_2}"', + checks=checks) + + +# EXAMPLE: /Containers/get/ContainerGet +@try_manual +def step_container_show(test, rg_2, rg, rg_3, checks=None): + if checks is None: + checks = [] + test.cmd('az databoxedge container show ' + '--name "{myContainer}" ' + '--device-name "{myDevice}" ' + '--resource-group "{rg}" ' + '--storage-account-name "{sa_2}"', + checks=checks) + + +# EXAMPLE: /Containers/get/ContainerListAllInDevice +@try_manual +def step_container_list(test, rg_2, rg, rg_3, checks=None): + if checks is None: + checks = [] + test.cmd('az databoxedge container list ' + '--device-name "{myDevice}" ' + '--resource-group "{rg}" ' + '--storage-account-name "{sa_2}"', + checks=checks) + + +# EXAMPLE: /Containers/post/ContainerRefresh +@try_manual +def step_container_refresh(test, rg_2, rg, rg_3, checks=None): + if checks is None: + checks = [] + test.cmd('az databoxedge container refresh ' + '--name "{myContainer}" ' + '--device-name "{myDevice}" ' + '--resource-group "{rg}" ' + '--storage-account-name "{sa_2}"', + checks=checks) + + +# EXAMPLE: /Containers/delete/ContainerDelete +@try_manual +def step_container_delete(test, rg_2, rg, rg_3, checks=None): + if checks is None: + checks = [] + test.cmd('az databoxedge container delete -y ' + '--name "{myContainer}" ' + '--device-name "{myDevice}" ' + '--resource-group "{rg}" ' + '--storage-account-name "{sa_2}"', + checks=checks) + + +# EXAMPLE: /DiagnosticSettings/put/UpdateDiagnosticProactiveLogCollectionSettings +@try_manual +def step_diagnostic_setting_update(test, rg_2, rg, rg_3, checks=None): + if checks is None: + checks = [] + test.cmd('az databoxedge diagnostic-setting update-diagnostic-proactive-log-collection-setting ' + '--device-name "{myDevice}" ' + '--user-consent "Enabled" ' + '--resource-group "{rg}"', + checks=checks) + + +# EXAMPLE: /DiagnosticSettings/put/UpdateDiagnosticRemoteSupportSettings +@try_manual +def step_diagnostic_setting_update2(test, rg_2, rg, rg_3, checks=None): + if checks is None: + checks = [] + test.cmd('az databoxedge diagnostic-setting update-diagnostic-remote-support-setting ' + '--device-name "{myDevice}" ' + '--remote-support-settings-list access-level="ReadWrite" expiration-time-stamp-in-utc="2021-07-07T00:00:00' + '+00:00" remote-application-type="Powershell" ' + '--resource-group "{rg}"', + checks=checks) + + +# EXAMPLE: /DiagnosticSettings/get/GetDiagnosticProactiveLogCollectionSettings +@try_manual +def step_diagnostic_setting_show(test, rg_2, rg, rg_3, checks=None): + if checks is None: + checks = [] + test.cmd('az databoxedge diagnostic-setting show-diagnostic-proactive-log-collection-setting ' + '--device-name "{myDevice}" ' + '--resource-group "{rg}"', + checks=checks) + + +# EXAMPLE: /DiagnosticSettings/get/GetDiagnosticRemoteSupportSettings +@try_manual +def step_diagnostic_setting_show2(test, rg_2, rg, rg_3, checks=None): + if checks is None: + checks = [] + test.cmd('az databoxedge diagnostic-setting show-diagnostic-remote-support-setting ' + '--device-name "{myDevice}" ' + '--resource-group "{rg}"', + checks=checks) + + +# EXAMPLE: /Jobs/get/JobsGet +@try_manual +def step_job_show(test, rg_2, rg, rg_3, checks=None): + if checks is None: + checks = [] + test.cmd('az databoxedge job show ' + '--name "159a00c7-8543-4343-9435-263ac87df3bb" ' + '--device-name "{myDevice}" ' + '--resource-group "{rg}"', + checks=checks) + + +# EXAMPLE: /MonitoringConfig/put/PutMonitoringConfig +@try_manual +def step_monitoring_config_create(test, rg_2, rg, rg_3, checks=None): + if checks is None: + checks = [] + test.cmd('az databoxedge monitoring-config create ' + '--device-name "{myDevice}" ' + '--metric-configurations "[{{\\"counterSets\\":[{{\\"counters\\":[{{\\"name\\":\\"test\\"}}]}}],\\"mdmAcco' + 'unt\\":\\"test\\",\\"metricNameSpace\\":\\"test\\",\\"resourceId\\":\\"test\\"}}]" ' + '--resource-group "{rg}" ' + '--role-name "{myRole3}"', + checks=checks) + + +# EXAMPLE: /MonitoringConfig/get/GetMonitoringConfig +@try_manual +def step_monitoring_config_show(test, rg_2, rg, rg_3, checks=None): + if checks is None: + checks = [] + test.cmd('az databoxedge monitoring-config show ' + '--device-name "{myDevice}" ' + '--resource-group "{rg}" ' + '--role-name "{myRole3}"', + checks=checks) + + +# EXAMPLE: /MonitoringConfig/get/ListMonitoringConfig +@try_manual +def step_monitoring_config_list(test, rg_2, rg, rg_3, checks=None): + if checks is None: + checks = [] + test.cmd('az databoxedge monitoring-config list ' + '--device-name "{myDevice}" ' + '--resource-group "{rg}" ' + '--role-name "{myRole3}"', + checks=checks) + + +# EXAMPLE: /MonitoringConfig/delete/DeleteMonitoringConfig +@try_manual +def step_monitoring_config_delete(test, rg_2, rg, rg_3, checks=None): + if checks is None: + checks = [] + test.cmd('az databoxedge monitoring-config delete -y ' + '--device-name "{myDevice}" ' + '--resource-group "{rg}" ' + '--role-name "{myRole3}"', + checks=checks) + + +# EXAMPLE: /Nodes/get/NodesGetAllInDevice +@try_manual +def step_node_list(test, rg_2, rg, rg_3, checks=None): + if checks is None: + checks = [] + test.cmd('az databoxedge node list ' + '--device-name "{myDevice}" ' + '--resource-group "{rg}"', + checks=checks) + + +# EXAMPLE: /OperationsStatus/get/OperationsStatusGet +@try_manual +def step_operation_status_show(test, rg_2, rg, rg_3, checks=None): + if checks is None: + checks = [] + test.cmd('az databoxedge operation-status show ' + '--name "159a00c7-8543-4343-9435-263ac87df3bb" ' + '--device-name "{myDevice}" ' + '--resource-group "{rg}"', + checks=checks) + + +# EXAMPLE: /Orders/put/OrderPut +@try_manual +def step_order_create(test, rg_2, rg, rg_3, checks=None): + if checks is None: + checks = [] + test.cmd('az databoxedge order create ' + '--device-name "{myDevice}" ' + '--contact-information company-name="Microsoft" contact-person="John Mcclane" ' + 'email-list="john@microsoft.com" phone="(800) 426-9400" ' + '--shipping-address address-line1="Microsoft Corporation" address-line2="One Microsoft Way" ' + 'address-line3="Redmond" city="WA" country="USA" postal-code="98052" state="WA" ' + '--resource-group "{rg}"', + checks=checks) + + +# EXAMPLE: /Orders/get/OrderGet +@try_manual +def step_order_show(test, rg_2, rg, rg_3, 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_2, rg, rg_3, checks=None): + if checks is None: + checks = [] + test.cmd('az databoxedge order list ' + '--device-name "{myDevice}" ' + '--resource-group "{rg}"', + checks=checks) + + +# EXAMPLE: /Orders/post/GetDCAccessCode +@try_manual +def step_order_list_dc_access_code(test, rg_2, rg, rg_3, checks=None): + if checks is None: + checks = [] + test.cmd('az databoxedge order list-dc-access-code ' + '--device-name "{myDevice}" ' + '--resource-group "{rg}"', + checks=checks) + + +# EXAMPLE: /Orders/delete/OrderDelete +@try_manual +def step_order_delete(test, rg_2, rg, rg_3, checks=None): + if checks is None: + checks = [] + test.cmd('az databoxedge order delete -y ' + '--device-name "{myDevice}" ' + '--resource-group "{rg}"', + checks=checks) + + +# EXAMPLE: /Roles/put/RolePut +@try_manual +def step_role_create(test, rg_2, rg, rg_3, checks=None): + if checks is None: + checks = [] + test.cmd('az databoxedge role create ' + '--name "{myRole}" ' + '--device-name "{myDevice}" ' + '--resource-group "{rg}" ' + '--role "{{\\"kind\\":\\"IOT\\",\\"properties\\":{{\\"hostPlatform\\":\\"Linux\\",\\"ioTDeviceDetails\\":{' + '{\\"authentication\\":{{\\"symmetricKey\\":{{\\"connectionString\\":{{\\"encryptionAlgorithm\\":\\"AES256' + '\\",\\"encryptionCertThumbprint\\":\\"348586569999244\\",\\"value\\":\\"Encrypted<>\\"}}}}}},\\"d' + 'eviceId\\":\\"iotdevice\\",\\"ioTHostHub\\":\\"iothub.azure-devices.net\\"}},\\"ioTEdgeDeviceDetails\\":{' + '{\\"authentication\\":{{\\"symmetricKey\\":{{\\"connectionString\\":{{\\"encryptionAlgorithm\\":\\"AES256' + '\\",\\"encryptionCertThumbprint\\":\\"1245475856069999244\\",\\"value\\":\\"Encrypted<>\\"}}}}}},\\' + '"deviceId\\":\\"iotEdge\\",\\"ioTHostHub\\":\\"iothub.azure-devices.net\\"}},\\"roleStatus\\":\\"Enabled' + '\\",\\"shareMappings\\":[]}}}}"', + checks=checks) + + +# EXAMPLE: /Roles/get/RoleGet +@try_manual +def step_role_show(test, rg_2, rg, rg_3, checks=None): + if checks is None: + checks = [] + test.cmd('az databoxedge role show ' + '--name "{myRole}" ' + '--device-name "{myDevice}" ' + '--resource-group "{rg}"', + checks=checks) + + +# EXAMPLE: /Roles/get/RoleGetAllInDevice +@try_manual +def step_role_list(test, rg_2, rg, rg_3, checks=None): + if checks is None: + checks = [] + test.cmd('az databoxedge role list ' + '--device-name "{myDevice}" ' + '--resource-group "{rg}"', + checks=checks) + + +# EXAMPLE: /Roles/delete/RoleDelete +@try_manual +def step_role_delete(test, rg_2, rg, rg_3, checks=None): + if checks is None: + checks = [] + test.cmd('az databoxedge role delete -y ' + '--name "{myRole}" ' + '--device-name "{myDevice}" ' + '--resource-group "{rg}"', + checks=checks) + + +# EXAMPLE: /StorageAccountCredentials/get/SACGet +@try_manual +def step_storage_account_credentials_show(test, rg_2, rg, rg_3, checks=None): + if checks is None: + checks = [] + test.cmd('az databoxedge storage-account-credentials show ' + '--name "{myStorageAccountCredentials}" ' + '--device-name "{myDevice}" ' + '--resource-group "{rg}"', + checks=checks) + + +# EXAMPLE: /StorageAccountCredentials/get/SACGetAllInDevice +@try_manual +def step_storage_account_credentials_list(test, rg_2, rg, rg_3, checks=None): + if checks is None: + checks = [] + test.cmd('az databoxedge storage-account-credentials list ' + '--device-name "{myDevice}" ' + '--resource-group "{rg}"', + checks=checks) + + +# EXAMPLE: /Shares/put/SharePut +@try_manual +def step_share_create(test, rg_2, rg, rg_3, checks=None): + if checks is None: + checks = [] + test.cmd('az databoxedge share create ' + '--name "smbshare" ' + '--device-name "{myDevice}" ' + '--resource-group "{rg}" ' + '--description "" ' + '--access-protocol "SMB" ' + '--azure-container-info container-name="testContainerSMB" data-format="BlockBlob" ' + 'storage-account-credential-id="/subscriptions/{subscription_id}/resourceGroups/{rg}/providers/Microsoft.D' + 'ataBoxEdge/dataBoxEdgeDevices/{{myDevice}}/storageAccountCredentials/{myStorageAccountCredentials}" ' + '--data-policy "Cloud" ' + '--monitoring-status "Enabled" ' + '--share-status "Online" ' + '--user-access-rights access-type="Change" user-id="/subscriptions/{subscription_id}/resourceGroups/{rg}/p' + 'roviders/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{{myDevice}}/users/{myUser}"', + checks=checks) + + +# EXAMPLE: /Shares/get/ShareGet +@try_manual +def step_share_show(test, rg_2, rg, rg_3, checks=None): + if checks is None: + checks = [] + test.cmd('az databoxedge share show ' + '--name "smbshare" ' + '--device-name "{myDevice}" ' + '--resource-group "{rg}"', + checks=checks) + + +# EXAMPLE: /Shares/get/ShareGetAllInDevice +@try_manual +def step_share_list(test, rg_2, rg, rg_3, checks=None): + if checks is None: + checks = [] + test.cmd('az databoxedge share list ' + '--device-name "{myDevice}" ' + '--resource-group "{rg}"', + checks=checks) + + +# EXAMPLE: /Shares/post/ShareRefreshPost +@try_manual +def step_share_refresh(test, rg_2, rg, rg_3, checks=None): + if checks is None: + checks = [] + test.cmd('az databoxedge share refresh ' + '--name "smbshare" ' + '--device-name "{myDevice}" ' + '--resource-group "{rg}"', + checks=checks) + + +# EXAMPLE: /Shares/delete/ShareDelete +@try_manual +def step_share_delete(test, rg_2, rg, rg_3, checks=None): + if checks is None: + checks = [] + test.cmd('az databoxedge share delete -y ' + '--name "smbshare" ' + '--device-name "{myDevice}" ' + '--resource-group "{rg}"', + checks=checks) + + +# EXAMPLE: /StorageAccountCredentials/delete/SACDelete +@try_manual +def step_storage_account_credentials_delete(test, rg_2, rg, rg_3, checks=None): + if checks is None: + checks = [] + test.cmd('az databoxedge storage-account-credentials delete -y ' + '--name "{myStorageAccountCredentials}" ' + '--device-name "{myDevice}" ' + '--resource-group "{rg}"', + checks=checks) + + +# EXAMPLE: /StorageAccounts/get/StorageAccountGet +@try_manual +def step_storage_account_show(test, rg_2, rg, rg_3, checks=None): + if checks is None: + checks = [] + test.cmd('az databoxedge storage-account show ' + '--device-name "{myDevice}" ' + '--resource-group "{rg}" ' + '--name "{sa}"', + checks=checks) + + +# EXAMPLE: /StorageAccounts/get/StorageAccountGetAllInDevice +@try_manual +def step_storage_account_list(test, rg_2, rg, rg_3, checks=None): + if checks is None: + checks = [] + test.cmd('az databoxedge storage-account list ' + '--device-name "{myDevice}" ' + '--resource-group "{rg}"', + checks=checks) + + +# EXAMPLE: /StorageAccounts/delete/StorageAccountDelete +@try_manual +def step_storage_account_delete(test, rg_2, rg, rg_3, checks=None): + if checks is None: + checks = [] + test.cmd('az databoxedge storage-account delete -y ' + '--device-name "{myDevice}" ' + '--resource-group "{rg}" ' + '--name "{sa_2}"', + checks=checks) + + +# EXAMPLE: /SupportPackages/post/TriggerSupportPackage +@try_manual +def step_support_package_trigger_support_package(test, rg_2, rg, rg_3, checks=None): + if checks is None: + checks = [] + test.cmd('az databoxedge support-package trigger-support-package ' + '--device-name "{myDevice}" ' + '--resource-group "{rg}" ' + '--include "DefaultWithDumps" ' + '--maximum-time-stamp "2018-12-18T02:19:51.4270267Z" ' + '--minimum-time-stamp "2018-12-18T02:18:51.4270267Z"', + checks=checks) + + +# EXAMPLE: /Triggers/put/TriggerPut +@try_manual +def step_trigger_create(test, rg_2, rg, rg_3, checks=None): + if checks is None: + checks = [] + test.cmd('az databoxedge trigger create ' + '--name "trigger1" ' + '--device-name "{myDevice}" ' + '--resource-group "{rg}" ' + '--file-event-trigger custom-context-tag="CustomContextTags-1235346475" role-id="/subscriptions/{subscript' + 'ion_id}/resourceGroups/{rg}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{{myDevice}}/roles/{myRole' + '4}" share-id="/subscriptions/{subscription_id}/resourceGroups/{rg}/providers/Microsoft.DataBoxEdge/dataBo' + 'xEdgeDevices/{{myDevice}}/shares/{myShare}"', + checks=checks) + + +# EXAMPLE: /Triggers/get/TriggerGet +@try_manual +def step_trigger_show(test, rg_2, rg, rg_3, checks=None): + if checks is None: + checks = [] + test.cmd('az databoxedge trigger show ' + '--name "trigger1" ' + '--device-name "{myDevice}" ' + '--resource-group "{rg}"', + checks=checks) + + +# EXAMPLE: /Triggers/get/TriggerGetAllInDevice +@try_manual +def step_trigger_list(test, rg_2, rg, rg_3, checks=None): + if checks is None: + checks = [] + test.cmd('az databoxedge trigger list ' + '--device-name "{myDevice}" ' + '--resource-group "{rg}"', + checks=checks) + + +# EXAMPLE: /Triggers/delete/TriggerDelete +@try_manual +def step_trigger_delete(test, rg_2, rg, rg_3, checks=None): + if checks is None: + checks = [] + test.cmd('az databoxedge trigger delete -y ' + '--name "trigger1" ' + '--device-name "{myDevice}" ' + '--resource-group "{rg}"', + checks=checks) + + +# EXAMPLE: /Users/put/UserPut +@try_manual +def step_user_create(test, rg_2, rg, rg_3, checks=None): + if checks is None: + checks = [] + test.cmd('az databoxedge user create ' + '--name "user1" ' + '--device-name "{myDevice}" ' + '--resource-group "{rg}" ' + '--encrypted-password encryption-algorithm="None" encryption-cert-thumbprint="blah" value="" ' + '--user-type "Share"', + checks=checks) + + +# EXAMPLE: /Users/get/UserGet +@try_manual +def step_user_show(test, rg_2, rg, rg_3, checks=None): + if checks is None: + checks = [] + test.cmd('az databoxedge user show ' + '--name "user1" ' + '--device-name "{myDevice}" ' + '--resource-group "{rg}"', + checks=checks) + + +# EXAMPLE: /Users/get/UserGetAllInDevice +@try_manual +def step_user_list(test, rg_2, rg, rg_3, checks=None): + if checks is None: + checks = [] + test.cmd('az databoxedge user list ' + '--device-name "{myDevice}" ' + '--resource-group "{rg}"', + checks=checks) + + +# EXAMPLE: /Users/delete/UserDelete +@try_manual +def step_user_delete(test, rg_2, rg, rg_3, checks=None): + if checks is None: + checks = [] + test.cmd('az databoxedge user delete -y ' + '--name "user1" ' + '--device-name "{myDevice}" ' + '--resource-group "{rg}"', + checks=checks) + + +# EXAMPLE: /Devices/delete/DataBoxEdgeDeviceDelete +@try_manual +def step_device_delete(test, rg_2, rg, rg_3, checks=None): + if checks is None: + checks = [] + test.cmd('az databoxedge device delete -y ' + '--name "{myDevice}" ' + '--resource-group "{rg}"', + checks=checks) + diff --git a/src/databoxedge/azext_databoxedge/tests/latest/test_databoxedge_scenario.py b/src/databoxedge/azext_databoxedge/tests/latest/test_databoxedge_scenario.py new file mode 100644 index 00000000000..b71fc684df8 --- /dev/null +++ b/src/databoxedge/azext_databoxedge/tests/latest/test_databoxedge_scenario.py @@ -0,0 +1,215 @@ +# -------------------------------------------------------------------------- +# 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 azure.cli.testsdk import StorageAccountPreparer +from .example_steps import step_device_create +from .example_steps import step_user_create +from .example_steps import step_role_create +from .example_steps import step_share_create +from .example_steps import step_order_create +from .example_steps import step_trigger_create +from .example_steps import step_bandwidth_schedule_create +from .example_steps import step_container_create +from .example_steps import step_container_show +from .example_steps import step_storage_account_credentials_show +from .example_steps import step_container_list +from .example_steps import step_bandwidth_schedule_show +from .example_steps import step_operation_status_show +from .example_steps import step_storage_account_show +from .example_steps import step_device_show_network_setting +from .example_steps import step_device_show_update_summary +from .example_steps import step_trigger_show +from .example_steps import step_storage_account_credentials_list +from .example_steps import step_alert_show +from .example_steps import step_share_show +from .example_steps import step_order_show +from .example_steps import step_user_show +from .example_steps import step_role_show +from .example_steps import step_job_show +from .example_steps import step_bandwidth_schedule_list +from .example_steps import step_storage_account_list +from .example_steps import step_trigger_list +from .example_steps import step_order_list +from .example_steps import step_alert_list +from .example_steps import step_share_list +from .example_steps import step_node_list +from .example_steps import step_role_list +from .example_steps import step_user_list +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_container_refresh +from .example_steps import step_device_create_or_update_security_setting +from .example_steps import step_share_refresh +from .example_steps import step_device_get_extended_information +from .example_steps import step_device_upload_certificate +from .example_steps import step_device_download_update +from .example_steps import step_device_scan_for_update +from .example_steps import step_device_install_update +from .example_steps import step_device_update +from .example_steps import step_container_delete +from .example_steps import step_storage_account_credentials_delete +from .example_steps import step_bandwidth_schedule_delete +from .example_steps import step_storage_account_delete +from .example_steps import step_trigger_delete +from .example_steps import step_share_delete +from .example_steps import step_order_delete +from .example_steps import step_user_delete +from .example_steps import step_role_delete +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_scenario +@try_manual +def setup_scenario(test, rg_2, rg, rg_3): + pass + + +# Env cleanup_scenario +@try_manual +def cleanup_scenario(test, rg_2, rg, rg_3): + pass + + +# Testcase: Scenario +@try_manual +def call_scenario(test, rg_2, rg, rg_3): + setup_scenario(test, rg_2, rg, rg_3) + step_device_create(test, rg_2, rg, rg_3, checks=[ + test.check("location", "WUS", 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_user_create(test, rg_2, rg, rg_3, checks=[]) + step_role_create(test, rg_2, rg, rg_3, checks=[]) + step_share_create(test, rg_2, rg, rg_3, checks=[]) + step_order_create(test, rg_2, rg, rg_3, checks=[]) + step_trigger_create(test, rg_2, rg, rg_3, checks=[]) + # STEP NOT FOUND: StorageAccountPut + step_bandwidth_schedule_create(test, rg_2, rg, rg_3, checks=[]) + # STEP NOT FOUND: SACPut + step_container_create(test, rg_2, rg, rg_3, checks=[ + test.check("dataFormat", "BlockBlob", case_sensitive=False), + ]) + step_container_show(test, rg_2, rg, rg_3, checks=[ + test.check("dataFormat", "BlockBlob", case_sensitive=False), + test.check("name", "{myContainer}", case_sensitive=False), + ]) + step_storage_account_credentials_show(test, rg_2, rg, rg_3, checks=[]) + step_container_list(test, rg_2, rg, rg_3, checks=[ + test.check('length(@)', 1), + ]) + step_bandwidth_schedule_show(test, rg_2, rg, rg_3, checks=[]) + step_operation_status_show(test, rg_2, rg, rg_3, checks=[]) + step_storage_account_show(test, rg_2, rg, rg_3, checks=[]) + step_device_show_network_setting(test, rg_2, rg, rg_3, checks=[]) + step_device_show_update_summary(test, rg_2, rg, rg_3, checks=[]) + step_trigger_show(test, rg_2, rg, rg_3, checks=[]) + step_storage_account_credentials_list(test, rg_2, rg, rg_3, checks=[]) + step_alert_show(test, rg_2, rg, rg_3, checks=[]) + step_share_show(test, rg_2, rg, rg_3, checks=[]) + step_order_show(test, rg_2, rg, rg_3, checks=[]) + step_user_show(test, rg_2, rg, rg_3, checks=[]) + step_role_show(test, rg_2, rg, rg_3, checks=[]) + step_job_show(test, rg_2, rg, rg_3, checks=[]) + step_bandwidth_schedule_list(test, rg_2, rg, rg_3, checks=[]) + step_storage_account_list(test, rg_2, rg, rg_3, checks=[]) + step_trigger_list(test, rg_2, rg, rg_3, checks=[]) + step_order_list(test, rg_2, rg, rg_3, checks=[]) + step_alert_list(test, rg_2, rg, rg_3, checks=[]) + step_share_list(test, rg_2, rg, rg_3, checks=[]) + step_node_list(test, rg_2, rg, rg_3, checks=[]) + step_role_list(test, rg_2, rg, rg_3, checks=[]) + step_user_list(test, rg_2, rg, rg_3, checks=[]) + step_device_show(test, rg_2, rg, rg_3, checks=[ + test.check("sku.name", "Edge", case_sensitive=False), + test.check("sku.tier", "Standard", case_sensitive=False), + ]) + step_device_list(test, rg_2, rg, rg_3, checks=[ + test.check('length(@)', 1), + ]) + step_device_list2(test, rg_2, rg, rg_3, checks=[ + test.check('length(@)', 1), + ]) + # STEP NOT FOUND: ListSkus + # STEP NOT FOUND: ListAvailableSkus + # STEP NOT FOUND: OperationsGet + step_container_refresh(test, rg_2, rg, rg_3, checks=[]) + step_device_create_or_update_security_setting(test, rg_2, rg, rg_3, checks=[]) + step_share_refresh(test, rg_2, rg, rg_3, checks=[]) + step_device_get_extended_information(test, rg_2, rg, rg_3, checks=[]) + step_device_upload_certificate(test, rg_2, rg, rg_3, checks=[]) + step_device_download_update(test, rg_2, rg, rg_3, checks=[]) + step_device_scan_for_update(test, rg_2, rg, rg_3, checks=[]) + step_device_install_update(test, rg_2, rg, rg_3, checks=[]) + step_device_update(test, rg_2, rg, rg_3, checks=[ + test.check("name", "{myDevice}", case_sensitive=False), + ]) + step_container_delete(test, rg_2, rg, rg_3, checks=[]) + step_storage_account_credentials_delete(test, rg_2, rg, rg_3, checks=[]) + step_bandwidth_schedule_delete(test, rg_2, rg, rg_3, checks=[]) + step_storage_account_delete(test, rg_2, rg, rg_3, checks=[]) + step_trigger_delete(test, rg_2, rg, rg_3, checks=[]) + step_share_delete(test, rg_2, rg, rg_3, checks=[]) + step_order_delete(test, rg_2, rg, rg_3, checks=[]) + step_user_delete(test, rg_2, rg, rg_3, checks=[]) + step_role_delete(test, rg_2, rg, rg_3, checks=[]) + step_device_delete(test, rg_2, rg, rg_3, checks=[]) + cleanup_scenario(test, rg_2, rg, rg_3) + + +# Test class for Scenario +@try_manual +class DataboxedgeScenarioTest(ScenarioTest): + + def __init__(self, *args, **kwargs): + super(DataboxedgeScenarioTest, self).__init__(*args, **kwargs) + self.kwargs.update({ + 'subscription_id': self.get_subscription_id() + }) + + self.kwargs.update({ + 'myDevice': 'testedgedevice', + 'myRole4': 'role1', + 'myRole': 'IoTRole1', + 'myRole2': 'KubernetesRole', + 'myRole3': 'testrole', + 'myAddon': 'arcName', + 'myStorageAccountCredentials': 'sac1', + 'myContainer': 'blobcontainer1', + 'myUser': 'user2', + 'myShare': 'share1', + }) + + + @ResourceGroupPreparer(name_prefix='clitestdataboxedge_rapvs-rg'[:7], key='rg_2', parameter_name='rg_2') + @ResourceGroupPreparer(name_prefix='clitestdataboxedge_GroupForEdgeAutomation'[:7], key='rg', parameter_name='rg') + @ResourceGroupPreparer(name_prefix='clitestdataboxedge_AzureVM'[:7], key='rg_3', parameter_name='rg_3') + @StorageAccountPreparer(name_prefix='clitestdataboxedge_blobstorageaccount1'[:7], key='sa', + resource_group_parameter_name='rg_2') + @StorageAccountPreparer(name_prefix='clitestdataboxedge_storageaccount1'[:7], key='sa_2', + resource_group_parameter_name='rg_2') + def test_databoxedge_Scenario(self, rg_2, rg, rg_3): + call_scenario(self, rg_2, rg, rg_3) + calc_coverage(__file__) + raise_if() + diff --git a/src/databoxedge/azext_databoxedge/vendored_sdks/__init__.py b/src/databoxedge/azext_databoxedge/vendored_sdks/__init__.py new file mode 100644 index 00000000000..c9cfdc73e77 --- /dev/null +++ b/src/databoxedge/azext_databoxedge/vendored_sdks/__init__.py @@ -0,0 +1,12 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +__path__ = __import__('pkgutil').extend_path(__path__, __name__) diff --git a/src/databoxedge/azext_databoxedge/vendored_sdks/databoxedge/__init__.py b/src/databoxedge/azext_databoxedge/vendored_sdks/databoxedge/__init__.py new file mode 100644 index 00000000000..e63196b6b98 --- /dev/null +++ b/src/databoxedge/azext_databoxedge/vendored_sdks/databoxedge/__init__.py @@ -0,0 +1,16 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from ._data_box_edge_management_client import DataBoxEdgeManagementClient +__all__ = ['DataBoxEdgeManagementClient'] + +try: + from ._patch import patch_sdk # type: ignore + patch_sdk() +except ImportError: + pass diff --git a/src/databoxedge/azext_databoxedge/vendored_sdks/databoxedge/_configuration.py b/src/databoxedge/azext_databoxedge/vendored_sdks/databoxedge/_configuration.py new file mode 100644 index 00000000000..8eed562caf2 --- /dev/null +++ b/src/databoxedge/azext_databoxedge/vendored_sdks/databoxedge/_configuration.py @@ -0,0 +1,70 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from typing import TYPE_CHECKING + +from azure.core.configuration import Configuration +from azure.core.pipeline import policies +from azure.mgmt.core.policies import ARMHttpLoggingPolicy + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any + + from azure.core.credentials import TokenCredential + +VERSION = "unknown" + +class DataBoxEdgeManagementClientConfiguration(Configuration): + """Configuration for DataBoxEdgeManagementClient. + + Note that all parameters used to create this instance are saved as instance + attributes. + + :param credential: Credential needed for the client to connect to Azure. + :type credential: ~azure.core.credentials.TokenCredential + :param subscription_id: The subscription ID. + :type subscription_id: str + """ + + def __init__( + self, + credential, # type: "TokenCredential" + subscription_id, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + if credential is None: + raise ValueError("Parameter 'credential' must not be None.") + if subscription_id is None: + raise ValueError("Parameter 'subscription_id' must not be None.") + super(DataBoxEdgeManagementClientConfiguration, self).__init__(**kwargs) + + self.credential = credential + self.subscription_id = subscription_id + self.api_version = "2021-02-01" + self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default']) + kwargs.setdefault('sdk_moniker', 'databoxedgemanagementclient/{}'.format(VERSION)) + self._configure(**kwargs) + + def _configure( + self, + **kwargs # type: Any + ): + # type: (...) -> None + self.user_agent_policy = kwargs.get('user_agent_policy') or policies.UserAgentPolicy(**kwargs) + self.headers_policy = kwargs.get('headers_policy') or policies.HeadersPolicy(**kwargs) + self.proxy_policy = kwargs.get('proxy_policy') or policies.ProxyPolicy(**kwargs) + self.logging_policy = kwargs.get('logging_policy') or policies.NetworkTraceLoggingPolicy(**kwargs) + self.http_logging_policy = kwargs.get('http_logging_policy') or ARMHttpLoggingPolicy(**kwargs) + self.retry_policy = kwargs.get('retry_policy') or policies.RetryPolicy(**kwargs) + self.custom_hook_policy = kwargs.get('custom_hook_policy') or policies.CustomHookPolicy(**kwargs) + self.redirect_policy = kwargs.get('redirect_policy') or policies.RedirectPolicy(**kwargs) + self.authentication_policy = kwargs.get('authentication_policy') + if self.credential and not self.authentication_policy: + self.authentication_policy = policies.BearerTokenCredentialPolicy(self.credential, *self.credential_scopes, **kwargs) diff --git a/src/databoxedge/azext_databoxedge/vendored_sdks/databoxedge/_data_box_edge_management_client.py b/src/databoxedge/azext_databoxedge/vendored_sdks/databoxedge/_data_box_edge_management_client.py new file mode 100644 index 00000000000..1aa3dc6c244 --- /dev/null +++ b/src/databoxedge/azext_databoxedge/vendored_sdks/databoxedge/_data_box_edge_management_client.py @@ -0,0 +1,164 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from typing import TYPE_CHECKING + +from azure.mgmt.core import ARMPipelineClient +from msrest import Deserializer, Serializer + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Optional + + from azure.core.credentials import TokenCredential + +from ._configuration import DataBoxEdgeManagementClientConfiguration +from .operations import Operations +from .operations import AvailableSkusOperations +from .operations import DevicesOperations +from .operations import AlertsOperations +from .operations import BandwidthSchedulesOperations +from .operations import DiagnosticSettingsOperations +from .operations import JobsOperations +from .operations import NodesOperations +from .operations import OperationsStatusOperations +from .operations import OrdersOperations +from .operations import RolesOperations +from .operations import AddonsOperations +from .operations import MonitoringConfigOperations +from .operations import SharesOperations +from .operations import StorageAccountCredentialsOperations +from .operations import StorageAccountsOperations +from .operations import ContainersOperations +from .operations import TriggersOperations +from .operations import SupportPackagesOperations +from .operations import UsersOperations +from . import models + + +class DataBoxEdgeManagementClient(object): + """DataBoxEdgeManagementClient. + + :ivar operations: Operations operations + :vartype operations: data_box_edge_management_client.operations.Operations + :ivar available_skus: AvailableSkusOperations operations + :vartype available_skus: data_box_edge_management_client.operations.AvailableSkusOperations + :ivar devices: DevicesOperations operations + :vartype devices: data_box_edge_management_client.operations.DevicesOperations + :ivar alerts: AlertsOperations operations + :vartype alerts: data_box_edge_management_client.operations.AlertsOperations + :ivar bandwidth_schedules: BandwidthSchedulesOperations operations + :vartype bandwidth_schedules: data_box_edge_management_client.operations.BandwidthSchedulesOperations + :ivar diagnostic_settings: DiagnosticSettingsOperations operations + :vartype diagnostic_settings: data_box_edge_management_client.operations.DiagnosticSettingsOperations + :ivar jobs: JobsOperations operations + :vartype jobs: data_box_edge_management_client.operations.JobsOperations + :ivar nodes: NodesOperations operations + :vartype nodes: data_box_edge_management_client.operations.NodesOperations + :ivar operations_status: OperationsStatusOperations operations + :vartype operations_status: data_box_edge_management_client.operations.OperationsStatusOperations + :ivar orders: OrdersOperations operations + :vartype orders: data_box_edge_management_client.operations.OrdersOperations + :ivar roles: RolesOperations operations + :vartype roles: data_box_edge_management_client.operations.RolesOperations + :ivar addons: AddonsOperations operations + :vartype addons: data_box_edge_management_client.operations.AddonsOperations + :ivar monitoring_config: MonitoringConfigOperations operations + :vartype monitoring_config: data_box_edge_management_client.operations.MonitoringConfigOperations + :ivar shares: SharesOperations operations + :vartype shares: data_box_edge_management_client.operations.SharesOperations + :ivar storage_account_credentials: StorageAccountCredentialsOperations operations + :vartype storage_account_credentials: data_box_edge_management_client.operations.StorageAccountCredentialsOperations + :ivar storage_accounts: StorageAccountsOperations operations + :vartype storage_accounts: data_box_edge_management_client.operations.StorageAccountsOperations + :ivar containers: ContainersOperations operations + :vartype containers: data_box_edge_management_client.operations.ContainersOperations + :ivar triggers: TriggersOperations operations + :vartype triggers: data_box_edge_management_client.operations.TriggersOperations + :ivar support_packages: SupportPackagesOperations operations + :vartype support_packages: data_box_edge_management_client.operations.SupportPackagesOperations + :ivar users: UsersOperations operations + :vartype users: data_box_edge_management_client.operations.UsersOperations + :param credential: Credential needed for the client to connect to Azure. + :type credential: ~azure.core.credentials.TokenCredential + :param subscription_id: The subscription ID. + :type subscription_id: str + :param str base_url: Service URL + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + """ + + def __init__( + self, + credential, # type: "TokenCredential" + subscription_id, # type: str + base_url=None, # type: Optional[str] + **kwargs # type: Any + ): + # type: (...) -> None + if not base_url: + base_url = 'https://management.azure.com' + self._config = DataBoxEdgeManagementClientConfiguration(credential, subscription_id, **kwargs) + self._client = ARMPipelineClient(base_url=base_url, config=self._config, **kwargs) + + client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} + self._serialize = Serializer(client_models) + self._deserialize = Deserializer(client_models) + + self.operations = Operations( + self._client, self._config, self._serialize, self._deserialize) + self.available_skus = AvailableSkusOperations( + self._client, self._config, self._serialize, self._deserialize) + self.devices = DevicesOperations( + self._client, self._config, self._serialize, self._deserialize) + self.alerts = AlertsOperations( + self._client, self._config, self._serialize, self._deserialize) + self.bandwidth_schedules = BandwidthSchedulesOperations( + self._client, self._config, self._serialize, self._deserialize) + self.diagnostic_settings = DiagnosticSettingsOperations( + self._client, self._config, self._serialize, self._deserialize) + self.jobs = JobsOperations( + self._client, self._config, self._serialize, self._deserialize) + self.nodes = NodesOperations( + self._client, self._config, self._serialize, self._deserialize) + self.operations_status = OperationsStatusOperations( + self._client, self._config, self._serialize, self._deserialize) + self.orders = OrdersOperations( + self._client, self._config, self._serialize, self._deserialize) + self.roles = RolesOperations( + self._client, self._config, self._serialize, self._deserialize) + self.addons = AddonsOperations( + self._client, self._config, self._serialize, self._deserialize) + self.monitoring_config = MonitoringConfigOperations( + self._client, self._config, self._serialize, self._deserialize) + self.shares = SharesOperations( + self._client, self._config, self._serialize, self._deserialize) + self.storage_account_credentials = StorageAccountCredentialsOperations( + self._client, self._config, self._serialize, self._deserialize) + self.storage_accounts = StorageAccountsOperations( + self._client, self._config, self._serialize, self._deserialize) + self.containers = ContainersOperations( + self._client, self._config, self._serialize, self._deserialize) + self.triggers = TriggersOperations( + self._client, self._config, self._serialize, self._deserialize) + self.support_packages = SupportPackagesOperations( + self._client, self._config, self._serialize, self._deserialize) + self.users = UsersOperations( + self._client, self._config, self._serialize, self._deserialize) + + def close(self): + # type: () -> None + self._client.close() + + def __enter__(self): + # type: () -> DataBoxEdgeManagementClient + self._client.__enter__() + return self + + def __exit__(self, *exc_details): + # type: (Any) -> None + self._client.__exit__(*exc_details) diff --git a/src/databoxedge/azext_databoxedge/vendored_sdks/databoxedge/aio/__init__.py b/src/databoxedge/azext_databoxedge/vendored_sdks/databoxedge/aio/__init__.py new file mode 100644 index 00000000000..c33d46ee91d --- /dev/null +++ b/src/databoxedge/azext_databoxedge/vendored_sdks/databoxedge/aio/__init__.py @@ -0,0 +1,10 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from ._data_box_edge_management_client import DataBoxEdgeManagementClient +__all__ = ['DataBoxEdgeManagementClient'] diff --git a/src/databoxedge/azext_databoxedge/vendored_sdks/databoxedge/aio/_configuration.py b/src/databoxedge/azext_databoxedge/vendored_sdks/databoxedge/aio/_configuration.py new file mode 100644 index 00000000000..d3ef571f854 --- /dev/null +++ b/src/databoxedge/azext_databoxedge/vendored_sdks/databoxedge/aio/_configuration.py @@ -0,0 +1,66 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from typing import Any, TYPE_CHECKING + +from azure.core.configuration import Configuration +from azure.core.pipeline import policies +from azure.mgmt.core.policies import ARMHttpLoggingPolicy + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from azure.core.credentials_async import AsyncTokenCredential + +VERSION = "unknown" + +class DataBoxEdgeManagementClientConfiguration(Configuration): + """Configuration for DataBoxEdgeManagementClient. + + Note that all parameters used to create this instance are saved as instance + attributes. + + :param credential: Credential needed for the client to connect to Azure. + :type credential: ~azure.core.credentials_async.AsyncTokenCredential + :param subscription_id: The subscription ID. + :type subscription_id: str + """ + + def __init__( + self, + credential: "AsyncTokenCredential", + subscription_id: str, + **kwargs: Any + ) -> None: + if credential is None: + raise ValueError("Parameter 'credential' must not be None.") + if subscription_id is None: + raise ValueError("Parameter 'subscription_id' must not be None.") + super(DataBoxEdgeManagementClientConfiguration, self).__init__(**kwargs) + + self.credential = credential + self.subscription_id = subscription_id + self.api_version = "2021-02-01" + self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default']) + kwargs.setdefault('sdk_moniker', 'databoxedgemanagementclient/{}'.format(VERSION)) + self._configure(**kwargs) + + def _configure( + self, + **kwargs: Any + ) -> None: + self.user_agent_policy = kwargs.get('user_agent_policy') or policies.UserAgentPolicy(**kwargs) + self.headers_policy = kwargs.get('headers_policy') or policies.HeadersPolicy(**kwargs) + self.proxy_policy = kwargs.get('proxy_policy') or policies.ProxyPolicy(**kwargs) + self.logging_policy = kwargs.get('logging_policy') or policies.NetworkTraceLoggingPolicy(**kwargs) + self.http_logging_policy = kwargs.get('http_logging_policy') or ARMHttpLoggingPolicy(**kwargs) + self.retry_policy = kwargs.get('retry_policy') or policies.AsyncRetryPolicy(**kwargs) + self.custom_hook_policy = kwargs.get('custom_hook_policy') or policies.CustomHookPolicy(**kwargs) + self.redirect_policy = kwargs.get('redirect_policy') or policies.AsyncRedirectPolicy(**kwargs) + self.authentication_policy = kwargs.get('authentication_policy') + if self.credential and not self.authentication_policy: + self.authentication_policy = policies.AsyncBearerTokenCredentialPolicy(self.credential, *self.credential_scopes, **kwargs) diff --git a/src/databoxedge/azext_databoxedge/vendored_sdks/databoxedge/aio/_data_box_edge_management_client.py b/src/databoxedge/azext_databoxedge/vendored_sdks/databoxedge/aio/_data_box_edge_management_client.py new file mode 100644 index 00000000000..d9644656608 --- /dev/null +++ b/src/databoxedge/azext_databoxedge/vendored_sdks/databoxedge/aio/_data_box_edge_management_client.py @@ -0,0 +1,158 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from typing import Any, Optional, TYPE_CHECKING + +from azure.mgmt.core import AsyncARMPipelineClient +from msrest import Deserializer, Serializer + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from azure.core.credentials_async import AsyncTokenCredential + +from ._configuration import DataBoxEdgeManagementClientConfiguration +from .operations import Operations +from .operations import AvailableSkusOperations +from .operations import DevicesOperations +from .operations import AlertsOperations +from .operations import BandwidthSchedulesOperations +from .operations import DiagnosticSettingsOperations +from .operations import JobsOperations +from .operations import NodesOperations +from .operations import OperationsStatusOperations +from .operations import OrdersOperations +from .operations import RolesOperations +from .operations import AddonsOperations +from .operations import MonitoringConfigOperations +from .operations import SharesOperations +from .operations import StorageAccountCredentialsOperations +from .operations import StorageAccountsOperations +from .operations import ContainersOperations +from .operations import TriggersOperations +from .operations import SupportPackagesOperations +from .operations import UsersOperations +from .. import models + + +class DataBoxEdgeManagementClient(object): + """DataBoxEdgeManagementClient. + + :ivar operations: Operations operations + :vartype operations: data_box_edge_management_client.aio.operations.Operations + :ivar available_skus: AvailableSkusOperations operations + :vartype available_skus: data_box_edge_management_client.aio.operations.AvailableSkusOperations + :ivar devices: DevicesOperations operations + :vartype devices: data_box_edge_management_client.aio.operations.DevicesOperations + :ivar alerts: AlertsOperations operations + :vartype alerts: data_box_edge_management_client.aio.operations.AlertsOperations + :ivar bandwidth_schedules: BandwidthSchedulesOperations operations + :vartype bandwidth_schedules: data_box_edge_management_client.aio.operations.BandwidthSchedulesOperations + :ivar diagnostic_settings: DiagnosticSettingsOperations operations + :vartype diagnostic_settings: data_box_edge_management_client.aio.operations.DiagnosticSettingsOperations + :ivar jobs: JobsOperations operations + :vartype jobs: data_box_edge_management_client.aio.operations.JobsOperations + :ivar nodes: NodesOperations operations + :vartype nodes: data_box_edge_management_client.aio.operations.NodesOperations + :ivar operations_status: OperationsStatusOperations operations + :vartype operations_status: data_box_edge_management_client.aio.operations.OperationsStatusOperations + :ivar orders: OrdersOperations operations + :vartype orders: data_box_edge_management_client.aio.operations.OrdersOperations + :ivar roles: RolesOperations operations + :vartype roles: data_box_edge_management_client.aio.operations.RolesOperations + :ivar addons: AddonsOperations operations + :vartype addons: data_box_edge_management_client.aio.operations.AddonsOperations + :ivar monitoring_config: MonitoringConfigOperations operations + :vartype monitoring_config: data_box_edge_management_client.aio.operations.MonitoringConfigOperations + :ivar shares: SharesOperations operations + :vartype shares: data_box_edge_management_client.aio.operations.SharesOperations + :ivar storage_account_credentials: StorageAccountCredentialsOperations operations + :vartype storage_account_credentials: data_box_edge_management_client.aio.operations.StorageAccountCredentialsOperations + :ivar storage_accounts: StorageAccountsOperations operations + :vartype storage_accounts: data_box_edge_management_client.aio.operations.StorageAccountsOperations + :ivar containers: ContainersOperations operations + :vartype containers: data_box_edge_management_client.aio.operations.ContainersOperations + :ivar triggers: TriggersOperations operations + :vartype triggers: data_box_edge_management_client.aio.operations.TriggersOperations + :ivar support_packages: SupportPackagesOperations operations + :vartype support_packages: data_box_edge_management_client.aio.operations.SupportPackagesOperations + :ivar users: UsersOperations operations + :vartype users: data_box_edge_management_client.aio.operations.UsersOperations + :param credential: Credential needed for the client to connect to Azure. + :type credential: ~azure.core.credentials_async.AsyncTokenCredential + :param subscription_id: The subscription ID. + :type subscription_id: str + :param str base_url: Service URL + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + """ + + def __init__( + self, + credential: "AsyncTokenCredential", + subscription_id: str, + base_url: Optional[str] = None, + **kwargs: Any + ) -> None: + if not base_url: + base_url = 'https://management.azure.com' + self._config = DataBoxEdgeManagementClientConfiguration(credential, subscription_id, **kwargs) + self._client = AsyncARMPipelineClient(base_url=base_url, config=self._config, **kwargs) + + client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} + self._serialize = Serializer(client_models) + self._deserialize = Deserializer(client_models) + + self.operations = Operations( + self._client, self._config, self._serialize, self._deserialize) + self.available_skus = AvailableSkusOperations( + self._client, self._config, self._serialize, self._deserialize) + self.devices = DevicesOperations( + self._client, self._config, self._serialize, self._deserialize) + self.alerts = AlertsOperations( + self._client, self._config, self._serialize, self._deserialize) + self.bandwidth_schedules = BandwidthSchedulesOperations( + self._client, self._config, self._serialize, self._deserialize) + self.diagnostic_settings = DiagnosticSettingsOperations( + self._client, self._config, self._serialize, self._deserialize) + self.jobs = JobsOperations( + self._client, self._config, self._serialize, self._deserialize) + self.nodes = NodesOperations( + self._client, self._config, self._serialize, self._deserialize) + self.operations_status = OperationsStatusOperations( + self._client, self._config, self._serialize, self._deserialize) + self.orders = OrdersOperations( + self._client, self._config, self._serialize, self._deserialize) + self.roles = RolesOperations( + self._client, self._config, self._serialize, self._deserialize) + self.addons = AddonsOperations( + self._client, self._config, self._serialize, self._deserialize) + self.monitoring_config = MonitoringConfigOperations( + self._client, self._config, self._serialize, self._deserialize) + self.shares = SharesOperations( + self._client, self._config, self._serialize, self._deserialize) + self.storage_account_credentials = StorageAccountCredentialsOperations( + self._client, self._config, self._serialize, self._deserialize) + self.storage_accounts = StorageAccountsOperations( + self._client, self._config, self._serialize, self._deserialize) + self.containers = ContainersOperations( + self._client, self._config, self._serialize, self._deserialize) + self.triggers = TriggersOperations( + self._client, self._config, self._serialize, self._deserialize) + self.support_packages = SupportPackagesOperations( + self._client, self._config, self._serialize, self._deserialize) + self.users = UsersOperations( + self._client, self._config, self._serialize, self._deserialize) + + async def close(self) -> None: + await self._client.close() + + async def __aenter__(self) -> "DataBoxEdgeManagementClient": + await self._client.__aenter__() + return self + + async def __aexit__(self, *exc_details) -> None: + await self._client.__aexit__(*exc_details) diff --git a/src/databoxedge/azext_databoxedge/vendored_sdks/databoxedge/aio/operations/__init__.py b/src/databoxedge/azext_databoxedge/vendored_sdks/databoxedge/aio/operations/__init__.py new file mode 100644 index 00000000000..fc7347b19d1 --- /dev/null +++ b/src/databoxedge/azext_databoxedge/vendored_sdks/databoxedge/aio/operations/__init__.py @@ -0,0 +1,51 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from ._operations import Operations +from ._available_skus_operations import AvailableSkusOperations +from ._devices_operations import DevicesOperations +from ._alerts_operations import AlertsOperations +from ._bandwidth_schedules_operations import BandwidthSchedulesOperations +from ._diagnostic_settings_operations import DiagnosticSettingsOperations +from ._jobs_operations import JobsOperations +from ._nodes_operations import NodesOperations +from ._operations_status_operations import OperationsStatusOperations +from ._orders_operations import OrdersOperations +from ._roles_operations import RolesOperations +from ._addons_operations import AddonsOperations +from ._monitoring_config_operations import MonitoringConfigOperations +from ._shares_operations import SharesOperations +from ._storage_account_credentials_operations import StorageAccountCredentialsOperations +from ._storage_accounts_operations import StorageAccountsOperations +from ._containers_operations import ContainersOperations +from ._triggers_operations import TriggersOperations +from ._support_packages_operations import SupportPackagesOperations +from ._users_operations import UsersOperations + +__all__ = [ + 'Operations', + 'AvailableSkusOperations', + 'DevicesOperations', + 'AlertsOperations', + 'BandwidthSchedulesOperations', + 'DiagnosticSettingsOperations', + 'JobsOperations', + 'NodesOperations', + 'OperationsStatusOperations', + 'OrdersOperations', + 'RolesOperations', + 'AddonsOperations', + 'MonitoringConfigOperations', + 'SharesOperations', + 'StorageAccountCredentialsOperations', + 'StorageAccountsOperations', + 'ContainersOperations', + 'TriggersOperations', + 'SupportPackagesOperations', + 'UsersOperations', +] diff --git a/src/databoxedge/azext_databoxedge/vendored_sdks/databoxedge/aio/operations/_addons_operations.py b/src/databoxedge/azext_databoxedge/vendored_sdks/databoxedge/aio/operations/_addons_operations.py new file mode 100644 index 00000000000..920c29dcb9c --- /dev/null +++ b/src/databoxedge/azext_databoxedge/vendored_sdks/databoxedge/aio/operations/_addons_operations.py @@ -0,0 +1,450 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling + +from ... import models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class AddonsOperations: + """AddonsOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~data_box_edge_management_client.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list_by_role( + self, + device_name: str, + role_name: str, + resource_group_name: str, + **kwargs + ) -> AsyncIterable["models.AddonList"]: + """Lists all the addons configured in the role. + + :param device_name: The device name. + :type device_name: str + :param role_name: The role name. + :type role_name: str + :param resource_group_name: The resource group name. + :type resource_group_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either AddonList or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~data_box_edge_management_client.models.AddonList] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.AddonList"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_by_role.metadata['url'] # type: ignore + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'roleName': self._serialize.url("role_name", role_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('AddonList', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_by_role.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/roles/{roleName}/addons'} # type: ignore + + async def get( + self, + device_name: str, + role_name: str, + addon_name: str, + resource_group_name: str, + **kwargs + ) -> "models.Addon": + """Gets a specific addon by name. + + :param device_name: The device name. + :type device_name: str + :param role_name: The role name. + :type role_name: str + :param addon_name: The addon name. + :type addon_name: str + :param resource_group_name: The resource group name. + :type resource_group_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: Addon, or the result of cls(response) + :rtype: ~data_box_edge_management_client.models.Addon + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.Addon"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'roleName': self._serialize.url("role_name", role_name, 'str'), + 'addonName': self._serialize.url("addon_name", addon_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('Addon', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/roles/{roleName}/addons/{addonName}'} # type: ignore + + async def _create_or_update_initial( + self, + device_name: str, + role_name: str, + addon_name: str, + resource_group_name: str, + addon: "models.Addon", + **kwargs + ) -> Optional["models.Addon"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.Addon"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._create_or_update_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'roleName': self._serialize.url("role_name", role_name, 'str'), + 'addonName': self._serialize.url("addon_name", addon_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(addon, 'Addon') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('Addon', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/roles/{roleName}/addons/{addonName}'} # type: ignore + + async def begin_create_or_update( + self, + device_name: str, + role_name: str, + addon_name: str, + resource_group_name: str, + addon: "models.Addon", + **kwargs + ) -> AsyncLROPoller["models.Addon"]: + """Create or update a addon. + + :param device_name: The device name. + :type device_name: str + :param role_name: The role name. + :type role_name: str + :param addon_name: The addon name. + :type addon_name: str + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param addon: The addon properties. + :type addon: ~data_box_edge_management_client.models.Addon + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either Addon or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~data_box_edge_management_client.models.Addon] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["models.Addon"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._create_or_update_initial( + device_name=device_name, + role_name=role_name, + addon_name=addon_name, + resource_group_name=resource_group_name, + addon=addon, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('Addon', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'roleName': self._serialize.url("role_name", role_name, 'str'), + 'addonName': self._serialize.url("addon_name", addon_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/roles/{roleName}/addons/{addonName}'} # type: ignore + + async def _delete_initial( + self, + device_name: str, + role_name: str, + addon_name: str, + resource_group_name: str, + **kwargs + ) -> None: + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self._delete_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'roleName': self._serialize.url("role_name", role_name, 'str'), + 'addonName': self._serialize.url("addon_name", addon_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/roles/{roleName}/addons/{addonName}'} # type: ignore + + async def begin_delete( + self, + device_name: str, + role_name: str, + addon_name: str, + resource_group_name: str, + **kwargs + ) -> AsyncLROPoller[None]: + """Deletes the addon on the device. + + :param device_name: The device name. + :type device_name: str + :param role_name: The role name. + :type role_name: str + :param addon_name: The addon name. + :type addon_name: str + :param resource_group_name: The resource group name. + :type resource_group_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._delete_initial( + device_name=device_name, + role_name=role_name, + addon_name=addon_name, + resource_group_name=resource_group_name, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'roleName': self._serialize.url("role_name", role_name, 'str'), + 'addonName': self._serialize.url("addon_name", addon_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/roles/{roleName}/addons/{addonName}'} # type: ignore diff --git a/src/databoxedge/azext_databoxedge/vendored_sdks/databoxedge/aio/operations/_alerts_operations.py b/src/databoxedge/azext_databoxedge/vendored_sdks/databoxedge/aio/operations/_alerts_operations.py new file mode 100644 index 00000000000..f7f3529fdf8 --- /dev/null +++ b/src/databoxedge/azext_databoxedge/vendored_sdks/databoxedge/aio/operations/_alerts_operations.py @@ -0,0 +1,180 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.mgmt.core.exceptions import ARMErrorFormat + +from ... import models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class AlertsOperations: + """AlertsOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~data_box_edge_management_client.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list_by_data_box_edge_device( + self, + device_name: str, + resource_group_name: str, + **kwargs + ) -> AsyncIterable["models.AlertList"]: + """Gets all the alerts for a Data Box Edge/Data Box Gateway device. + + :param device_name: The device name. + :type device_name: str + :param resource_group_name: The resource group name. + :type resource_group_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either AlertList or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~data_box_edge_management_client.models.AlertList] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.AlertList"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_by_data_box_edge_device.metadata['url'] # type: ignore + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('AlertList', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_by_data_box_edge_device.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/alerts'} # type: ignore + + async def get( + self, + device_name: str, + name: str, + resource_group_name: str, + **kwargs + ) -> "models.Alert": + """Gets an alert by name. + + Gets an alert by name. + + :param device_name: The device name. + :type device_name: str + :param name: The alert name. + :type name: str + :param resource_group_name: The resource group name. + :type resource_group_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: Alert, or the result of cls(response) + :rtype: ~data_box_edge_management_client.models.Alert + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.Alert"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('Alert', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/alerts/{name}'} # type: ignore diff --git a/src/databoxedge/azext_databoxedge/vendored_sdks/databoxedge/aio/operations/_available_skus_operations.py b/src/databoxedge/azext_databoxedge/vendored_sdks/databoxedge/aio/operations/_available_skus_operations.py new file mode 100644 index 00000000000..dbaede99a5e --- /dev/null +++ b/src/databoxedge/azext_databoxedge/vendored_sdks/databoxedge/aio/operations/_available_skus_operations.py @@ -0,0 +1,110 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.mgmt.core.exceptions import ARMErrorFormat + +from ... import models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class AvailableSkusOperations: + """AvailableSkusOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~data_box_edge_management_client.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list( + self, + **kwargs + ) -> AsyncIterable["models.DataBoxEdgeSkuList"]: + """List all the available Skus and information related to them. + + List all the available Skus and information related to them. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either DataBoxEdgeSkuList or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~data_box_edge_management_client.models.DataBoxEdgeSkuList] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.DataBoxEdgeSkuList"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('DataBoxEdgeSkuList', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.DataBoxEdge/availableSkus'} # type: ignore diff --git a/src/databoxedge/azext_databoxedge/vendored_sdks/databoxedge/aio/operations/_bandwidth_schedules_operations.py b/src/databoxedge/azext_databoxedge/vendored_sdks/databoxedge/aio/operations/_bandwidth_schedules_operations.py new file mode 100644 index 00000000000..1e45b8b9c15 --- /dev/null +++ b/src/databoxedge/azext_databoxedge/vendored_sdks/databoxedge/aio/operations/_bandwidth_schedules_operations.py @@ -0,0 +1,428 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling + +from ... import models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class BandwidthSchedulesOperations: + """BandwidthSchedulesOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~data_box_edge_management_client.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list_by_data_box_edge_device( + self, + device_name: str, + resource_group_name: str, + **kwargs + ) -> AsyncIterable["models.BandwidthSchedulesList"]: + """Gets all the bandwidth schedules for a Data Box Edge/Data Box Gateway device. + + :param device_name: The device name. + :type device_name: str + :param resource_group_name: The resource group name. + :type resource_group_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either BandwidthSchedulesList or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~data_box_edge_management_client.models.BandwidthSchedulesList] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.BandwidthSchedulesList"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_by_data_box_edge_device.metadata['url'] # type: ignore + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('BandwidthSchedulesList', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_by_data_box_edge_device.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/bandwidthSchedules'} # type: ignore + + async def get( + self, + device_name: str, + name: str, + resource_group_name: str, + **kwargs + ) -> "models.BandwidthSchedule": + """Gets the properties of the specified bandwidth schedule. + + :param device_name: The device name. + :type device_name: str + :param name: The bandwidth schedule name. + :type name: str + :param resource_group_name: The resource group name. + :type resource_group_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: BandwidthSchedule, or the result of cls(response) + :rtype: ~data_box_edge_management_client.models.BandwidthSchedule + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.BandwidthSchedule"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('BandwidthSchedule', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/bandwidthSchedules/{name}'} # type: ignore + + async def _create_or_update_initial( + self, + device_name: str, + name: str, + resource_group_name: str, + parameters: "models.BandwidthSchedule", + **kwargs + ) -> Optional["models.BandwidthSchedule"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.BandwidthSchedule"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._create_or_update_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, 'BandwidthSchedule') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('BandwidthSchedule', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/bandwidthSchedules/{name}'} # type: ignore + + async def begin_create_or_update( + self, + device_name: str, + name: str, + resource_group_name: str, + parameters: "models.BandwidthSchedule", + **kwargs + ) -> AsyncLROPoller["models.BandwidthSchedule"]: + """Creates or updates a bandwidth schedule. + + :param device_name: The device name. + :type device_name: str + :param name: The bandwidth schedule name which needs to be added/updated. + :type name: str + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param parameters: The bandwidth schedule to be added or updated. + :type parameters: ~data_box_edge_management_client.models.BandwidthSchedule + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either BandwidthSchedule or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~data_box_edge_management_client.models.BandwidthSchedule] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["models.BandwidthSchedule"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._create_or_update_initial( + device_name=device_name, + name=name, + resource_group_name=resource_group_name, + parameters=parameters, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('BandwidthSchedule', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/bandwidthSchedules/{name}'} # type: ignore + + async def _delete_initial( + self, + device_name: str, + name: str, + resource_group_name: str, + **kwargs + ) -> None: + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self._delete_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/bandwidthSchedules/{name}'} # type: ignore + + async def begin_delete( + self, + device_name: str, + name: str, + resource_group_name: str, + **kwargs + ) -> AsyncLROPoller[None]: + """Deletes the specified bandwidth schedule. + + :param device_name: The device name. + :type device_name: str + :param name: The bandwidth schedule name. + :type name: str + :param resource_group_name: The resource group name. + :type resource_group_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._delete_initial( + device_name=device_name, + name=name, + resource_group_name=resource_group_name, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/bandwidthSchedules/{name}'} # type: ignore diff --git a/src/databoxedge/azext_databoxedge/vendored_sdks/databoxedge/aio/operations/_containers_operations.py b/src/databoxedge/azext_databoxedge/vendored_sdks/databoxedge/aio/operations/_containers_operations.py new file mode 100644 index 00000000000..bca6aefef69 --- /dev/null +++ b/src/databoxedge/azext_databoxedge/vendored_sdks/databoxedge/aio/operations/_containers_operations.py @@ -0,0 +1,580 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling + +from ... import models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class ContainersOperations: + """ContainersOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~data_box_edge_management_client.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list_by_storage_account( + self, + device_name: str, + storage_account_name: str, + resource_group_name: str, + **kwargs + ) -> AsyncIterable["models.ContainerList"]: + """Lists all the containers of a storage Account in a Data Box Edge/Data Box Gateway device. + + Lists all the containers of a storage Account in a Data Box Edge/Data Box Gateway device. + + :param device_name: The device name. + :type device_name: str + :param storage_account_name: The storage Account name. + :type storage_account_name: str + :param resource_group_name: The resource group name. + :type resource_group_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either ContainerList or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~data_box_edge_management_client.models.ContainerList] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.ContainerList"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_by_storage_account.metadata['url'] # type: ignore + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'storageAccountName': self._serialize.url("storage_account_name", storage_account_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('ContainerList', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_by_storage_account.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/storageAccounts/{storageAccountName}/containers'} # type: ignore + + async def get( + self, + device_name: str, + storage_account_name: str, + container_name: str, + resource_group_name: str, + **kwargs + ) -> "models.Container": + """Gets a container by name. + + Gets a container by name. + + :param device_name: The device name. + :type device_name: str + :param storage_account_name: The Storage Account Name. + :type storage_account_name: str + :param container_name: The container Name. + :type container_name: str + :param resource_group_name: The resource group name. + :type resource_group_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: Container, or the result of cls(response) + :rtype: ~data_box_edge_management_client.models.Container + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.Container"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'storageAccountName': self._serialize.url("storage_account_name", storage_account_name, 'str'), + 'containerName': self._serialize.url("container_name", container_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('Container', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/storageAccounts/{storageAccountName}/containers/{containerName}'} # type: ignore + + async def _create_or_update_initial( + self, + device_name: str, + storage_account_name: str, + container_name: str, + resource_group_name: str, + container: "models.Container", + **kwargs + ) -> Optional["models.Container"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.Container"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._create_or_update_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'storageAccountName': self._serialize.url("storage_account_name", storage_account_name, 'str'), + 'containerName': self._serialize.url("container_name", container_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(container, 'Container') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('Container', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/storageAccounts/{storageAccountName}/containers/{containerName}'} # type: ignore + + async def begin_create_or_update( + self, + device_name: str, + storage_account_name: str, + container_name: str, + resource_group_name: str, + container: "models.Container", + **kwargs + ) -> AsyncLROPoller["models.Container"]: + """Creates a new container or updates an existing container on the device. + + Creates a new container or updates an existing container on the device. + + :param device_name: The device name. + :type device_name: str + :param storage_account_name: The Storage Account Name. + :type storage_account_name: str + :param container_name: The container name. + :type container_name: str + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param container: The container properties. + :type container: ~data_box_edge_management_client.models.Container + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either Container or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~data_box_edge_management_client.models.Container] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["models.Container"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._create_or_update_initial( + device_name=device_name, + storage_account_name=storage_account_name, + container_name=container_name, + resource_group_name=resource_group_name, + container=container, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('Container', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'storageAccountName': self._serialize.url("storage_account_name", storage_account_name, 'str'), + 'containerName': self._serialize.url("container_name", container_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/storageAccounts/{storageAccountName}/containers/{containerName}'} # type: ignore + + async def _delete_initial( + self, + device_name: str, + storage_account_name: str, + container_name: str, + resource_group_name: str, + **kwargs + ) -> None: + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self._delete_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'storageAccountName': self._serialize.url("storage_account_name", storage_account_name, 'str'), + 'containerName': self._serialize.url("container_name", container_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/storageAccounts/{storageAccountName}/containers/{containerName}'} # type: ignore + + async def begin_delete( + self, + device_name: str, + storage_account_name: str, + container_name: str, + resource_group_name: str, + **kwargs + ) -> AsyncLROPoller[None]: + """Deletes the container on the Data Box Edge/Data Box Gateway device. + + :param device_name: The device name. + :type device_name: str + :param storage_account_name: The Storage Account Name. + :type storage_account_name: str + :param container_name: The container name. + :type container_name: str + :param resource_group_name: The resource group name. + :type resource_group_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._delete_initial( + device_name=device_name, + storage_account_name=storage_account_name, + container_name=container_name, + resource_group_name=resource_group_name, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'storageAccountName': self._serialize.url("storage_account_name", storage_account_name, 'str'), + 'containerName': self._serialize.url("container_name", container_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/storageAccounts/{storageAccountName}/containers/{containerName}'} # type: ignore + + async def _refresh_initial( + self, + device_name: str, + storage_account_name: str, + container_name: str, + resource_group_name: str, + **kwargs + ) -> None: + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self._refresh_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'storageAccountName': self._serialize.url("storage_account_name", storage_account_name, 'str'), + 'containerName': self._serialize.url("container_name", container_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _refresh_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/storageAccounts/{storageAccountName}/containers/{containerName}/refresh'} # type: ignore + + async def begin_refresh( + self, + device_name: str, + storage_account_name: str, + container_name: str, + resource_group_name: str, + **kwargs + ) -> AsyncLROPoller[None]: + """Refreshes the container metadata with the data from the cloud. + + Refreshes the container metadata with the data from the cloud. + + :param device_name: The device name. + :type device_name: str + :param storage_account_name: The Storage Account Name. + :type storage_account_name: str + :param container_name: The container name. + :type container_name: str + :param resource_group_name: The resource group name. + :type resource_group_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._refresh_initial( + device_name=device_name, + storage_account_name=storage_account_name, + container_name=container_name, + resource_group_name=resource_group_name, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'storageAccountName': self._serialize.url("storage_account_name", storage_account_name, 'str'), + 'containerName': self._serialize.url("container_name", container_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_refresh.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/storageAccounts/{storageAccountName}/containers/{containerName}/refresh'} # type: ignore diff --git a/src/databoxedge/azext_databoxedge/vendored_sdks/databoxedge/aio/operations/_devices_operations.py b/src/databoxedge/azext_databoxedge/vendored_sdks/databoxedge/aio/operations/_devices_operations.py new file mode 100644 index 00000000000..60100d4dd16 --- /dev/null +++ b/src/databoxedge/azext_databoxedge/vendored_sdks/databoxedge/aio/operations/_devices_operations.py @@ -0,0 +1,1305 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling + +from ... import models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class DevicesOperations: + """DevicesOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~data_box_edge_management_client.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list_by_subscription( + self, + expand: Optional[str] = None, + **kwargs + ) -> AsyncIterable["models.DataBoxEdgeDeviceList"]: + """Gets all the Data Box Edge/Data Box Gateway devices in a subscription. + + :param expand: Specify $expand=details to populate additional fields related to the resource or + Specify $skipToken=:code:`` to populate the next page in the list. + :type expand: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either DataBoxEdgeDeviceList or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~data_box_edge_management_client.models.DataBoxEdgeDeviceList] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.DataBoxEdgeDeviceList"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_by_subscription.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + if expand is not None: + query_parameters['$expand'] = self._serialize.query("expand", expand, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('DataBoxEdgeDeviceList', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_by_subscription.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices'} # type: ignore + + def list_by_resource_group( + self, + resource_group_name: str, + expand: Optional[str] = None, + **kwargs + ) -> AsyncIterable["models.DataBoxEdgeDeviceList"]: + """Gets all the Data Box Edge/Data Box Gateway devices in a resource group. + + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param expand: Specify $expand=details to populate additional fields related to the resource or + Specify $skipToken=:code:`` to populate the next page in the list. + :type expand: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either DataBoxEdgeDeviceList or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~data_box_edge_management_client.models.DataBoxEdgeDeviceList] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.DataBoxEdgeDeviceList"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_by_resource_group.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + if expand is not None: + query_parameters['$expand'] = self._serialize.query("expand", expand, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('DataBoxEdgeDeviceList', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices'} # type: ignore + + async def get( + self, + device_name: str, + resource_group_name: str, + **kwargs + ) -> "models.DataBoxEdgeDevice": + """Gets the properties of the Data Box Edge/Data Box Gateway device. + + :param device_name: The device name. + :type device_name: str + :param resource_group_name: The resource group name. + :type resource_group_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: DataBoxEdgeDevice, or the result of cls(response) + :rtype: ~data_box_edge_management_client.models.DataBoxEdgeDevice + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.DataBoxEdgeDevice"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('DataBoxEdgeDevice', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}'} # type: ignore + + async def create_or_update( + self, + device_name: str, + resource_group_name: str, + data_box_edge_device: "models.DataBoxEdgeDevice", + **kwargs + ) -> "models.DataBoxEdgeDevice": + """Creates or updates a Data Box Edge/Data Box Gateway resource. + + :param device_name: The device name. + :type device_name: str + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param data_box_edge_device: The resource object. + :type data_box_edge_device: ~data_box_edge_management_client.models.DataBoxEdgeDevice + :keyword callable cls: A custom type or function that will be passed the direct response + :return: DataBoxEdgeDevice, or the result of cls(response) + :rtype: ~data_box_edge_management_client.models.DataBoxEdgeDevice + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.DataBoxEdgeDevice"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.create_or_update.metadata['url'] # type: ignore + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(data_box_edge_device, 'DataBoxEdgeDevice') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('DataBoxEdgeDevice', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}'} # type: ignore + + async def _delete_initial( + self, + device_name: str, + resource_group_name: str, + **kwargs + ) -> None: + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self._delete_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}'} # type: ignore + + async def begin_delete( + self, + device_name: str, + resource_group_name: str, + **kwargs + ) -> AsyncLROPoller[None]: + """Deletes the Data Box Edge/Data Box Gateway device. + + :param device_name: The device name. + :type device_name: str + :param resource_group_name: The resource group name. + :type resource_group_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._delete_initial( + device_name=device_name, + resource_group_name=resource_group_name, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}'} # type: ignore + + async def update( + self, + device_name: str, + resource_group_name: str, + parameters: "models.DataBoxEdgeDevicePatch", + **kwargs + ) -> "models.DataBoxEdgeDevice": + """Modifies a Data Box Edge/Data Box Gateway resource. + + :param device_name: The device name. + :type device_name: str + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param parameters: The resource parameters. + :type parameters: ~data_box_edge_management_client.models.DataBoxEdgeDevicePatch + :keyword callable cls: A custom type or function that will be passed the direct response + :return: DataBoxEdgeDevice, or the result of cls(response) + :rtype: ~data_box_edge_management_client.models.DataBoxEdgeDevice + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.DataBoxEdgeDevice"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update.metadata['url'] # type: ignore + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, 'DataBoxEdgeDevicePatch') + body_content_kwargs['content'] = body_content + request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('DataBoxEdgeDevice', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}'} # type: ignore + + async def _download_updates_initial( + self, + device_name: str, + resource_group_name: str, + **kwargs + ) -> None: + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self._download_updates_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _download_updates_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/downloadUpdates'} # type: ignore + + async def begin_download_updates( + self, + device_name: str, + resource_group_name: str, + **kwargs + ) -> AsyncLROPoller[None]: + """Downloads the updates on a Data Box Edge/Data Box Gateway device. + + Downloads the updates on a Data Box Edge/Data Box Gateway device. + + :param device_name: The device name. + :type device_name: str + :param resource_group_name: The resource group name. + :type resource_group_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._download_updates_initial( + device_name=device_name, + resource_group_name=resource_group_name, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_download_updates.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/downloadUpdates'} # type: ignore + + async def generate_certificate( + self, + device_name: str, + resource_group_name: str, + **kwargs + ) -> "models.GenerateCertResponse": + """Generates certificate for activation key. + + :param device_name: The device name. + :type device_name: str + :param resource_group_name: The resource group name. + :type resource_group_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: GenerateCertResponse, or the result of cls(response) + :rtype: ~data_box_edge_management_client.models.GenerateCertResponse + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.GenerateCertResponse"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.generate_certificate.metadata['url'] # type: ignore + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('GenerateCertResponse', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + generate_certificate.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/generateCertificate'} # type: ignore + + async def get_extended_information( + self, + device_name: str, + resource_group_name: str, + **kwargs + ) -> "models.DataBoxEdgeDeviceExtendedInfo": + """Gets additional information for the specified Azure Stack Edge/Data Box Gateway device. + + :param device_name: The device name. + :type device_name: str + :param resource_group_name: The resource group name. + :type resource_group_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: DataBoxEdgeDeviceExtendedInfo, or the result of cls(response) + :rtype: ~data_box_edge_management_client.models.DataBoxEdgeDeviceExtendedInfo + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.DataBoxEdgeDeviceExtendedInfo"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.get_extended_information.metadata['url'] # type: ignore + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('DataBoxEdgeDeviceExtendedInfo', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_extended_information.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/getExtendedInformation'} # type: ignore + + async def _install_updates_initial( + self, + device_name: str, + resource_group_name: str, + **kwargs + ) -> None: + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self._install_updates_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _install_updates_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/installUpdates'} # type: ignore + + async def begin_install_updates( + self, + device_name: str, + resource_group_name: str, + **kwargs + ) -> AsyncLROPoller[None]: + """Installs the updates on the Data Box Edge/Data Box Gateway device. + + Installs the updates on the Data Box Edge/Data Box Gateway device. + + :param device_name: The device name. + :type device_name: str + :param resource_group_name: The resource group name. + :type resource_group_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._install_updates_initial( + device_name=device_name, + resource_group_name=resource_group_name, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_install_updates.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/installUpdates'} # type: ignore + + async def get_network_settings( + self, + device_name: str, + resource_group_name: str, + **kwargs + ) -> "models.NetworkSettings": + """Gets the network settings of the specified Data Box Edge/Data Box Gateway device. + + :param device_name: The device name. + :type device_name: str + :param resource_group_name: The resource group name. + :type resource_group_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: NetworkSettings, or the result of cls(response) + :rtype: ~data_box_edge_management_client.models.NetworkSettings + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkSettings"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.get_network_settings.metadata['url'] # type: ignore + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('NetworkSettings', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_network_settings.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/networkSettings/default'} # type: ignore + + async def _scan_for_updates_initial( + self, + device_name: str, + resource_group_name: str, + **kwargs + ) -> None: + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self._scan_for_updates_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _scan_for_updates_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/scanForUpdates'} # type: ignore + + async def begin_scan_for_updates( + self, + device_name: str, + resource_group_name: str, + **kwargs + ) -> AsyncLROPoller[None]: + """Scans for updates on a Data Box Edge/Data Box Gateway device. + + Scans for updates on a Data Box Edge/Data Box Gateway device. + + :param device_name: The device name. + :type device_name: str + :param resource_group_name: The resource group name. + :type resource_group_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._scan_for_updates_initial( + device_name=device_name, + resource_group_name=resource_group_name, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_scan_for_updates.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/scanForUpdates'} # type: ignore + + async def _create_or_update_security_settings_initial( + self, + device_name: str, + resource_group_name: str, + security_settings: "models.SecuritySettings", + **kwargs + ) -> None: + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._create_or_update_security_settings_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(security_settings, 'SecuritySettings') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _create_or_update_security_settings_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/securitySettings/default/update'} # type: ignore + + async def begin_create_or_update_security_settings( + self, + device_name: str, + resource_group_name: str, + security_settings: "models.SecuritySettings", + **kwargs + ) -> AsyncLROPoller[None]: + """Updates the security settings on a Data Box Edge/Data Box Gateway device. + + :param device_name: The device name. + :type device_name: str + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param security_settings: The security settings. + :type security_settings: ~data_box_edge_management_client.models.SecuritySettings + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._create_or_update_security_settings_initial( + device_name=device_name, + resource_group_name=resource_group_name, + security_settings=security_settings, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create_or_update_security_settings.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/securitySettings/default/update'} # type: ignore + + async def update_extended_information( + self, + device_name: str, + resource_group_name: str, + parameters: "models.DataBoxEdgeDeviceExtendedInfoPatch", + **kwargs + ) -> "models.DataBoxEdgeDeviceExtendedInfo": + """Gets additional information for the specified Data Box Edge/Data Box Gateway device. + + :param device_name: The device name. + :type device_name: str + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param parameters: The patch object. + :type parameters: ~data_box_edge_management_client.models.DataBoxEdgeDeviceExtendedInfoPatch + :keyword callable cls: A custom type or function that will be passed the direct response + :return: DataBoxEdgeDeviceExtendedInfo, or the result of cls(response) + :rtype: ~data_box_edge_management_client.models.DataBoxEdgeDeviceExtendedInfo + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.DataBoxEdgeDeviceExtendedInfo"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update_extended_information.metadata['url'] # type: ignore + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, 'DataBoxEdgeDeviceExtendedInfoPatch') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('DataBoxEdgeDeviceExtendedInfo', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update_extended_information.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/updateExtendedInformation'} # type: ignore + + async def get_update_summary( + self, + device_name: str, + resource_group_name: str, + **kwargs + ) -> "models.UpdateSummary": + """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. + + 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. + + :param device_name: The device name. + :type device_name: str + :param resource_group_name: The resource group name. + :type resource_group_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: UpdateSummary, or the result of cls(response) + :rtype: ~data_box_edge_management_client.models.UpdateSummary + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.UpdateSummary"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.get_update_summary.metadata['url'] # type: ignore + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('UpdateSummary', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_update_summary.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/updateSummary/default'} # type: ignore + + async def upload_certificate( + self, + device_name: str, + resource_group_name: str, + parameters: "models.UploadCertificateRequest", + **kwargs + ) -> "models.UploadCertificateResponse": + """Uploads registration certificate for the device. + + :param device_name: The device name. + :type device_name: str + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param parameters: The upload certificate request. + :type parameters: ~data_box_edge_management_client.models.UploadCertificateRequest + :keyword callable cls: A custom type or function that will be passed the direct response + :return: UploadCertificateResponse, or the result of cls(response) + :rtype: ~data_box_edge_management_client.models.UploadCertificateResponse + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.UploadCertificateResponse"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.upload_certificate.metadata['url'] # type: ignore + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, 'UploadCertificateRequest') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('UploadCertificateResponse', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + upload_certificate.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/uploadCertificate'} # type: ignore diff --git a/src/databoxedge/azext_databoxedge/vendored_sdks/databoxedge/aio/operations/_diagnostic_settings_operations.py b/src/databoxedge/azext_databoxedge/vendored_sdks/databoxedge/aio/operations/_diagnostic_settings_operations.py new file mode 100644 index 00000000000..e1e65a5f850 --- /dev/null +++ b/src/databoxedge/azext_databoxedge/vendored_sdks/databoxedge/aio/operations/_diagnostic_settings_operations.py @@ -0,0 +1,397 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, Callable, Dict, Generic, Optional, TypeVar, Union +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling + +from ... import models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class DiagnosticSettingsOperations: + """DiagnosticSettingsOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~data_box_edge_management_client.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + async def get_diagnostic_proactive_log_collection_settings( + self, + device_name: str, + resource_group_name: str, + **kwargs + ) -> "models.DiagnosticProactiveLogCollectionSettings": + """Gets the proactive log collection settings of the specified Data Box Edge/Data Box Gateway + device. + + :param device_name: The device name. + :type device_name: str + :param resource_group_name: The resource group name. + :type resource_group_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: DiagnosticProactiveLogCollectionSettings, or the result of cls(response) + :rtype: ~data_box_edge_management_client.models.DiagnosticProactiveLogCollectionSettings + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.DiagnosticProactiveLogCollectionSettings"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.get_diagnostic_proactive_log_collection_settings.metadata['url'] # type: ignore + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('DiagnosticProactiveLogCollectionSettings', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_diagnostic_proactive_log_collection_settings.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/diagnosticProactiveLogCollectionSettings/default'} # type: ignore + + async def _update_diagnostic_proactive_log_collection_settings_initial( + self, + device_name: str, + resource_group_name: str, + proactive_log_collection_settings: "models.DiagnosticProactiveLogCollectionSettings", + **kwargs + ) -> None: + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._update_diagnostic_proactive_log_collection_settings_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(proactive_log_collection_settings, 'DiagnosticProactiveLogCollectionSettings') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _update_diagnostic_proactive_log_collection_settings_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/diagnosticProactiveLogCollectionSettings/default'} # type: ignore + + async def begin_update_diagnostic_proactive_log_collection_settings( + self, + device_name: str, + resource_group_name: str, + proactive_log_collection_settings: "models.DiagnosticProactiveLogCollectionSettings", + **kwargs + ) -> AsyncLROPoller[None]: + """Updates the proactive log collection settings on a Data Box Edge/Data Box Gateway device. + + :param device_name: The device name. + :type device_name: str + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param proactive_log_collection_settings: The proactive log collection settings. + :type proactive_log_collection_settings: ~data_box_edge_management_client.models.DiagnosticProactiveLogCollectionSettings + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._update_diagnostic_proactive_log_collection_settings_initial( + device_name=device_name, + resource_group_name=resource_group_name, + proactive_log_collection_settings=proactive_log_collection_settings, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_update_diagnostic_proactive_log_collection_settings.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/diagnosticProactiveLogCollectionSettings/default'} # type: ignore + + async def get_diagnostic_remote_support_settings( + self, + device_name: str, + resource_group_name: str, + **kwargs + ) -> "models.DiagnosticRemoteSupportSettings": + """Gets the diagnostic remote support settings of the specified Data Box Edge/Data Box Gateway + device. + + :param device_name: The device name. + :type device_name: str + :param resource_group_name: The resource group name. + :type resource_group_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: DiagnosticRemoteSupportSettings, or the result of cls(response) + :rtype: ~data_box_edge_management_client.models.DiagnosticRemoteSupportSettings + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.DiagnosticRemoteSupportSettings"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.get_diagnostic_remote_support_settings.metadata['url'] # type: ignore + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('DiagnosticRemoteSupportSettings', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_diagnostic_remote_support_settings.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/diagnosticRemoteSupportSettings/default'} # type: ignore + + async def _update_diagnostic_remote_support_settings_initial( + self, + device_name: str, + resource_group_name: str, + diagnostic_remote_support_settings: "models.DiagnosticRemoteSupportSettings", + **kwargs + ) -> None: + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._update_diagnostic_remote_support_settings_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(diagnostic_remote_support_settings, 'DiagnosticRemoteSupportSettings') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _update_diagnostic_remote_support_settings_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/diagnosticRemoteSupportSettings/default'} # type: ignore + + async def begin_update_diagnostic_remote_support_settings( + self, + device_name: str, + resource_group_name: str, + diagnostic_remote_support_settings: "models.DiagnosticRemoteSupportSettings", + **kwargs + ) -> AsyncLROPoller[None]: + """Updates the diagnostic remote support settings on a Data Box Edge/Data Box Gateway device. + + :param device_name: The device name. + :type device_name: str + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param diagnostic_remote_support_settings: The diagnostic remote support settings. + :type diagnostic_remote_support_settings: ~data_box_edge_management_client.models.DiagnosticRemoteSupportSettings + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._update_diagnostic_remote_support_settings_initial( + device_name=device_name, + resource_group_name=resource_group_name, + diagnostic_remote_support_settings=diagnostic_remote_support_settings, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_update_diagnostic_remote_support_settings.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/diagnosticRemoteSupportSettings/default'} # type: ignore diff --git a/src/databoxedge/azext_databoxedge/vendored_sdks/databoxedge/aio/operations/_jobs_operations.py b/src/databoxedge/azext_databoxedge/vendored_sdks/databoxedge/aio/operations/_jobs_operations.py new file mode 100644 index 00000000000..1ad748a6f6e --- /dev/null +++ b/src/databoxedge/azext_databoxedge/vendored_sdks/databoxedge/aio/operations/_jobs_operations.py @@ -0,0 +1,105 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, Callable, Dict, Generic, Optional, TypeVar +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.mgmt.core.exceptions import ARMErrorFormat + +from ... import models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class JobsOperations: + """JobsOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~data_box_edge_management_client.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + async def get( + self, + device_name: str, + name: str, + resource_group_name: str, + **kwargs + ) -> "models.Job": + """Gets the details of a specified job on a Data Box Edge/Data Box Gateway device. + + Gets the details of a specified job on a Data Box Edge/Data Box Gateway device. + + :param device_name: The device name. + :type device_name: str + :param name: The job name. + :type name: str + :param resource_group_name: The resource group name. + :type resource_group_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: Job, or the result of cls(response) + :rtype: ~data_box_edge_management_client.models.Job + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.Job"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('Job', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/jobs/{name}'} # type: ignore diff --git a/src/databoxedge/azext_databoxedge/vendored_sdks/databoxedge/aio/operations/_monitoring_config_operations.py b/src/databoxedge/azext_databoxedge/vendored_sdks/databoxedge/aio/operations/_monitoring_config_operations.py new file mode 100644 index 00000000000..3c1f29eb749 --- /dev/null +++ b/src/databoxedge/azext_databoxedge/vendored_sdks/databoxedge/aio/operations/_monitoring_config_operations.py @@ -0,0 +1,440 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling + +from ... import models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class MonitoringConfigOperations: + """MonitoringConfigOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~data_box_edge_management_client.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list( + self, + device_name: str, + role_name: str, + resource_group_name: str, + **kwargs + ) -> AsyncIterable["models.MonitoringMetricConfigurationList"]: + """Lists metric configurations in a role. + + Lists metric configurations in a role. + + :param device_name: The device name. + :type device_name: str + :param role_name: The role name. + :type role_name: str + :param resource_group_name: The resource group name. + :type resource_group_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either MonitoringMetricConfigurationList or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~data_box_edge_management_client.models.MonitoringMetricConfigurationList] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.MonitoringMetricConfigurationList"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list.metadata['url'] # type: ignore + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'roleName': self._serialize.url("role_name", role_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('MonitoringMetricConfigurationList', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/roles/{roleName}/monitoringConfig'} # type: ignore + + async def get( + self, + device_name: str, + role_name: str, + resource_group_name: str, + **kwargs + ) -> "models.MonitoringMetricConfiguration": + """Gets a metric configuration of a role. + + Gets a metric configuration of a role. + + :param device_name: The device name. + :type device_name: str + :param role_name: The role name. + :type role_name: str + :param resource_group_name: The resource group name. + :type resource_group_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: MonitoringMetricConfiguration, or the result of cls(response) + :rtype: ~data_box_edge_management_client.models.MonitoringMetricConfiguration + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.MonitoringMetricConfiguration"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'roleName': self._serialize.url("role_name", role_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('MonitoringMetricConfiguration', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/roles/{roleName}/monitoringConfig/default'} # type: ignore + + async def _create_or_update_initial( + self, + device_name: str, + role_name: str, + resource_group_name: str, + monitoring_metric_configuration: "models.MonitoringMetricConfiguration", + **kwargs + ) -> Optional["models.MonitoringMetricConfiguration"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.MonitoringMetricConfiguration"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._create_or_update_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'roleName': self._serialize.url("role_name", role_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(monitoring_metric_configuration, 'MonitoringMetricConfiguration') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('MonitoringMetricConfiguration', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/roles/{roleName}/monitoringConfig/default'} # type: ignore + + async def begin_create_or_update( + self, + device_name: str, + role_name: str, + resource_group_name: str, + monitoring_metric_configuration: "models.MonitoringMetricConfiguration", + **kwargs + ) -> AsyncLROPoller["models.MonitoringMetricConfiguration"]: + """Creates a new metric configuration or updates an existing one for a role. + + Creates a new metric configuration or updates an existing one for a role. + + :param device_name: The device name. + :type device_name: str + :param role_name: The role name. + :type role_name: str + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param monitoring_metric_configuration: The metric configuration. + :type monitoring_metric_configuration: ~data_box_edge_management_client.models.MonitoringMetricConfiguration + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either MonitoringMetricConfiguration or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~data_box_edge_management_client.models.MonitoringMetricConfiguration] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["models.MonitoringMetricConfiguration"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._create_or_update_initial( + device_name=device_name, + role_name=role_name, + resource_group_name=resource_group_name, + monitoring_metric_configuration=monitoring_metric_configuration, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('MonitoringMetricConfiguration', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'roleName': self._serialize.url("role_name", role_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/roles/{roleName}/monitoringConfig/default'} # type: ignore + + async def _delete_initial( + self, + device_name: str, + role_name: str, + resource_group_name: str, + **kwargs + ) -> None: + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self._delete_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'roleName': self._serialize.url("role_name", role_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/roles/{roleName}/monitoringConfig/default'} # type: ignore + + async def begin_delete( + self, + device_name: str, + role_name: str, + resource_group_name: str, + **kwargs + ) -> AsyncLROPoller[None]: + """deletes a new metric configuration for a role. + + deletes a new metric configuration for a role. + + :param device_name: The device name. + :type device_name: str + :param role_name: The role name. + :type role_name: str + :param resource_group_name: The resource group name. + :type resource_group_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._delete_initial( + device_name=device_name, + role_name=role_name, + resource_group_name=resource_group_name, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'roleName': self._serialize.url("role_name", role_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/roles/{roleName}/monitoringConfig/default'} # type: ignore diff --git a/src/databoxedge/azext_databoxedge/vendored_sdks/databoxedge/aio/operations/_nodes_operations.py b/src/databoxedge/azext_databoxedge/vendored_sdks/databoxedge/aio/operations/_nodes_operations.py new file mode 100644 index 00000000000..41eedd0fb34 --- /dev/null +++ b/src/databoxedge/azext_databoxedge/vendored_sdks/databoxedge/aio/operations/_nodes_operations.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. +# -------------------------------------------------------------------------- +from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.mgmt.core.exceptions import ARMErrorFormat + +from ... import models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class NodesOperations: + """NodesOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~data_box_edge_management_client.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list_by_data_box_edge_device( + self, + device_name: str, + resource_group_name: str, + **kwargs + ) -> AsyncIterable["models.NodeList"]: + """Gets all the nodes currently configured under this Data Box Edge device. + + :param device_name: The device name. + :type device_name: str + :param resource_group_name: The resource group name. + :type resource_group_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either NodeList or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~data_box_edge_management_client.models.NodeList] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.NodeList"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_by_data_box_edge_device.metadata['url'] # type: ignore + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('NodeList', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_by_data_box_edge_device.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/nodes'} # type: ignore diff --git a/src/databoxedge/azext_databoxedge/vendored_sdks/databoxedge/aio/operations/_operations.py b/src/databoxedge/azext_databoxedge/vendored_sdks/databoxedge/aio/operations/_operations.py new file mode 100644 index 00000000000..28d709568d2 --- /dev/null +++ b/src/databoxedge/azext_databoxedge/vendored_sdks/databoxedge/aio/operations/_operations.py @@ -0,0 +1,106 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.mgmt.core.exceptions import ARMErrorFormat + +from ... import models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class Operations: + """Operations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~data_box_edge_management_client.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list( + self, + **kwargs + ) -> AsyncIterable["models.OperationsList"]: + """List all the supported operations. + + List all the supported operations. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either OperationsList or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~data_box_edge_management_client.models.OperationsList] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.OperationsList"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list.metadata['url'] # type: ignore + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('OperationsList', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/providers/Microsoft.DataBoxEdge/operations'} # type: ignore diff --git a/src/databoxedge/azext_databoxedge/vendored_sdks/databoxedge/aio/operations/_operations_status_operations.py b/src/databoxedge/azext_databoxedge/vendored_sdks/databoxedge/aio/operations/_operations_status_operations.py new file mode 100644 index 00000000000..9946a3c24ed --- /dev/null +++ b/src/databoxedge/azext_databoxedge/vendored_sdks/databoxedge/aio/operations/_operations_status_operations.py @@ -0,0 +1,105 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, Callable, Dict, Generic, Optional, TypeVar +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.mgmt.core.exceptions import ARMErrorFormat + +from ... import models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class OperationsStatusOperations: + """OperationsStatusOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~data_box_edge_management_client.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + async def get( + self, + device_name: str, + name: str, + resource_group_name: str, + **kwargs + ) -> "models.Job": + """Gets the details of a specified job on a Data Box Edge/Data Box Gateway device. + + Gets the details of a specified job on a Data Box Edge/Data Box Gateway device. + + :param device_name: The device name. + :type device_name: str + :param name: The job name. + :type name: str + :param resource_group_name: The resource group name. + :type resource_group_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: Job, or the result of cls(response) + :rtype: ~data_box_edge_management_client.models.Job + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.Job"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('Job', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/operationsStatus/{name}'} # type: ignore diff --git a/src/databoxedge/azext_databoxedge/vendored_sdks/databoxedge/aio/operations/_orders_operations.py b/src/databoxedge/azext_databoxedge/vendored_sdks/databoxedge/aio/operations/_orders_operations.py new file mode 100644 index 00000000000..887741ce2f8 --- /dev/null +++ b/src/databoxedge/azext_databoxedge/vendored_sdks/databoxedge/aio/operations/_orders_operations.py @@ -0,0 +1,478 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling + +from ... import models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class OrdersOperations: + """OrdersOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~data_box_edge_management_client.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list_by_data_box_edge_device( + self, + device_name: str, + resource_group_name: str, + **kwargs + ) -> AsyncIterable["models.OrderList"]: + """Lists all the orders related to a Data Box Edge/Data Box Gateway device. + + Lists all the orders related to a Data Box Edge/Data Box Gateway device. + + :param device_name: The device name. + :type device_name: str + :param resource_group_name: The resource group name. + :type resource_group_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either OrderList or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~data_box_edge_management_client.models.OrderList] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.OrderList"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_by_data_box_edge_device.metadata['url'] # type: ignore + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('OrderList', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_by_data_box_edge_device.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/orders'} # type: ignore + + async def get( + self, + device_name: str, + resource_group_name: str, + **kwargs + ) -> "models.Order": + """Gets a specific order by name. + + Gets a specific order by name. + + :param device_name: The device name. + :type device_name: str + :param resource_group_name: The resource group name. + :type resource_group_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: Order, or the result of cls(response) + :rtype: ~data_box_edge_management_client.models.Order + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.Order"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('Order', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/orders/default'} # type: ignore + + async def _create_or_update_initial( + self, + device_name: str, + resource_group_name: str, + order: "models.Order", + **kwargs + ) -> Optional["models.Order"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.Order"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._create_or_update_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(order, 'Order') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('Order', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/orders/default'} # type: ignore + + async def begin_create_or_update( + self, + device_name: str, + resource_group_name: str, + order: "models.Order", + **kwargs + ) -> AsyncLROPoller["models.Order"]: + """Creates or updates an order. + + Creates or updates an order. + + :param device_name: The order details of a device. + :type device_name: str + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param order: The order to be created or updated. + :type order: ~data_box_edge_management_client.models.Order + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either Order or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~data_box_edge_management_client.models.Order] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["models.Order"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._create_or_update_initial( + device_name=device_name, + resource_group_name=resource_group_name, + order=order, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('Order', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/orders/default'} # type: ignore + + async def _delete_initial( + self, + device_name: str, + resource_group_name: str, + **kwargs + ) -> None: + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self._delete_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/orders/default'} # type: ignore + + async def begin_delete( + self, + device_name: str, + resource_group_name: str, + **kwargs + ) -> AsyncLROPoller[None]: + """Deletes the order related to the device. + + Deletes the order related to the device. + + :param device_name: The device name. + :type device_name: str + :param resource_group_name: The resource group name. + :type resource_group_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._delete_initial( + device_name=device_name, + resource_group_name=resource_group_name, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/orders/default'} # type: ignore + + async def list_dc_access_code( + self, + device_name: str, + resource_group_name: str, + **kwargs + ) -> "models.DcAccessCode": + """Gets the DCAccess Code. + + Gets the DCAccess Code. + + :param device_name: The device name. + :type device_name: str + :param resource_group_name: The resource group name. + :type resource_group_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: DcAccessCode, or the result of cls(response) + :rtype: ~data_box_edge_management_client.models.DcAccessCode + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.DcAccessCode"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.list_dc_access_code.metadata['url'] # type: ignore + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('DcAccessCode', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + list_dc_access_code.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/orders/default/listDCAccessCode'} # type: ignore diff --git a/src/databoxedge/azext_databoxedge/vendored_sdks/databoxedge/aio/operations/_roles_operations.py b/src/databoxedge/azext_databoxedge/vendored_sdks/databoxedge/aio/operations/_roles_operations.py new file mode 100644 index 00000000000..37b7a084e8b --- /dev/null +++ b/src/databoxedge/azext_databoxedge/vendored_sdks/databoxedge/aio/operations/_roles_operations.py @@ -0,0 +1,428 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling + +from ... import models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class RolesOperations: + """RolesOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~data_box_edge_management_client.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list_by_data_box_edge_device( + self, + device_name: str, + resource_group_name: str, + **kwargs + ) -> AsyncIterable["models.RoleList"]: + """Lists all the roles configured in a Data Box Edge/Data Box Gateway device. + + :param device_name: The device name. + :type device_name: str + :param resource_group_name: The resource group name. + :type resource_group_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either RoleList or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~data_box_edge_management_client.models.RoleList] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.RoleList"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_by_data_box_edge_device.metadata['url'] # type: ignore + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('RoleList', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_by_data_box_edge_device.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/roles'} # type: ignore + + async def get( + self, + device_name: str, + name: str, + resource_group_name: str, + **kwargs + ) -> "models.Role": + """Gets a specific role by name. + + :param device_name: The device name. + :type device_name: str + :param name: The role name. + :type name: str + :param resource_group_name: The resource group name. + :type resource_group_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: Role, or the result of cls(response) + :rtype: ~data_box_edge_management_client.models.Role + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.Role"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('Role', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/roles/{name}'} # type: ignore + + async def _create_or_update_initial( + self, + device_name: str, + name: str, + resource_group_name: str, + role: "models.Role", + **kwargs + ) -> Optional["models.Role"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.Role"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._create_or_update_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(role, 'Role') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('Role', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/roles/{name}'} # type: ignore + + async def begin_create_or_update( + self, + device_name: str, + name: str, + resource_group_name: str, + role: "models.Role", + **kwargs + ) -> AsyncLROPoller["models.Role"]: + """Create or update a role. + + :param device_name: The device name. + :type device_name: str + :param name: The role name. + :type name: str + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param role: The role properties. + :type role: ~data_box_edge_management_client.models.Role + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either Role or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~data_box_edge_management_client.models.Role] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["models.Role"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._create_or_update_initial( + device_name=device_name, + name=name, + resource_group_name=resource_group_name, + role=role, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('Role', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/roles/{name}'} # type: ignore + + async def _delete_initial( + self, + device_name: str, + name: str, + resource_group_name: str, + **kwargs + ) -> None: + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self._delete_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/roles/{name}'} # type: ignore + + async def begin_delete( + self, + device_name: str, + name: str, + resource_group_name: str, + **kwargs + ) -> AsyncLROPoller[None]: + """Deletes the role on the device. + + :param device_name: The device name. + :type device_name: str + :param name: The role name. + :type name: str + :param resource_group_name: The resource group name. + :type resource_group_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._delete_initial( + device_name=device_name, + name=name, + resource_group_name=resource_group_name, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/roles/{name}'} # type: ignore diff --git a/src/databoxedge/azext_databoxedge/vendored_sdks/databoxedge/aio/operations/_shares_operations.py b/src/databoxedge/azext_databoxedge/vendored_sdks/databoxedge/aio/operations/_shares_operations.py new file mode 100644 index 00000000000..92b0e734202 --- /dev/null +++ b/src/databoxedge/azext_databoxedge/vendored_sdks/databoxedge/aio/operations/_shares_operations.py @@ -0,0 +1,551 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling + +from ... import models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class SharesOperations: + """SharesOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~data_box_edge_management_client.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list_by_data_box_edge_device( + self, + device_name: str, + resource_group_name: str, + **kwargs + ) -> AsyncIterable["models.ShareList"]: + """Lists all the shares in a Data Box Edge/Data Box Gateway device. + + Lists all the shares in a Data Box Edge/Data Box Gateway device. + + :param device_name: The device name. + :type device_name: str + :param resource_group_name: The resource group name. + :type resource_group_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either ShareList or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~data_box_edge_management_client.models.ShareList] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.ShareList"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_by_data_box_edge_device.metadata['url'] # type: ignore + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('ShareList', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_by_data_box_edge_device.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/shares'} # type: ignore + + async def get( + self, + device_name: str, + name: str, + resource_group_name: str, + **kwargs + ) -> "models.Share": + """Gets a share by name. + + Gets a share by name. + + :param device_name: The device name. + :type device_name: str + :param name: The share name. + :type name: str + :param resource_group_name: The resource group name. + :type resource_group_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: Share, or the result of cls(response) + :rtype: ~data_box_edge_management_client.models.Share + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.Share"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('Share', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/shares/{name}'} # type: ignore + + async def _create_or_update_initial( + self, + device_name: str, + name: str, + resource_group_name: str, + share: "models.Share", + **kwargs + ) -> Optional["models.Share"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.Share"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._create_or_update_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(share, 'Share') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('Share', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/shares/{name}'} # type: ignore + + async def begin_create_or_update( + self, + device_name: str, + name: str, + resource_group_name: str, + share: "models.Share", + **kwargs + ) -> AsyncLROPoller["models.Share"]: + """Creates a new share or updates an existing share on the device. + + Creates a new share or updates an existing share on the device. + + :param device_name: The device name. + :type device_name: str + :param name: The share name. + :type name: str + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param share: The share properties. + :type share: ~data_box_edge_management_client.models.Share + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either Share or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~data_box_edge_management_client.models.Share] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["models.Share"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._create_or_update_initial( + device_name=device_name, + name=name, + resource_group_name=resource_group_name, + share=share, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('Share', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/shares/{name}'} # type: ignore + + async def _delete_initial( + self, + device_name: str, + name: str, + resource_group_name: str, + **kwargs + ) -> None: + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self._delete_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/shares/{name}'} # type: ignore + + async def begin_delete( + self, + device_name: str, + name: str, + resource_group_name: str, + **kwargs + ) -> AsyncLROPoller[None]: + """Deletes the share on the Data Box Edge/Data Box Gateway device. + + :param device_name: The device name. + :type device_name: str + :param name: The share name. + :type name: str + :param resource_group_name: The resource group name. + :type resource_group_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._delete_initial( + device_name=device_name, + name=name, + resource_group_name=resource_group_name, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/shares/{name}'} # type: ignore + + async def _refresh_initial( + self, + device_name: str, + name: str, + resource_group_name: str, + **kwargs + ) -> None: + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self._refresh_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _refresh_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/shares/{name}/refresh'} # type: ignore + + async def begin_refresh( + self, + device_name: str, + name: str, + resource_group_name: str, + **kwargs + ) -> AsyncLROPoller[None]: + """Refreshes the share metadata with the data from the cloud. + + Refreshes the share metadata with the data from the cloud. + + :param device_name: The device name. + :type device_name: str + :param name: The share name. + :type name: str + :param resource_group_name: The resource group name. + :type resource_group_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._refresh_initial( + device_name=device_name, + name=name, + resource_group_name=resource_group_name, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_refresh.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/shares/{name}/refresh'} # type: ignore diff --git a/src/databoxedge/azext_databoxedge/vendored_sdks/databoxedge/aio/operations/_storage_account_credentials_operations.py b/src/databoxedge/azext_databoxedge/vendored_sdks/databoxedge/aio/operations/_storage_account_credentials_operations.py new file mode 100644 index 00000000000..734c748a49d --- /dev/null +++ b/src/databoxedge/azext_databoxedge/vendored_sdks/databoxedge/aio/operations/_storage_account_credentials_operations.py @@ -0,0 +1,430 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling + +from ... import models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class StorageAccountCredentialsOperations: + """StorageAccountCredentialsOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~data_box_edge_management_client.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list_by_data_box_edge_device( + self, + device_name: str, + resource_group_name: str, + **kwargs + ) -> AsyncIterable["models.StorageAccountCredentialList"]: + """Gets all the storage account credentials in a Data Box Edge/Data Box Gateway device. + + Gets all the storage account credentials in a Data Box Edge/Data Box Gateway device. + + :param device_name: The device name. + :type device_name: str + :param resource_group_name: The resource group name. + :type resource_group_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either StorageAccountCredentialList or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~data_box_edge_management_client.models.StorageAccountCredentialList] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.StorageAccountCredentialList"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_by_data_box_edge_device.metadata['url'] # type: ignore + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('StorageAccountCredentialList', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_by_data_box_edge_device.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/storageAccountCredentials'} # type: ignore + + async def get( + self, + device_name: str, + name: str, + resource_group_name: str, + **kwargs + ) -> "models.StorageAccountCredential": + """Gets the properties of the specified storage account credential. + + :param device_name: The device name. + :type device_name: str + :param name: The storage account credential name. + :type name: str + :param resource_group_name: The resource group name. + :type resource_group_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: StorageAccountCredential, or the result of cls(response) + :rtype: ~data_box_edge_management_client.models.StorageAccountCredential + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.StorageAccountCredential"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('StorageAccountCredential', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/storageAccountCredentials/{name}'} # type: ignore + + async def _create_or_update_initial( + self, + device_name: str, + name: str, + resource_group_name: str, + storage_account_credential: "models.StorageAccountCredential", + **kwargs + ) -> Optional["models.StorageAccountCredential"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.StorageAccountCredential"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._create_or_update_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(storage_account_credential, 'StorageAccountCredential') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('StorageAccountCredential', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/storageAccountCredentials/{name}'} # type: ignore + + async def begin_create_or_update( + self, + device_name: str, + name: str, + resource_group_name: str, + storage_account_credential: "models.StorageAccountCredential", + **kwargs + ) -> AsyncLROPoller["models.StorageAccountCredential"]: + """Creates or updates the storage account credential. + + :param device_name: The device name. + :type device_name: str + :param name: The storage account credential name. + :type name: str + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param storage_account_credential: The storage account credential. + :type storage_account_credential: ~data_box_edge_management_client.models.StorageAccountCredential + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either StorageAccountCredential or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~data_box_edge_management_client.models.StorageAccountCredential] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["models.StorageAccountCredential"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._create_or_update_initial( + device_name=device_name, + name=name, + resource_group_name=resource_group_name, + storage_account_credential=storage_account_credential, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('StorageAccountCredential', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/storageAccountCredentials/{name}'} # type: ignore + + async def _delete_initial( + self, + device_name: str, + name: str, + resource_group_name: str, + **kwargs + ) -> None: + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self._delete_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/storageAccountCredentials/{name}'} # type: ignore + + async def begin_delete( + self, + device_name: str, + name: str, + resource_group_name: str, + **kwargs + ) -> AsyncLROPoller[None]: + """Deletes the storage account credential. + + :param device_name: The device name. + :type device_name: str + :param name: The storage account credential name. + :type name: str + :param resource_group_name: The resource group name. + :type resource_group_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._delete_initial( + device_name=device_name, + name=name, + resource_group_name=resource_group_name, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/storageAccountCredentials/{name}'} # type: ignore diff --git a/src/databoxedge/azext_databoxedge/vendored_sdks/databoxedge/aio/operations/_storage_accounts_operations.py b/src/databoxedge/azext_databoxedge/vendored_sdks/databoxedge/aio/operations/_storage_accounts_operations.py new file mode 100644 index 00000000000..f213dc173dc --- /dev/null +++ b/src/databoxedge/azext_databoxedge/vendored_sdks/databoxedge/aio/operations/_storage_accounts_operations.py @@ -0,0 +1,434 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling + +from ... import models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class StorageAccountsOperations: + """StorageAccountsOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~data_box_edge_management_client.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list_by_data_box_edge_device( + self, + device_name: str, + resource_group_name: str, + **kwargs + ) -> AsyncIterable["models.StorageAccountList"]: + """Lists all the StorageAccounts in a Data Box Edge/Data Box Gateway device. + + Lists all the StorageAccounts in a Data Box Edge/Data Box Gateway device. + + :param device_name: The device name. + :type device_name: str + :param resource_group_name: The resource group name. + :type resource_group_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either StorageAccountList or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~data_box_edge_management_client.models.StorageAccountList] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.StorageAccountList"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_by_data_box_edge_device.metadata['url'] # type: ignore + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('StorageAccountList', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_by_data_box_edge_device.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/storageAccounts'} # type: ignore + + async def get( + self, + device_name: str, + storage_account_name: str, + resource_group_name: str, + **kwargs + ) -> "models.StorageAccount": + """Gets a StorageAccount by name. + + Gets a StorageAccount by name. + + :param device_name: The device name. + :type device_name: str + :param storage_account_name: The storage account name. + :type storage_account_name: str + :param resource_group_name: The resource group name. + :type resource_group_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: StorageAccount, or the result of cls(response) + :rtype: ~data_box_edge_management_client.models.StorageAccount + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.StorageAccount"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'storageAccountName': self._serialize.url("storage_account_name", storage_account_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('StorageAccount', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/storageAccounts/{storageAccountName}'} # type: ignore + + async def _create_or_update_initial( + self, + device_name: str, + storage_account_name: str, + resource_group_name: str, + storage_account: "models.StorageAccount", + **kwargs + ) -> Optional["models.StorageAccount"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.StorageAccount"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._create_or_update_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'storageAccountName': self._serialize.url("storage_account_name", storage_account_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(storage_account, 'StorageAccount') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('StorageAccount', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/storageAccounts/{storageAccountName}'} # type: ignore + + async def begin_create_or_update( + self, + device_name: str, + storage_account_name: str, + resource_group_name: str, + storage_account: "models.StorageAccount", + **kwargs + ) -> AsyncLROPoller["models.StorageAccount"]: + """Creates a new StorageAccount or updates an existing StorageAccount on the device. + + Creates a new StorageAccount or updates an existing StorageAccount on the device. + + :param device_name: The device name. + :type device_name: str + :param storage_account_name: The StorageAccount name. + :type storage_account_name: str + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param storage_account: The StorageAccount properties. + :type storage_account: ~data_box_edge_management_client.models.StorageAccount + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either StorageAccount or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~data_box_edge_management_client.models.StorageAccount] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["models.StorageAccount"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._create_or_update_initial( + device_name=device_name, + storage_account_name=storage_account_name, + resource_group_name=resource_group_name, + storage_account=storage_account, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('StorageAccount', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'storageAccountName': self._serialize.url("storage_account_name", storage_account_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/storageAccounts/{storageAccountName}'} # type: ignore + + async def _delete_initial( + self, + device_name: str, + storage_account_name: str, + resource_group_name: str, + **kwargs + ) -> None: + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self._delete_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'storageAccountName': self._serialize.url("storage_account_name", storage_account_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/storageAccounts/{storageAccountName}'} # type: ignore + + async def begin_delete( + self, + device_name: str, + storage_account_name: str, + resource_group_name: str, + **kwargs + ) -> AsyncLROPoller[None]: + """Deletes the StorageAccount on the Data Box Edge/Data Box Gateway device. + + :param device_name: The device name. + :type device_name: str + :param storage_account_name: The StorageAccount name. + :type storage_account_name: str + :param resource_group_name: The resource group name. + :type resource_group_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._delete_initial( + device_name=device_name, + storage_account_name=storage_account_name, + resource_group_name=resource_group_name, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'storageAccountName': self._serialize.url("storage_account_name", storage_account_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/storageAccounts/{storageAccountName}'} # type: ignore diff --git a/src/databoxedge/azext_databoxedge/vendored_sdks/databoxedge/aio/operations/_support_packages_operations.py b/src/databoxedge/azext_databoxedge/vendored_sdks/databoxedge/aio/operations/_support_packages_operations.py new file mode 100644 index 00000000000..eb9c782c33a --- /dev/null +++ b/src/databoxedge/azext_databoxedge/vendored_sdks/databoxedge/aio/operations/_support_packages_operations.py @@ -0,0 +1,163 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, Callable, Dict, Generic, Optional, TypeVar, Union +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling + +from ... import models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class SupportPackagesOperations: + """SupportPackagesOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~data_box_edge_management_client.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + async def _trigger_support_package_initial( + self, + device_name: str, + resource_group_name: str, + trigger_support_package_request: "models.TriggerSupportPackageRequest", + **kwargs + ) -> None: + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._trigger_support_package_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(trigger_support_package_request, 'TriggerSupportPackageRequest') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _trigger_support_package_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/triggerSupportPackage'} # type: ignore + + async def begin_trigger_support_package( + self, + device_name: str, + resource_group_name: str, + trigger_support_package_request: "models.TriggerSupportPackageRequest", + **kwargs + ) -> AsyncLROPoller[None]: + """Triggers support package on the device. + + Triggers support package on the device. + + :param device_name: The device name. + :type device_name: str + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param trigger_support_package_request: The trigger support package request object. + :type trigger_support_package_request: ~data_box_edge_management_client.models.TriggerSupportPackageRequest + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._trigger_support_package_initial( + device_name=device_name, + resource_group_name=resource_group_name, + trigger_support_package_request=trigger_support_package_request, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_trigger_support_package.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/triggerSupportPackage'} # type: ignore diff --git a/src/databoxedge/azext_databoxedge/vendored_sdks/databoxedge/aio/operations/_triggers_operations.py b/src/databoxedge/azext_databoxedge/vendored_sdks/databoxedge/aio/operations/_triggers_operations.py new file mode 100644 index 00000000000..9c97d837c6e --- /dev/null +++ b/src/databoxedge/azext_databoxedge/vendored_sdks/databoxedge/aio/operations/_triggers_operations.py @@ -0,0 +1,434 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling + +from ... import models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class TriggersOperations: + """TriggersOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~data_box_edge_management_client.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list_by_data_box_edge_device( + self, + device_name: str, + resource_group_name: str, + filter: Optional[str] = None, + **kwargs + ) -> AsyncIterable["models.TriggerList"]: + """Lists all the triggers configured in the device. + + :param device_name: The device name. + :type device_name: str + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param filter: Specify $filter='CustomContextTag eq :code:``' to filter on custom context + tag property. + :type filter: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either TriggerList or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~data_box_edge_management_client.models.TriggerList] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.TriggerList"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_by_data_box_edge_device.metadata['url'] # type: ignore + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + if filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('TriggerList', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_by_data_box_edge_device.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/triggers'} # type: ignore + + async def get( + self, + device_name: str, + name: str, + resource_group_name: str, + **kwargs + ) -> "models.Trigger": + """Get a specific trigger by name. + + :param device_name: The device name. + :type device_name: str + :param name: The trigger name. + :type name: str + :param resource_group_name: The resource group name. + :type resource_group_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: Trigger, or the result of cls(response) + :rtype: ~data_box_edge_management_client.models.Trigger + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.Trigger"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('Trigger', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/triggers/{name}'} # type: ignore + + async def _create_or_update_initial( + self, + device_name: str, + name: str, + resource_group_name: str, + trigger: "models.Trigger", + **kwargs + ) -> Optional["models.Trigger"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.Trigger"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._create_or_update_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(trigger, 'Trigger') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('Trigger', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/triggers/{name}'} # type: ignore + + async def begin_create_or_update( + self, + device_name: str, + name: str, + resource_group_name: str, + trigger: "models.Trigger", + **kwargs + ) -> AsyncLROPoller["models.Trigger"]: + """Creates or updates a trigger. + + :param device_name: Creates or updates a trigger. + :type device_name: str + :param name: The trigger name. + :type name: str + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param trigger: The trigger. + :type trigger: ~data_box_edge_management_client.models.Trigger + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either Trigger or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~data_box_edge_management_client.models.Trigger] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["models.Trigger"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._create_or_update_initial( + device_name=device_name, + name=name, + resource_group_name=resource_group_name, + trigger=trigger, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('Trigger', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/triggers/{name}'} # type: ignore + + async def _delete_initial( + self, + device_name: str, + name: str, + resource_group_name: str, + **kwargs + ) -> None: + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self._delete_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/triggers/{name}'} # type: ignore + + async def begin_delete( + self, + device_name: str, + name: str, + resource_group_name: str, + **kwargs + ) -> AsyncLROPoller[None]: + """Deletes the trigger on the gateway device. + + :param device_name: The device name. + :type device_name: str + :param name: The trigger name. + :type name: str + :param resource_group_name: The resource group name. + :type resource_group_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._delete_initial( + device_name=device_name, + name=name, + resource_group_name=resource_group_name, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/triggers/{name}'} # type: ignore diff --git a/src/databoxedge/azext_databoxedge/vendored_sdks/databoxedge/aio/operations/_users_operations.py b/src/databoxedge/azext_databoxedge/vendored_sdks/databoxedge/aio/operations/_users_operations.py new file mode 100644 index 00000000000..d69b3ab7fd0 --- /dev/null +++ b/src/databoxedge/azext_databoxedge/vendored_sdks/databoxedge/aio/operations/_users_operations.py @@ -0,0 +1,434 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling + +from ... import models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class UsersOperations: + """UsersOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~data_box_edge_management_client.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list_by_data_box_edge_device( + self, + device_name: str, + resource_group_name: str, + filter: Optional[str] = None, + **kwargs + ) -> AsyncIterable["models.UserList"]: + """Gets all the users registered on a Data Box Edge/Data Box Gateway device. + + :param device_name: The device name. + :type device_name: str + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param filter: Specify $filter='Type eq :code:``' to filter on user type property. + :type filter: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either UserList or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~data_box_edge_management_client.models.UserList] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.UserList"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_by_data_box_edge_device.metadata['url'] # type: ignore + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + if filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('UserList', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_by_data_box_edge_device.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/users'} # type: ignore + + async def get( + self, + device_name: str, + name: str, + resource_group_name: str, + **kwargs + ) -> "models.User": + """Gets the properties of the specified user. + + :param device_name: The device name. + :type device_name: str + :param name: The user name. + :type name: str + :param resource_group_name: The resource group name. + :type resource_group_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: User, or the result of cls(response) + :rtype: ~data_box_edge_management_client.models.User + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.User"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('User', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/users/{name}'} # type: ignore + + async def _create_or_update_initial( + self, + device_name: str, + name: str, + resource_group_name: str, + user: "models.User", + **kwargs + ) -> Optional["models.User"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.User"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._create_or_update_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(user, 'User') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('User', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/users/{name}'} # type: ignore + + async def begin_create_or_update( + self, + device_name: str, + name: str, + resource_group_name: str, + user: "models.User", + **kwargs + ) -> AsyncLROPoller["models.User"]: + """Creates a new user or updates an existing user's information on a Data Box Edge/Data Box + Gateway device. + + :param device_name: The device name. + :type device_name: str + :param name: The user name. + :type name: str + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param user: The user details. + :type user: ~data_box_edge_management_client.models.User + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either User or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~data_box_edge_management_client.models.User] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["models.User"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._create_or_update_initial( + device_name=device_name, + name=name, + resource_group_name=resource_group_name, + user=user, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('User', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/users/{name}'} # type: ignore + + async def _delete_initial( + self, + device_name: str, + name: str, + resource_group_name: str, + **kwargs + ) -> None: + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self._delete_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/users/{name}'} # type: ignore + + async def begin_delete( + self, + device_name: str, + name: str, + resource_group_name: str, + **kwargs + ) -> AsyncLROPoller[None]: + """Deletes the user on a databox edge/gateway device. + + :param device_name: The device name. + :type device_name: str + :param name: The user name. + :type name: str + :param resource_group_name: The resource group name. + :type resource_group_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._delete_initial( + device_name=device_name, + name=name, + resource_group_name=resource_group_name, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/users/{name}'} # type: ignore diff --git a/src/databoxedge/azext_databoxedge/vendored_sdks/databoxedge/models/__init__.py b/src/databoxedge/azext_databoxedge/vendored_sdks/databoxedge/models/__init__.py new file mode 100644 index 00000000000..f6e8c6876fc --- /dev/null +++ b/src/databoxedge/azext_databoxedge/vendored_sdks/databoxedge/models/__init__.py @@ -0,0 +1,516 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +try: + from ._models_py3 import Addon + from ._models_py3 import AddonList + from ._models_py3 import Address + from ._models_py3 import Alert + from ._models_py3 import AlertErrorDetails + from ._models_py3 import AlertList + from ._models_py3 import ArcAddon + from ._models_py3 import ArmBaseModel + from ._models_py3 import AsymmetricEncryptedSecret + from ._models_py3 import Authentication + from ._models_py3 import AzureContainerInfo + from ._models_py3 import BandwidthSchedule + from ._models_py3 import BandwidthSchedulesList + from ._models_py3 import ClientAccessRight + from ._models_py3 import CloudEdgeManagementRole + from ._models_py3 import CloudErrorBody + from ._models_py3 import CniConfig + from ._models_py3 import ComputeResource + from ._models_py3 import ContactDetails + from ._models_py3 import Container + from ._models_py3 import ContainerList + from ._models_py3 import DataBoxEdgeDevice + from ._models_py3 import DataBoxEdgeDeviceExtendedInfo + from ._models_py3 import DataBoxEdgeDeviceExtendedInfoPatch + from ._models_py3 import DataBoxEdgeDeviceList + from ._models_py3 import DataBoxEdgeDevicePatch + from ._models_py3 import DataBoxEdgeMoveRequest + from ._models_py3 import DataBoxEdgeSku + from ._models_py3 import DataBoxEdgeSkuList + from ._models_py3 import DataResidency + from ._models_py3 import DcAccessCode + from ._models_py3 import DiagnosticProactiveLogCollectionSettings + from ._models_py3 import DiagnosticRemoteSupportSettings + from ._models_py3 import EdgeProfile + from ._models_py3 import EdgeProfilePatch + from ._models_py3 import EdgeProfileSubscription + from ._models_py3 import EdgeProfileSubscriptionPatch + from ._models_py3 import EtcdInfo + from ._models_py3 import FileEventTrigger + from ._models_py3 import FileSourceInfo + from ._models_py3 import GenerateCertResponse + from ._models_py3 import ImageRepositoryCredential + from ._models_py3 import IoTAddon + from ._models_py3 import IoTDeviceInfo + from ._models_py3 import IoTEdgeAgentInfo + from ._models_py3 import IoTRole + from ._models_py3 import Ipv4Config + from ._models_py3 import Ipv6Config + from ._models_py3 import Job + from ._models_py3 import JobErrorDetails + from ._models_py3 import JobErrorItem + from ._models_py3 import KubernetesClusterInfo + from ._models_py3 import KubernetesIpConfiguration + from ._models_py3 import KubernetesRole + from ._models_py3 import KubernetesRoleCompute + from ._models_py3 import KubernetesRoleNetwork + from ._models_py3 import KubernetesRoleResources + from ._models_py3 import KubernetesRoleStorage + from ._models_py3 import KubernetesRoleStorageClassInfo + from ._models_py3 import LoadBalancerConfig + from ._models_py3 import MecRole + from ._models_py3 import MetricConfiguration + from ._models_py3 import MetricCounter + from ._models_py3 import MetricCounterSet + from ._models_py3 import MetricDimension + from ._models_py3 import MetricDimensionV1 + from ._models_py3 import MetricSpecificationV1 + from ._models_py3 import MonitoringMetricConfiguration + from ._models_py3 import MonitoringMetricConfigurationList + from ._models_py3 import MountPointMap + from ._models_py3 import NetworkAdapter + from ._models_py3 import NetworkAdapterPosition + from ._models_py3 import NetworkSettings + from ._models_py3 import Node + from ._models_py3 import NodeInfo + from ._models_py3 import NodeList + from ._models_py3 import Operation + from ._models_py3 import OperationDisplay + from ._models_py3 import OperationsList + from ._models_py3 import Order + from ._models_py3 import OrderList + from ._models_py3 import OrderStatus + from ._models_py3 import PeriodicTimerEventTrigger + from ._models_py3 import PeriodicTimerSourceInfo + from ._models_py3 import RefreshDetails + from ._models_py3 import RemoteSupportSettings + from ._models_py3 import ResourceIdentity + from ._models_py3 import ResourceMoveDetails + from ._models_py3 import ResourceTypeSku + from ._models_py3 import Role + from ._models_py3 import RoleList + from ._models_py3 import RoleSinkInfo + from ._models_py3 import Secret + from ._models_py3 import SecuritySettings + from ._models_py3 import ServiceSpecification + from ._models_py3 import Share + from ._models_py3 import ShareAccessRight + from ._models_py3 import ShareList + from ._models_py3 import Sku + from ._models_py3 import SkuCapability + from ._models_py3 import SkuCost + from ._models_py3 import SkuInformation + from ._models_py3 import SkuInformationList + from ._models_py3 import SkuLocationInfo + from ._models_py3 import StorageAccount + from ._models_py3 import StorageAccountCredential + from ._models_py3 import StorageAccountCredentialList + from ._models_py3 import StorageAccountList + from ._models_py3 import SubscriptionRegisteredFeatures + from ._models_py3 import SymmetricKey + from ._models_py3 import SystemData + from ._models_py3 import TrackingInfo + from ._models_py3 import Trigger + from ._models_py3 import TriggerList + from ._models_py3 import TriggerSupportPackageRequest + from ._models_py3 import UpdateDetails + from ._models_py3 import UpdateDownloadProgress + from ._models_py3 import UpdateInstallProgress + from ._models_py3 import UpdateSummary + from ._models_py3 import UploadCertificateRequest + from ._models_py3 import UploadCertificateResponse + from ._models_py3 import User + from ._models_py3 import UserAccessRight + from ._models_py3 import UserList +except (SyntaxError, ImportError): + from ._models import Addon # type: ignore + from ._models import AddonList # type: ignore + from ._models import Address # type: ignore + from ._models import Alert # type: ignore + from ._models import AlertErrorDetails # type: ignore + from ._models import AlertList # type: ignore + from ._models import ArcAddon # type: ignore + from ._models import ArmBaseModel # type: ignore + from ._models import AsymmetricEncryptedSecret # type: ignore + from ._models import Authentication # type: ignore + from ._models import AzureContainerInfo # type: ignore + from ._models import BandwidthSchedule # type: ignore + from ._models import BandwidthSchedulesList # type: ignore + from ._models import ClientAccessRight # type: ignore + from ._models import CloudEdgeManagementRole # type: ignore + from ._models import CloudErrorBody # type: ignore + from ._models import CniConfig # type: ignore + from ._models import ComputeResource # type: ignore + from ._models import ContactDetails # type: ignore + from ._models import Container # type: ignore + from ._models import ContainerList # type: ignore + from ._models import DataBoxEdgeDevice # type: ignore + from ._models import DataBoxEdgeDeviceExtendedInfo # type: ignore + from ._models import DataBoxEdgeDeviceExtendedInfoPatch # type: ignore + from ._models import DataBoxEdgeDeviceList # type: ignore + from ._models import DataBoxEdgeDevicePatch # type: ignore + from ._models import DataBoxEdgeMoveRequest # type: ignore + from ._models import DataBoxEdgeSku # type: ignore + from ._models import DataBoxEdgeSkuList # type: ignore + from ._models import DataResidency # type: ignore + from ._models import DcAccessCode # type: ignore + from ._models import DiagnosticProactiveLogCollectionSettings # type: ignore + from ._models import DiagnosticRemoteSupportSettings # type: ignore + from ._models import EdgeProfile # type: ignore + from ._models import EdgeProfilePatch # type: ignore + from ._models import EdgeProfileSubscription # type: ignore + from ._models import EdgeProfileSubscriptionPatch # type: ignore + from ._models import EtcdInfo # type: ignore + from ._models import FileEventTrigger # type: ignore + from ._models import FileSourceInfo # type: ignore + from ._models import GenerateCertResponse # type: ignore + from ._models import ImageRepositoryCredential # type: ignore + from ._models import IoTAddon # type: ignore + from ._models import IoTDeviceInfo # type: ignore + from ._models import IoTEdgeAgentInfo # type: ignore + from ._models import IoTRole # type: ignore + from ._models import Ipv4Config # type: ignore + from ._models import Ipv6Config # type: ignore + from ._models import Job # type: ignore + from ._models import JobErrorDetails # type: ignore + from ._models import JobErrorItem # type: ignore + from ._models import KubernetesClusterInfo # type: ignore + from ._models import KubernetesIpConfiguration # type: ignore + from ._models import KubernetesRole # type: ignore + from ._models import KubernetesRoleCompute # type: ignore + from ._models import KubernetesRoleNetwork # type: ignore + from ._models import KubernetesRoleResources # type: ignore + from ._models import KubernetesRoleStorage # type: ignore + from ._models import KubernetesRoleStorageClassInfo # type: ignore + from ._models import LoadBalancerConfig # type: ignore + from ._models import MecRole # type: ignore + from ._models import MetricConfiguration # type: ignore + from ._models import MetricCounter # type: ignore + from ._models import MetricCounterSet # type: ignore + from ._models import MetricDimension # type: ignore + from ._models import MetricDimensionV1 # type: ignore + from ._models import MetricSpecificationV1 # type: ignore + from ._models import MonitoringMetricConfiguration # type: ignore + from ._models import MonitoringMetricConfigurationList # type: ignore + from ._models import MountPointMap # type: ignore + from ._models import NetworkAdapter # type: ignore + from ._models import NetworkAdapterPosition # type: ignore + from ._models import NetworkSettings # type: ignore + from ._models import Node # type: ignore + from ._models import NodeInfo # type: ignore + from ._models import NodeList # type: ignore + from ._models import Operation # type: ignore + from ._models import OperationDisplay # type: ignore + from ._models import OperationsList # type: ignore + from ._models import Order # type: ignore + from ._models import OrderList # type: ignore + from ._models import OrderStatus # type: ignore + from ._models import PeriodicTimerEventTrigger # type: ignore + from ._models import PeriodicTimerSourceInfo # type: ignore + from ._models import RefreshDetails # type: ignore + from ._models import RemoteSupportSettings # type: ignore + from ._models import ResourceIdentity # type: ignore + from ._models import ResourceMoveDetails # type: ignore + from ._models import ResourceTypeSku # type: ignore + from ._models import Role # type: ignore + from ._models import RoleList # type: ignore + from ._models import RoleSinkInfo # type: ignore + from ._models import Secret # type: ignore + from ._models import SecuritySettings # type: ignore + from ._models import ServiceSpecification # type: ignore + from ._models import Share # type: ignore + from ._models import ShareAccessRight # type: ignore + from ._models import ShareList # type: ignore + from ._models import Sku # type: ignore + from ._models import SkuCapability # type: ignore + from ._models import SkuCost # type: ignore + from ._models import SkuInformation # type: ignore + from ._models import SkuInformationList # type: ignore + from ._models import SkuLocationInfo # type: ignore + from ._models import StorageAccount # type: ignore + from ._models import StorageAccountCredential # type: ignore + from ._models import StorageAccountCredentialList # type: ignore + from ._models import StorageAccountList # type: ignore + from ._models import SubscriptionRegisteredFeatures # type: ignore + from ._models import SymmetricKey # type: ignore + from ._models import SystemData # type: ignore + from ._models import TrackingInfo # type: ignore + from ._models import Trigger # type: ignore + from ._models import TriggerList # type: ignore + from ._models import TriggerSupportPackageRequest # type: ignore + from ._models import UpdateDetails # type: ignore + from ._models import UpdateDownloadProgress # type: ignore + from ._models import UpdateInstallProgress # type: ignore + from ._models import UpdateSummary # type: ignore + from ._models import UploadCertificateRequest # type: ignore + from ._models import UploadCertificateResponse # type: ignore + from ._models import User # type: ignore + from ._models import UserAccessRight # type: ignore + from ._models import UserList # type: ignore + +from ._data_box_edge_management_client_enums import ( + AccessLevel, + AccountType, + AddonState, + AddonType, + AlertSeverity, + AuthenticationType, + AzureContainerDataFormat, + ClientPermissionType, + ContainerStatus, + CreatedByType, + DataBoxEdgeDeviceKind, + DataBoxEdgeDeviceStatus, + DataPolicy, + DataResidencyType, + DayOfWeek, + DeviceType, + DownloadPhase, + EncryptionAlgorithm, + HostPlatformType, + InstallRebootBehavior, + InstallationImpact, + JobStatus, + JobType, + KeyVaultSyncStatus, + KubernetesNodeType, + KubernetesState, + MetricAggregationType, + MetricCategory, + MetricUnit, + MonitoringStatus, + MountType, + MsiIdentityType, + NetworkAdapterDhcpStatus, + NetworkAdapterRdmaStatus, + NetworkAdapterStatus, + NetworkGroup, + NodeStatus, + OrderState, + PlatformType, + PosixComplianceStatus, + ProactiveDiagnosticsConsent, + RemoteApplicationType, + ResourceMoveStatus, + RoleStatus, + RoleTypes, + ShareAccessProtocol, + ShareAccessType, + ShareStatus, + ShipmentType, + SkuAvailability, + SkuName, + SkuSignupOption, + SkuTier, + SkuVersion, + SslStatus, + StorageAccountStatus, + SubscriptionState, + TimeGrain, + TriggerEventType, + UpdateOperation, + UpdateOperationStage, + UpdateStatus, + UpdateType, + UserType, +) + +__all__ = [ + 'Addon', + 'AddonList', + 'Address', + 'Alert', + 'AlertErrorDetails', + 'AlertList', + 'ArcAddon', + 'ArmBaseModel', + 'AsymmetricEncryptedSecret', + 'Authentication', + 'AzureContainerInfo', + 'BandwidthSchedule', + 'BandwidthSchedulesList', + 'ClientAccessRight', + 'CloudEdgeManagementRole', + 'CloudErrorBody', + 'CniConfig', + 'ComputeResource', + 'ContactDetails', + 'Container', + 'ContainerList', + 'DataBoxEdgeDevice', + 'DataBoxEdgeDeviceExtendedInfo', + 'DataBoxEdgeDeviceExtendedInfoPatch', + 'DataBoxEdgeDeviceList', + 'DataBoxEdgeDevicePatch', + 'DataBoxEdgeMoveRequest', + 'DataBoxEdgeSku', + 'DataBoxEdgeSkuList', + 'DataResidency', + 'DcAccessCode', + 'DiagnosticProactiveLogCollectionSettings', + 'DiagnosticRemoteSupportSettings', + 'EdgeProfile', + 'EdgeProfilePatch', + 'EdgeProfileSubscription', + 'EdgeProfileSubscriptionPatch', + 'EtcdInfo', + 'FileEventTrigger', + 'FileSourceInfo', + 'GenerateCertResponse', + 'ImageRepositoryCredential', + 'IoTAddon', + 'IoTDeviceInfo', + 'IoTEdgeAgentInfo', + 'IoTRole', + 'Ipv4Config', + 'Ipv6Config', + 'Job', + 'JobErrorDetails', + 'JobErrorItem', + 'KubernetesClusterInfo', + 'KubernetesIpConfiguration', + 'KubernetesRole', + 'KubernetesRoleCompute', + 'KubernetesRoleNetwork', + 'KubernetesRoleResources', + 'KubernetesRoleStorage', + 'KubernetesRoleStorageClassInfo', + 'LoadBalancerConfig', + 'MecRole', + 'MetricConfiguration', + 'MetricCounter', + 'MetricCounterSet', + 'MetricDimension', + 'MetricDimensionV1', + 'MetricSpecificationV1', + 'MonitoringMetricConfiguration', + 'MonitoringMetricConfigurationList', + 'MountPointMap', + 'NetworkAdapter', + 'NetworkAdapterPosition', + 'NetworkSettings', + 'Node', + 'NodeInfo', + 'NodeList', + 'Operation', + 'OperationDisplay', + 'OperationsList', + 'Order', + 'OrderList', + 'OrderStatus', + 'PeriodicTimerEventTrigger', + 'PeriodicTimerSourceInfo', + 'RefreshDetails', + 'RemoteSupportSettings', + 'ResourceIdentity', + 'ResourceMoveDetails', + 'ResourceTypeSku', + 'Role', + 'RoleList', + 'RoleSinkInfo', + 'Secret', + 'SecuritySettings', + 'ServiceSpecification', + 'Share', + 'ShareAccessRight', + 'ShareList', + 'Sku', + 'SkuCapability', + 'SkuCost', + 'SkuInformation', + 'SkuInformationList', + 'SkuLocationInfo', + 'StorageAccount', + 'StorageAccountCredential', + 'StorageAccountCredentialList', + 'StorageAccountList', + 'SubscriptionRegisteredFeatures', + 'SymmetricKey', + 'SystemData', + 'TrackingInfo', + 'Trigger', + 'TriggerList', + 'TriggerSupportPackageRequest', + 'UpdateDetails', + 'UpdateDownloadProgress', + 'UpdateInstallProgress', + 'UpdateSummary', + 'UploadCertificateRequest', + 'UploadCertificateResponse', + 'User', + 'UserAccessRight', + 'UserList', + 'AccessLevel', + 'AccountType', + 'AddonState', + 'AddonType', + 'AlertSeverity', + 'AuthenticationType', + 'AzureContainerDataFormat', + 'ClientPermissionType', + 'ContainerStatus', + 'CreatedByType', + 'DataBoxEdgeDeviceKind', + 'DataBoxEdgeDeviceStatus', + 'DataPolicy', + 'DataResidencyType', + 'DayOfWeek', + 'DeviceType', + 'DownloadPhase', + 'EncryptionAlgorithm', + 'HostPlatformType', + 'InstallRebootBehavior', + 'InstallationImpact', + 'JobStatus', + 'JobType', + 'KeyVaultSyncStatus', + 'KubernetesNodeType', + 'KubernetesState', + 'MetricAggregationType', + 'MetricCategory', + 'MetricUnit', + 'MonitoringStatus', + 'MountType', + 'MsiIdentityType', + 'NetworkAdapterDhcpStatus', + 'NetworkAdapterRdmaStatus', + 'NetworkAdapterStatus', + 'NetworkGroup', + 'NodeStatus', + 'OrderState', + 'PlatformType', + 'PosixComplianceStatus', + 'ProactiveDiagnosticsConsent', + 'RemoteApplicationType', + 'ResourceMoveStatus', + 'RoleStatus', + 'RoleTypes', + 'ShareAccessProtocol', + 'ShareAccessType', + 'ShareStatus', + 'ShipmentType', + 'SkuAvailability', + 'SkuName', + 'SkuSignupOption', + 'SkuTier', + 'SkuVersion', + 'SslStatus', + 'StorageAccountStatus', + 'SubscriptionState', + 'TimeGrain', + 'TriggerEventType', + 'UpdateOperation', + 'UpdateOperationStage', + 'UpdateStatus', + 'UpdateType', + 'UserType', +] diff --git a/src/databoxedge/azext_databoxedge/vendored_sdks/databoxedge/models/_data_box_edge_management_client_enums.py b/src/databoxedge/azext_databoxedge/vendored_sdks/databoxedge/models/_data_box_edge_management_client_enums.py new file mode 100644 index 00000000000..7c98d0f70cd --- /dev/null +++ b/src/databoxedge/azext_databoxedge/vendored_sdks/databoxedge/models/_data_box_edge_management_client_enums.py @@ -0,0 +1,620 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from enum import Enum, EnumMeta +from six import with_metaclass + +class _CaseInsensitiveEnumMeta(EnumMeta): + def __getitem__(self, name): + return super().__getitem__(name.upper()) + + def __getattr__(cls, name): + """Return the enum member matching `name` + We use __getattr__ instead of descriptors or inserting into the enum + class' __dict__ in order to support `name` and `value` being both + properties for enum members (which live in the class' __dict__) and + enum members themselves. + """ + try: + return cls._member_map_[name.upper()] + except KeyError: + raise AttributeError(name) + + +class AccessLevel(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Access level allowed for this remote application type + """ + + NONE = "None" + READ_ONLY = "ReadOnly" + READ_WRITE = "ReadWrite" + FULL_ACCESS = "FullAccess" + +class AccountType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Type of storage accessed on the storage account. + """ + + GENERAL_PURPOSE_STORAGE = "GeneralPurposeStorage" + BLOB_STORAGE = "BlobStorage" + +class AddonState(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Addon Provisioning State + """ + + INVALID = "Invalid" + CREATING = "Creating" + CREATED = "Created" + UPDATING = "Updating" + RECONFIGURING = "Reconfiguring" + FAILED = "Failed" + DELETING = "Deleting" + +class AddonType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Addon type. + """ + + IOT_EDGE = "IotEdge" + ARC_FOR_KUBERNETES = "ArcForKubernetes" + +class AlertSeverity(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Severity of the alert. + """ + + INFORMATIONAL = "Informational" + WARNING = "Warning" + CRITICAL = "Critical" + +class AuthenticationType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """The authentication type. + """ + + INVALID = "Invalid" + AZURE_ACTIVE_DIRECTORY = "AzureActiveDirectory" + +class AzureContainerDataFormat(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Storage format used for the file represented by the share. + """ + + BLOCK_BLOB = "BlockBlob" + PAGE_BLOB = "PageBlob" + AZURE_FILE = "AzureFile" + +class ClientPermissionType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Type of access to be allowed for the client. + """ + + NO_ACCESS = "NoAccess" + READ_ONLY = "ReadOnly" + READ_WRITE = "ReadWrite" + +class ContainerStatus(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Current status of the container. + """ + + OK = "OK" + OFFLINE = "Offline" + UNKNOWN = "Unknown" + UPDATING = "Updating" + NEEDS_ATTENTION = "NeedsAttention" + +class CreatedByType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """The type of identity that created the resource. + """ + + USER = "User" + APPLICATION = "Application" + MANAGED_IDENTITY = "ManagedIdentity" + KEY = "Key" + +class DataBoxEdgeDeviceKind(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """The kind of the device. + """ + + AZURE_DATA_BOX_GATEWAY = "AzureDataBoxGateway" + AZURE_STACK_EDGE = "AzureStackEdge" + AZURE_STACK_HUB = "AzureStackHub" + AZURE_MODULAR_DATA_CENTRE = "AzureModularDataCentre" + +class DataBoxEdgeDeviceStatus(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """The status of the Data Box Edge/Gateway device. + """ + + READY_TO_SETUP = "ReadyToSetup" + ONLINE = "Online" + OFFLINE = "Offline" + NEEDS_ATTENTION = "NeedsAttention" + DISCONNECTED = "Disconnected" + PARTIALLY_DISCONNECTED = "PartiallyDisconnected" + MAINTENANCE = "Maintenance" + +class DataPolicy(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Data policy of the share. + """ + + CLOUD = "Cloud" + LOCAL = "Local" + +class DataResidencyType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """DataResidencyType enum + """ + + GEO_ZONE_REPLICATION = "GeoZoneReplication" + ZONE_REPLICATION = "ZoneReplication" + +class DayOfWeek(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + + SUNDAY = "Sunday" + MONDAY = "Monday" + TUESDAY = "Tuesday" + WEDNESDAY = "Wednesday" + THURSDAY = "Thursday" + FRIDAY = "Friday" + SATURDAY = "Saturday" + +class DeviceType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """The type of the Data Box Edge/Gateway device. + """ + + DATA_BOX_EDGE_DEVICE = "DataBoxEdgeDevice" + +class DownloadPhase(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """The download phase. + """ + + UNKNOWN = "Unknown" + INITIALIZING = "Initializing" + DOWNLOADING = "Downloading" + VERIFYING = "Verifying" + +class EncryptionAlgorithm(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """The algorithm used to encrypt "Value". + """ + + NONE = "None" + AES256 = "AES256" + RSAES_PKCS1_V1_5 = "RSAES_PKCS1_v_1_5" + +class HostPlatformType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Platform where the runtime is hosted. + """ + + KUBERNETES_CLUSTER = "KubernetesCluster" + LINUX_VM = "LinuxVM" + +class InstallationImpact(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Impact of Installing an updateType + """ + + NONE = "None" + DEVICE_REBOOTED = "DeviceRebooted" + KUBERNETES_WORKLOADS_DOWN = "KubernetesWorkloadsDown" + +class InstallRebootBehavior(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Indicates if updates are available and at least one of the updates needs a reboot. + """ + + NEVER_REBOOTS = "NeverReboots" + REQUIRES_REBOOT = "RequiresReboot" + REQUEST_REBOOT = "RequestReboot" + +class JobStatus(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """The current status of the job. + """ + + INVALID = "Invalid" + RUNNING = "Running" + SUCCEEDED = "Succeeded" + FAILED = "Failed" + CANCELED = "Canceled" + PAUSED = "Paused" + SCHEDULED = "Scheduled" + +class JobType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """The type of the job. + """ + + INVALID = "Invalid" + SCAN_FOR_UPDATES = "ScanForUpdates" + DOWNLOAD_UPDATES = "DownloadUpdates" + INSTALL_UPDATES = "InstallUpdates" + REFRESH_SHARE = "RefreshShare" + REFRESH_CONTAINER = "RefreshContainer" + BACKUP = "Backup" + RESTORE = "Restore" + TRIGGER_SUPPORT_PACKAGE = "TriggerSupportPackage" + +class KeyVaultSyncStatus(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """For changing or to initiate the resync to key-vault set the status to KeyVaultSyncPending, rest + of the status will not be applicable. + """ + + KEY_VAULT_SYNCED = "KeyVaultSynced" + KEY_VAULT_SYNC_FAILED = "KeyVaultSyncFailed" + KEY_VAULT_NOT_CONFIGURED = "KeyVaultNotConfigured" + KEY_VAULT_SYNC_PENDING = "KeyVaultSyncPending" + KEY_VAULT_SYNCING = "KeyVaultSyncing" + KEY_VAULT_NOT_SYNCED = "KeyVaultNotSynced" + +class KubernetesNodeType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Node type - Master/Worker + """ + + INVALID = "Invalid" + MASTER = "Master" + WORKER = "Worker" + +class KubernetesState(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """State of Kubernetes deployment + """ + + INVALID = "Invalid" + CREATING = "Creating" + CREATED = "Created" + UPDATING = "Updating" + RECONFIGURING = "Reconfiguring" + FAILED = "Failed" + DELETING = "Deleting" + +class MetricAggregationType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Metric aggregation type. + """ + + NOT_SPECIFIED = "NotSpecified" + NONE = "None" + AVERAGE = "Average" + MINIMUM = "Minimum" + MAXIMUM = "Maximum" + TOTAL = "Total" + COUNT = "Count" + +class MetricCategory(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Metric category. + """ + + CAPACITY = "Capacity" + TRANSACTION = "Transaction" + +class MetricUnit(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Metric units. + """ + + NOT_SPECIFIED = "NotSpecified" + PERCENT = "Percent" + COUNT = "Count" + SECONDS = "Seconds" + MILLISECONDS = "Milliseconds" + BYTES = "Bytes" + BYTES_PER_SECOND = "BytesPerSecond" + COUNT_PER_SECOND = "CountPerSecond" + +class MonitoringStatus(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Current monitoring status of the share. + """ + + ENABLED = "Enabled" + DISABLED = "Disabled" + +class MountType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Mounting type. + """ + + VOLUME = "Volume" + HOST_PATH = "HostPath" + +class MsiIdentityType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Identity type + """ + + NONE = "None" + SYSTEM_ASSIGNED = "SystemAssigned" + USER_ASSIGNED = "UserAssigned" + +class NetworkAdapterDhcpStatus(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Value indicating whether this adapter has DHCP enabled. + """ + + DISABLED = "Disabled" + ENABLED = "Enabled" + +class NetworkAdapterRdmaStatus(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Value indicating whether this adapter is RDMA capable. + """ + + INCAPABLE = "Incapable" + CAPABLE = "Capable" + +class NetworkAdapterStatus(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Value indicating whether this adapter is valid. + """ + + INACTIVE = "Inactive" + ACTIVE = "Active" + +class NetworkGroup(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """The network group. + """ + + NONE = "None" + NON_RDMA = "NonRDMA" + RDMA = "RDMA" + +class NodeStatus(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """The current status of the individual node + """ + + UNKNOWN = "Unknown" + UP = "Up" + DOWN = "Down" + REBOOTING = "Rebooting" + SHUTTING_DOWN = "ShuttingDown" + +class OrderState(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Status of the order as per the allowed status types. + """ + + UNTRACKED = "Untracked" + AWAITING_FULFILLMENT = "AwaitingFulfillment" + AWAITING_PREPARATION = "AwaitingPreparation" + AWAITING_SHIPMENT = "AwaitingShipment" + SHIPPED = "Shipped" + ARRIVING = "Arriving" + DELIVERED = "Delivered" + REPLACEMENT_REQUESTED = "ReplacementRequested" + LOST_DEVICE = "LostDevice" + DECLINED = "Declined" + RETURN_INITIATED = "ReturnInitiated" + AWAITING_RETURN_SHIPMENT = "AwaitingReturnShipment" + SHIPPED_BACK = "ShippedBack" + COLLECTED_AT_MICROSOFT = "CollectedAtMicrosoft" + AWAITING_PICKUP = "AwaitingPickup" + PICKUP_COMPLETED = "PickupCompleted" + AWAITING_DROP = "AwaitingDrop" + +class PlatformType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Host OS supported by the Arc addon. + """ + + WINDOWS = "Windows" + LINUX = "Linux" + +class PosixComplianceStatus(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """If provisioned storage is posix compliant. + """ + + INVALID = "Invalid" + ENABLED = "Enabled" + DISABLED = "Disabled" + +class ProactiveDiagnosticsConsent(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Proactive diagnostic collection consent flag + """ + + ENABLED = "Enabled" + DISABLED = "Disabled" + +class RemoteApplicationType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Remote application type + """ + + POWERSHELL = "Powershell" + WAC = "WAC" + LOCAL_UI = "LocalUI" + ALL_APPLICATIONS = "AllApplications" + +class ResourceMoveStatus(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Denotes whether move operation is in progress + """ + + NONE = "None" + RESOURCE_MOVE_IN_PROGRESS = "ResourceMoveInProgress" + RESOURCE_MOVE_FAILED = "ResourceMoveFailed" + +class RoleStatus(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Local Edge Management Status + """ + + ENABLED = "Enabled" + DISABLED = "Disabled" + +class RoleTypes(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + + IOT = "IOT" + ASA = "ASA" + FUNCTIONS = "Functions" + COGNITIVE = "Cognitive" + MEC = "MEC" + CLOUD_EDGE_MANAGEMENT = "CloudEdgeManagement" + KUBERNETES = "Kubernetes" + +class ShareAccessProtocol(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Access protocol to be used by the share. + """ + + SMB = "SMB" + NFS = "NFS" + +class ShareAccessType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Type of access to be allowed on the share for this user. + """ + + CHANGE = "Change" + READ = "Read" + CUSTOM = "Custom" + +class ShareStatus(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Current status of the share. + """ + + OFFLINE = "Offline" + UNKNOWN = "Unknown" + OK = "OK" + UPDATING = "Updating" + NEEDS_ATTENTION = "NeedsAttention" + +class ShipmentType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + + NOT_APPLICABLE = "NotApplicable" + SHIPPED_TO_CUSTOMER = "ShippedToCustomer" + SELF_PICKUP = "SelfPickup" + +class SkuAvailability(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Links to the next set of results + """ + + AVAILABLE = "Available" + UNAVAILABLE = "Unavailable" + +class SkuName(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """The Sku name. + """ + + GATEWAY = "Gateway" + EDGE = "Edge" + TEA1_NODE = "TEA_1Node" + TEA1_NODE_UPS = "TEA_1Node_UPS" + TEA1_NODE_HEATER = "TEA_1Node_Heater" + TEA1_NODE_UPS_HEATER = "TEA_1Node_UPS_Heater" + TEA4_NODE_HEATER = "TEA_4Node_Heater" + TEA4_NODE_UPS_HEATER = "TEA_4Node_UPS_Heater" + TMA = "TMA" + TDC = "TDC" + TCA_SMALL = "TCA_Small" + GPU = "GPU" + TCA_LARGE = "TCA_Large" + EDGE_P_BASE = "EdgeP_Base" + EDGE_P_HIGH = "EdgeP_High" + EDGE_PR_BASE = "EdgePR_Base" + EDGE_PR_BASE_UPS = "EdgePR_Base_UPS" + EP2_64_1_VPU_W = "EP2_64_1VPU_W" + EP2_128_1_T4_MX1_W = "EP2_128_1T4_Mx1_W" + EP2_256_2_T4_W = "EP2_256_2T4_W" + EDGE_MR_MINI = "EdgeMR_Mini" + RCA_SMALL = "RCA_Small" + RCA_LARGE = "RCA_Large" + RDC = "RDC" + MANAGEMENT = "Management" + +class SkuSignupOption(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Sku can be signed up by customer or not. + """ + + NONE = "None" + AVAILABLE = "Available" + +class SkuTier(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """The Sku tier. + """ + + STANDARD = "Standard" + +class SkuVersion(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Availability of the Sku as preview/stable. + """ + + STABLE = "Stable" + PREVIEW = "Preview" + +class SslStatus(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Signifies whether SSL needs to be enabled or not. + """ + + ENABLED = "Enabled" + DISABLED = "Disabled" + +class StorageAccountStatus(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Current status of the storage account + """ + + OK = "OK" + OFFLINE = "Offline" + UNKNOWN = "Unknown" + UPDATING = "Updating" + NEEDS_ATTENTION = "NeedsAttention" + +class SubscriptionState(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + + REGISTERED = "Registered" + WARNED = "Warned" + SUSPENDED = "Suspended" + DELETED = "Deleted" + UNREGISTERED = "Unregistered" + +class TimeGrain(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + + PT1_M = "PT1M" + PT5_M = "PT5M" + PT15_M = "PT15M" + PT30_M = "PT30M" + PT1_H = "PT1H" + PT6_H = "PT6H" + PT12_H = "PT12H" + PT1_D = "PT1D" + +class TriggerEventType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Trigger Kind. + """ + + FILE_EVENT = "FileEvent" + PERIODIC_TIMER_EVENT = "PeriodicTimerEvent" + +class UpdateOperation(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """The current update operation. + """ + + NONE = "None" + SCAN = "Scan" + DOWNLOAD = "Download" + INSTALL = "Install" + +class UpdateOperationStage(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Current stage of the update operation. + """ + + UNKNOWN = "Unknown" + INITIAL = "Initial" + SCAN_STARTED = "ScanStarted" + SCAN_COMPLETE = "ScanComplete" + SCAN_FAILED = "ScanFailed" + DOWNLOAD_STARTED = "DownloadStarted" + DOWNLOAD_COMPLETE = "DownloadComplete" + DOWNLOAD_FAILED = "DownloadFailed" + INSTALL_STARTED = "InstallStarted" + INSTALL_COMPLETE = "InstallComplete" + INSTALL_FAILED = "InstallFailed" + REBOOT_INITIATED = "RebootInitiated" + SUCCESS = "Success" + FAILURE = "Failure" + RESCAN_STARTED = "RescanStarted" + RESCAN_COMPLETE = "RescanComplete" + RESCAN_FAILED = "RescanFailed" + +class UpdateStatus(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Status of the update. + """ + + DOWNLOAD_PENDING = "DownloadPending" + DOWNLOAD_STARTED = "DownloadStarted" + DOWNLOAD_COMPLETED = "DownloadCompleted" + INSTALL_STARTED = "InstallStarted" + INSTALL_COMPLETED = "InstallCompleted" + +class UpdateType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Type of the Update + """ + + SOFTWARE = "Software" + KUBERNETES = "Kubernetes" + FIRMWARE = "Firmware" + +class UserType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Type of the user. + """ + + SHARE = "Share" + LOCAL_MANAGEMENT = "LocalManagement" + ARM = "ARM" diff --git a/src/databoxedge/azext_databoxedge/vendored_sdks/databoxedge/models/_models.py b/src/databoxedge/azext_databoxedge/vendored_sdks/databoxedge/models/_models.py new file mode 100644 index 00000000000..aeb8f81c351 --- /dev/null +++ b/src/databoxedge/azext_databoxedge/vendored_sdks/databoxedge/models/_models.py @@ -0,0 +1,5381 @@ +# 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 msrest.serialization + + +class ArmBaseModel(msrest.serialization.Model): + """Represents the base class for all object models. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: The path ID that uniquely identifies the object. + :vartype id: str + :ivar name: The object name. + :vartype name: str + :ivar type: The hierarchical type of the object. + :vartype type: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ArmBaseModel, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None + + +class Addon(ArmBaseModel): + """Role Addon. + + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: ArcAddon, IoTAddon. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: The path ID that uniquely identifies the object. + :vartype id: str + :ivar name: The object name. + :vartype name: str + :ivar type: The hierarchical type of the object. + :vartype type: str + :param kind: Required. Addon type.Constant filled by server. Possible values include: + "IotEdge", "ArcForKubernetes". + :type kind: str or ~data_box_edge_management_client.models.AddonType + :ivar system_data: Addon type. + :vartype system_data: ~data_box_edge_management_client.models.SystemData + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'kind': {'required': True}, + 'system_data': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + } + + _subtype_map = { + 'kind': {'ArcForKubernetes': 'ArcAddon', 'IotEdge': 'IoTAddon'} + } + + def __init__( + self, + **kwargs + ): + super(Addon, self).__init__(**kwargs) + self.kind = 'Addon' # type: str + self.system_data = None + + +class AddonList(msrest.serialization.Model): + """Collection of all the Role addon on the Azure Stack Edge device. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar value: The Value. + :vartype value: list[~data_box_edge_management_client.models.Addon] + :ivar next_link: Link to the next set of results. + :vartype next_link: str + """ + + _validation = { + 'value': {'readonly': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[Addon]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(AddonList, self).__init__(**kwargs) + self.value = None + self.next_link = None + + +class Address(msrest.serialization.Model): + """The shipping address of the customer. + + All required parameters must be populated in order to send to Azure. + + :param address_line1: The address line1. + :type address_line1: str + :param address_line2: The address line2. + :type address_line2: str + :param address_line3: The address line3. + :type address_line3: str + :param postal_code: The postal code. + :type postal_code: str + :param city: The city name. + :type city: str + :param state: The state name. + :type state: str + :param country: Required. The country name. + :type country: str + """ + + _validation = { + 'country': {'required': True}, + } + + _attribute_map = { + 'address_line1': {'key': 'addressLine1', 'type': 'str'}, + 'address_line2': {'key': 'addressLine2', 'type': 'str'}, + 'address_line3': {'key': 'addressLine3', 'type': 'str'}, + 'postal_code': {'key': 'postalCode', 'type': 'str'}, + 'city': {'key': 'city', 'type': 'str'}, + 'state': {'key': 'state', 'type': 'str'}, + 'country': {'key': 'country', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(Address, self).__init__(**kwargs) + self.address_line1 = kwargs.get('address_line1', None) + self.address_line2 = kwargs.get('address_line2', None) + self.address_line3 = kwargs.get('address_line3', None) + self.postal_code = kwargs.get('postal_code', None) + self.city = kwargs.get('city', None) + self.state = kwargs.get('state', None) + self.country = kwargs['country'] + + +class Alert(ArmBaseModel): + """Alert on the data box edge/gateway device. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: The path ID that uniquely identifies the object. + :vartype id: str + :ivar name: The object name. + :vartype name: str + :ivar type: The hierarchical type of the object. + :vartype type: str + :ivar system_data: Alert generated in the resource. + :vartype system_data: ~data_box_edge_management_client.models.SystemData + :ivar title: Alert title. + :vartype title: str + :ivar alert_type: Alert type. + :vartype alert_type: str + :ivar appeared_at_date_time: UTC time when the alert appeared. + :vartype appeared_at_date_time: ~datetime.datetime + :ivar recommendation: Alert recommendation. + :vartype recommendation: str + :ivar severity: Severity of the alert. Possible values include: "Informational", "Warning", + "Critical". + :vartype severity: str or ~data_box_edge_management_client.models.AlertSeverity + :ivar error_details: Error details of the alert. + :vartype error_details: ~data_box_edge_management_client.models.AlertErrorDetails + :ivar detailed_information: Alert details. + :vartype detailed_information: dict[str, str] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'system_data': {'readonly': True}, + 'title': {'readonly': True}, + 'alert_type': {'readonly': True}, + 'appeared_at_date_time': {'readonly': True}, + 'recommendation': {'readonly': True}, + 'severity': {'readonly': True}, + 'error_details': {'readonly': True}, + 'detailed_information': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'title': {'key': 'properties.title', 'type': 'str'}, + 'alert_type': {'key': 'properties.alertType', 'type': 'str'}, + 'appeared_at_date_time': {'key': 'properties.appearedAtDateTime', 'type': 'iso-8601'}, + 'recommendation': {'key': 'properties.recommendation', 'type': 'str'}, + 'severity': {'key': 'properties.severity', 'type': 'str'}, + 'error_details': {'key': 'properties.errorDetails', 'type': 'AlertErrorDetails'}, + 'detailed_information': {'key': 'properties.detailedInformation', 'type': '{str}'}, + } + + def __init__( + self, + **kwargs + ): + super(Alert, self).__init__(**kwargs) + self.system_data = None + self.title = None + self.alert_type = None + self.appeared_at_date_time = None + self.recommendation = None + self.severity = None + self.error_details = None + self.detailed_information = None + + +class AlertErrorDetails(msrest.serialization.Model): + """Error details for the alert. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar error_code: Error code. + :vartype error_code: str + :ivar error_message: Error Message. + :vartype error_message: str + :ivar occurrences: Number of occurrences. + :vartype occurrences: int + """ + + _validation = { + 'error_code': {'readonly': True}, + 'error_message': {'readonly': True}, + 'occurrences': {'readonly': True}, + } + + _attribute_map = { + 'error_code': {'key': 'errorCode', 'type': 'str'}, + 'error_message': {'key': 'errorMessage', 'type': 'str'}, + 'occurrences': {'key': 'occurrences', 'type': 'int'}, + } + + def __init__( + self, + **kwargs + ): + super(AlertErrorDetails, self).__init__(**kwargs) + self.error_code = None + self.error_message = None + self.occurrences = None + + +class AlertList(msrest.serialization.Model): + """Collection of alerts. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar value: The value. + :vartype value: list[~data_box_edge_management_client.models.Alert] + :ivar next_link: Link to the next set of results. + :vartype next_link: str + """ + + _validation = { + 'value': {'readonly': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[Alert]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(AlertList, self).__init__(**kwargs) + self.value = None + self.next_link = None + + +class ArcAddon(Addon): + """Arc Addon. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: The path ID that uniquely identifies the object. + :vartype id: str + :ivar name: The object name. + :vartype name: str + :ivar type: The hierarchical type of the object. + :vartype type: str + :param kind: Required. Addon type.Constant filled by server. Possible values include: + "IotEdge", "ArcForKubernetes". + :type kind: str or ~data_box_edge_management_client.models.AddonType + :ivar system_data: Addon type. + :vartype system_data: ~data_box_edge_management_client.models.SystemData + :param subscription_id: Required. Arc resource subscription Id. + :type subscription_id: str + :param resource_group_name: Required. Arc resource group name. + :type resource_group_name: str + :param resource_name: Required. Arc resource Name. + :type resource_name: str + :param resource_location: Required. Arc resource location. + :type resource_location: str + :ivar version: Arc resource version. + :vartype version: str + :ivar host_platform: Host OS supported by the Arc addon. Possible values include: "Windows", + "Linux". + :vartype host_platform: str or ~data_box_edge_management_client.models.PlatformType + :ivar host_platform_type: Platform where the runtime is hosted. Possible values include: + "KubernetesCluster", "LinuxVM". + :vartype host_platform_type: str or ~data_box_edge_management_client.models.HostPlatformType + :ivar provisioning_state: Addon Provisioning State. Possible values include: "Invalid", + "Creating", "Created", "Updating", "Reconfiguring", "Failed", "Deleting". + :vartype provisioning_state: str or ~data_box_edge_management_client.models.AddonState + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'kind': {'required': True}, + 'system_data': {'readonly': True}, + 'subscription_id': {'required': True}, + 'resource_group_name': {'required': True}, + 'resource_name': {'required': True}, + 'resource_location': {'required': True}, + 'version': {'readonly': True}, + 'host_platform': {'readonly': True}, + 'host_platform_type': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'subscription_id': {'key': 'properties.subscriptionId', 'type': 'str'}, + 'resource_group_name': {'key': 'properties.resourceGroupName', 'type': 'str'}, + 'resource_name': {'key': 'properties.resourceName', 'type': 'str'}, + 'resource_location': {'key': 'properties.resourceLocation', 'type': 'str'}, + 'version': {'key': 'properties.version', 'type': 'str'}, + 'host_platform': {'key': 'properties.hostPlatform', 'type': 'str'}, + 'host_platform_type': {'key': 'properties.hostPlatformType', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ArcAddon, self).__init__(**kwargs) + self.kind = 'ArcForKubernetes' # type: str + self.subscription_id = kwargs['subscription_id'] + self.resource_group_name = kwargs['resource_group_name'] + self.resource_name = kwargs['resource_name'] + self.resource_location = kwargs['resource_location'] + self.version = None + self.host_platform = None + self.host_platform_type = None + self.provisioning_state = None + + +class AsymmetricEncryptedSecret(msrest.serialization.Model): + """Represent the secrets intended for encryption with asymmetric key pair. + + All required parameters must be populated in order to send to Azure. + + :param value: Required. The value of the secret. + :type value: str + :param encryption_cert_thumbprint: Thumbprint certificate used to encrypt \"Value\". If the + value is unencrypted, it will be null. + :type encryption_cert_thumbprint: str + :param encryption_algorithm: Required. The algorithm used to encrypt "Value". Possible values + include: "None", "AES256", "RSAES_PKCS1_v_1_5". + :type encryption_algorithm: str or ~data_box_edge_management_client.models.EncryptionAlgorithm + """ + + _validation = { + 'value': {'required': True}, + 'encryption_algorithm': {'required': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': 'str'}, + 'encryption_cert_thumbprint': {'key': 'encryptionCertThumbprint', 'type': 'str'}, + 'encryption_algorithm': {'key': 'encryptionAlgorithm', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(AsymmetricEncryptedSecret, self).__init__(**kwargs) + self.value = kwargs['value'] + self.encryption_cert_thumbprint = kwargs.get('encryption_cert_thumbprint', None) + self.encryption_algorithm = kwargs['encryption_algorithm'] + + +class Authentication(msrest.serialization.Model): + """Authentication mechanism for IoT devices. + + :param symmetric_key: Symmetric key for authentication. + :type symmetric_key: ~data_box_edge_management_client.models.SymmetricKey + """ + + _attribute_map = { + 'symmetric_key': {'key': 'symmetricKey', 'type': 'SymmetricKey'}, + } + + def __init__( + self, + **kwargs + ): + super(Authentication, self).__init__(**kwargs) + self.symmetric_key = kwargs.get('symmetric_key', None) + + +class AzureContainerInfo(msrest.serialization.Model): + """Azure container mapping of the endpoint. + + All required parameters must be populated in order to send to Azure. + + :param storage_account_credential_id: Required. ID of the storage account credential used to + access storage. + :type storage_account_credential_id: str + :param container_name: Required. Container name (Based on the data format specified, this + represents the name of Azure Files/Page blob/Block blob). + :type container_name: str + :param data_format: Required. Storage format used for the file represented by the share. + Possible values include: "BlockBlob", "PageBlob", "AzureFile". + :type data_format: str or ~data_box_edge_management_client.models.AzureContainerDataFormat + """ + + _validation = { + 'storage_account_credential_id': {'required': True}, + 'container_name': {'required': True}, + 'data_format': {'required': True}, + } + + _attribute_map = { + 'storage_account_credential_id': {'key': 'storageAccountCredentialId', 'type': 'str'}, + 'container_name': {'key': 'containerName', 'type': 'str'}, + 'data_format': {'key': 'dataFormat', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(AzureContainerInfo, self).__init__(**kwargs) + self.storage_account_credential_id = kwargs['storage_account_credential_id'] + self.container_name = kwargs['container_name'] + self.data_format = kwargs['data_format'] + + +class BandwidthSchedule(ArmBaseModel): + """The bandwidth schedule details. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: The path ID that uniquely identifies the object. + :vartype id: str + :ivar name: The object name. + :vartype name: str + :ivar type: The hierarchical type of the object. + :vartype type: str + :ivar system_data: Bandwidth object related to ASE resource. + :vartype system_data: ~data_box_edge_management_client.models.SystemData + :param start: Required. The start time of the schedule in UTC. + :type start: str + :param stop: Required. The stop time of the schedule in UTC. + :type stop: str + :param rate_in_mbps: Required. The bandwidth rate in Mbps. + :type rate_in_mbps: int + :param days: Required. The days of the week when this schedule is applicable. + :type days: list[str or ~data_box_edge_management_client.models.DayOfWeek] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'system_data': {'readonly': True}, + 'start': {'required': True}, + 'stop': {'required': True}, + 'rate_in_mbps': {'required': True}, + 'days': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'start': {'key': 'properties.start', 'type': 'str'}, + 'stop': {'key': 'properties.stop', 'type': 'str'}, + 'rate_in_mbps': {'key': 'properties.rateInMbps', 'type': 'int'}, + 'days': {'key': 'properties.days', 'type': '[str]'}, + } + + def __init__( + self, + **kwargs + ): + super(BandwidthSchedule, self).__init__(**kwargs) + self.system_data = None + self.start = kwargs['start'] + self.stop = kwargs['stop'] + self.rate_in_mbps = kwargs['rate_in_mbps'] + self.days = kwargs['days'] + + +class BandwidthSchedulesList(msrest.serialization.Model): + """The collection of bandwidth schedules. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar value: The list of bandwidth schedules. + :vartype value: list[~data_box_edge_management_client.models.BandwidthSchedule] + :ivar next_link: Link to the next set of results. + :vartype next_link: str + """ + + _validation = { + 'value': {'readonly': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[BandwidthSchedule]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(BandwidthSchedulesList, self).__init__(**kwargs) + self.value = None + self.next_link = None + + +class ClientAccessRight(msrest.serialization.Model): + """The mapping between a particular client IP and the type of access client has on the NFS share. + + All required parameters must be populated in order to send to Azure. + + :param client: Required. IP of the client. + :type client: str + :param access_permission: Required. Type of access to be allowed for the client. Possible + values include: "NoAccess", "ReadOnly", "ReadWrite". + :type access_permission: str or ~data_box_edge_management_client.models.ClientPermissionType + """ + + _validation = { + 'client': {'required': True}, + 'access_permission': {'required': True}, + } + + _attribute_map = { + 'client': {'key': 'client', 'type': 'str'}, + 'access_permission': {'key': 'accessPermission', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ClientAccessRight, self).__init__(**kwargs) + self.client = kwargs['client'] + self.access_permission = kwargs['access_permission'] + + +class Role(ArmBaseModel): + """Compute role. + + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: CloudEdgeManagementRole, IoTRole, KubernetesRole, MecRole. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: The path ID that uniquely identifies the object. + :vartype id: str + :ivar name: The object name. + :vartype name: str + :ivar type: The hierarchical type of the object. + :vartype type: str + :param kind: Required. Role type.Constant filled by server. Possible values include: "IOT", + "ASA", "Functions", "Cognitive", "MEC", "CloudEdgeManagement", "Kubernetes". + :type kind: str or ~data_box_edge_management_client.models.RoleTypes + :ivar system_data: Role configured on ASE resource. + :vartype system_data: ~data_box_edge_management_client.models.SystemData + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'kind': {'required': True}, + 'system_data': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + } + + _subtype_map = { + 'kind': {'CloudEdgeManagement': 'CloudEdgeManagementRole', 'IOT': 'IoTRole', 'Kubernetes': 'KubernetesRole', 'MEC': 'MecRole'} + } + + def __init__( + self, + **kwargs + ): + super(Role, self).__init__(**kwargs) + self.kind = 'Role' # type: str + self.system_data = None + + +class CloudEdgeManagementRole(Role): + """CloudEdgeManagementRole role, Currently It's in Private Preview. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: The path ID that uniquely identifies the object. + :vartype id: str + :ivar name: The object name. + :vartype name: str + :ivar type: The hierarchical type of the object. + :vartype type: str + :param kind: Required. Role type.Constant filled by server. Possible values include: "IOT", + "ASA", "Functions", "Cognitive", "MEC", "CloudEdgeManagement", "Kubernetes". + :type kind: str or ~data_box_edge_management_client.models.RoleTypes + :ivar system_data: Role configured on ASE resource. + :vartype system_data: ~data_box_edge_management_client.models.SystemData + :ivar local_management_status: Local Edge Management Status. Possible values include: + "Enabled", "Disabled". + :vartype local_management_status: str or ~data_box_edge_management_client.models.RoleStatus + :ivar edge_profile: Edge Profile of the resource. + :vartype edge_profile: ~data_box_edge_management_client.models.EdgeProfile + :param role_status: Role status. Possible values include: "Enabled", "Disabled". + :type role_status: str or ~data_box_edge_management_client.models.RoleStatus + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'kind': {'required': True}, + 'system_data': {'readonly': True}, + 'local_management_status': {'readonly': True}, + 'edge_profile': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'local_management_status': {'key': 'properties.localManagementStatus', 'type': 'str'}, + 'edge_profile': {'key': 'properties.edgeProfile', 'type': 'EdgeProfile'}, + 'role_status': {'key': 'properties.roleStatus', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(CloudEdgeManagementRole, self).__init__(**kwargs) + self.kind = 'CloudEdgeManagement' # type: str + self.local_management_status = None + self.edge_profile = None + self.role_status = kwargs.get('role_status', None) + + +class CloudErrorBody(msrest.serialization.Model): + """An error response from the service. + + :param code: An identifier for the error. Codes are invariant and are intended to be consumed + programmatically. + :type code: str + :param message: A message describing the error, intended to be suitable for display in a user + interface. + :type message: str + :param details: A list of additional details about the error. + :type details: list[~data_box_edge_management_client.models.CloudErrorBody] + """ + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + 'details': {'key': 'details', 'type': '[CloudErrorBody]'}, + } + + def __init__( + self, + **kwargs + ): + super(CloudErrorBody, self).__init__(**kwargs) + self.code = kwargs.get('code', None) + self.message = kwargs.get('message', None) + self.details = kwargs.get('details', None) + + +class CniConfig(msrest.serialization.Model): + """Cni configuration. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar type: Cni type. + :vartype type: str + :ivar version: Cni version. + :vartype version: str + :ivar pod_subnet: Pod Subnet. + :vartype pod_subnet: str + :ivar service_subnet: Service subnet. + :vartype service_subnet: str + """ + + _validation = { + 'type': {'readonly': True}, + 'version': {'readonly': True}, + 'pod_subnet': {'readonly': True}, + 'service_subnet': {'readonly': True}, + } + + _attribute_map = { + 'type': {'key': 'type', 'type': 'str'}, + 'version': {'key': 'version', 'type': 'str'}, + 'pod_subnet': {'key': 'podSubnet', 'type': 'str'}, + 'service_subnet': {'key': 'serviceSubnet', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(CniConfig, self).__init__(**kwargs) + self.type = None + self.version = None + self.pod_subnet = None + self.service_subnet = None + + +class ComputeResource(msrest.serialization.Model): + """Compute infrastructure Resource. + + All required parameters must be populated in order to send to Azure. + + :param processor_count: Required. Processor count. + :type processor_count: int + :param memory_in_gb: Required. Memory in GB. + :type memory_in_gb: long + """ + + _validation = { + 'processor_count': {'required': True}, + 'memory_in_gb': {'required': True}, + } + + _attribute_map = { + 'processor_count': {'key': 'processorCount', 'type': 'int'}, + 'memory_in_gb': {'key': 'memoryInGB', 'type': 'long'}, + } + + def __init__( + self, + **kwargs + ): + super(ComputeResource, self).__init__(**kwargs) + self.processor_count = kwargs['processor_count'] + self.memory_in_gb = kwargs['memory_in_gb'] + + +class ContactDetails(msrest.serialization.Model): + """Contains all the contact details of the customer. + + All required parameters must be populated in order to send to Azure. + + :param contact_person: Required. The contact person name. + :type contact_person: str + :param company_name: Required. The name of the company. + :type company_name: str + :param phone: Required. The phone number. + :type phone: str + :param email_list: Required. The email list. + :type email_list: list[str] + """ + + _validation = { + 'contact_person': {'required': True}, + 'company_name': {'required': True}, + 'phone': {'required': True}, + 'email_list': {'required': True}, + } + + _attribute_map = { + 'contact_person': {'key': 'contactPerson', 'type': 'str'}, + 'company_name': {'key': 'companyName', 'type': 'str'}, + 'phone': {'key': 'phone', 'type': 'str'}, + 'email_list': {'key': 'emailList', 'type': '[str]'}, + } + + def __init__( + self, + **kwargs + ): + super(ContactDetails, self).__init__(**kwargs) + self.contact_person = kwargs['contact_person'] + self.company_name = kwargs['company_name'] + self.phone = kwargs['phone'] + self.email_list = kwargs['email_list'] + + +class Container(ArmBaseModel): + """Represents a container on the Data Box Edge/Gateway device. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: The path ID that uniquely identifies the object. + :vartype id: str + :ivar name: The object name. + :vartype name: str + :ivar type: The hierarchical type of the object. + :vartype type: str + :ivar system_data: Container in DataBoxEdge Resource. + :vartype system_data: ~data_box_edge_management_client.models.SystemData + :ivar container_status: Current status of the container. Possible values include: "OK", + "Offline", "Unknown", "Updating", "NeedsAttention". + :vartype container_status: str or ~data_box_edge_management_client.models.ContainerStatus + :param data_format: Required. DataFormat for Container. Possible values include: "BlockBlob", + "PageBlob", "AzureFile". + :type data_format: str or ~data_box_edge_management_client.models.AzureContainerDataFormat + :ivar refresh_details: Details of the refresh job on this container. + :vartype refresh_details: ~data_box_edge_management_client.models.RefreshDetails + :ivar created_date_time: The UTC time when container got created. + :vartype created_date_time: ~datetime.datetime + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'system_data': {'readonly': True}, + 'container_status': {'readonly': True}, + 'data_format': {'required': True}, + 'refresh_details': {'readonly': True}, + 'created_date_time': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'container_status': {'key': 'properties.containerStatus', 'type': 'str'}, + 'data_format': {'key': 'properties.dataFormat', 'type': 'str'}, + 'refresh_details': {'key': 'properties.refreshDetails', 'type': 'RefreshDetails'}, + 'created_date_time': {'key': 'properties.createdDateTime', 'type': 'iso-8601'}, + } + + def __init__( + self, + **kwargs + ): + super(Container, self).__init__(**kwargs) + self.system_data = None + self.container_status = None + self.data_format = kwargs['data_format'] + self.refresh_details = None + self.created_date_time = None + + +class ContainerList(msrest.serialization.Model): + """Collection of all the containers on the Data Box Edge/Gateway device. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar value: The list of containers. + :vartype value: list[~data_box_edge_management_client.models.Container] + :ivar next_link: Link to the next set of results. + :vartype next_link: str + """ + + _validation = { + 'value': {'readonly': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[Container]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ContainerList, self).__init__(**kwargs) + self.value = None + self.next_link = None + + +class DataBoxEdgeDevice(ArmBaseModel): + """The Data Box Edge/Gateway device. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: The path ID that uniquely identifies the object. + :vartype id: str + :ivar name: The object name. + :vartype name: str + :ivar type: The hierarchical type of the object. + :vartype type: str + :param location: Required. 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. + :type location: str + :param tags: A set of tags. The list of tags that describe the device. These tags can be used + to view and group this device (across resource groups). + :type tags: dict[str, str] + :param sku: The SKU type. + :type sku: ~data_box_edge_management_client.models.Sku + :param etag: The etag for the devices. + :type etag: str + :param identity: Msi identity of the resource. + :type identity: ~data_box_edge_management_client.models.ResourceIdentity + :param kind: The kind of the device. Possible values include: "AzureDataBoxGateway", + "AzureStackEdge", "AzureStackHub", "AzureModularDataCentre". + :type kind: str or ~data_box_edge_management_client.models.DataBoxEdgeDeviceKind + :ivar system_data: DataBoxEdge Resource. + :vartype system_data: ~data_box_edge_management_client.models.SystemData + :ivar system_data_properties_system_data: DataBoxEdge Device Properties. + :vartype system_data_properties_system_data: ~data_box_edge_management_client.models.SystemData + :param data_box_edge_device_status: The status of the Data Box Edge/Gateway device. Possible + values include: "ReadyToSetup", "Online", "Offline", "NeedsAttention", "Disconnected", + "PartiallyDisconnected", "Maintenance". + :type data_box_edge_device_status: str or + ~data_box_edge_management_client.models.DataBoxEdgeDeviceStatus + :ivar serial_number: The Serial Number of Data Box Edge/Gateway device. + :vartype serial_number: str + :ivar description: The Description of the Data Box Edge/Gateway device. + :vartype description: str + :ivar model_description: The description of the Data Box Edge/Gateway device model. + :vartype model_description: str + :ivar device_type: The type of the Data Box Edge/Gateway device. Possible values include: + "DataBoxEdgeDevice". + :vartype device_type: str or ~data_box_edge_management_client.models.DeviceType + :ivar friendly_name: The Data Box Edge/Gateway device name. + :vartype friendly_name: str + :ivar culture: The Data Box Edge/Gateway device culture. + :vartype culture: str + :ivar device_model: The Data Box Edge/Gateway device model. + :vartype device_model: str + :ivar device_software_version: The Data Box Edge/Gateway device software version. + :vartype device_software_version: str + :ivar device_local_capacity: The Data Box Edge/Gateway device local capacity in MB. + :vartype device_local_capacity: long + :ivar time_zone: The Data Box Edge/Gateway device timezone. + :vartype time_zone: str + :ivar device_hcs_version: The device software version number of the device (eg: 1.2.18105.6). + :vartype device_hcs_version: str + :ivar configured_role_types: Type of compute roles configured. + :vartype configured_role_types: list[str or ~data_box_edge_management_client.models.RoleTypes] + :ivar node_count: The number of nodes in the cluster. + :vartype node_count: int + :ivar resource_move_details: The details of the move operation on this resource. + :vartype resource_move_details: ~data_box_edge_management_client.models.ResourceMoveDetails + :ivar edge_profile: The details of Edge Profile for this resource. + :vartype edge_profile: ~data_box_edge_management_client.models.EdgeProfile + :param data_residency: The details of data-residency related properties for this resource. + :type data_residency: ~data_box_edge_management_client.models.DataResidency + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': True}, + 'system_data': {'readonly': True}, + 'system_data_properties_system_data': {'readonly': True}, + 'serial_number': {'readonly': True}, + 'description': {'readonly': True}, + 'model_description': {'readonly': True}, + 'device_type': {'readonly': True}, + 'friendly_name': {'readonly': True}, + 'culture': {'readonly': True}, + 'device_model': {'readonly': True}, + 'device_software_version': {'readonly': True}, + 'device_local_capacity': {'readonly': True}, + 'time_zone': {'readonly': True}, + 'device_hcs_version': {'readonly': True}, + 'configured_role_types': {'readonly': True}, + 'node_count': {'readonly': True}, + 'resource_move_details': {'readonly': True}, + 'edge_profile': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'sku': {'key': 'sku', 'type': 'Sku'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'identity': {'key': 'identity', 'type': 'ResourceIdentity'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'system_data_properties_system_data': {'key': 'properties.systemData', 'type': 'SystemData'}, + 'data_box_edge_device_status': {'key': 'properties.dataBoxEdgeDeviceStatus', 'type': 'str'}, + 'serial_number': {'key': 'properties.serialNumber', 'type': 'str'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + 'model_description': {'key': 'properties.modelDescription', 'type': 'str'}, + 'device_type': {'key': 'properties.deviceType', 'type': 'str'}, + 'friendly_name': {'key': 'properties.friendlyName', 'type': 'str'}, + 'culture': {'key': 'properties.culture', 'type': 'str'}, + 'device_model': {'key': 'properties.deviceModel', 'type': 'str'}, + 'device_software_version': {'key': 'properties.deviceSoftwareVersion', 'type': 'str'}, + 'device_local_capacity': {'key': 'properties.deviceLocalCapacity', 'type': 'long'}, + 'time_zone': {'key': 'properties.timeZone', 'type': 'str'}, + 'device_hcs_version': {'key': 'properties.deviceHcsVersion', 'type': 'str'}, + 'configured_role_types': {'key': 'properties.configuredRoleTypes', 'type': '[str]'}, + 'node_count': {'key': 'properties.nodeCount', 'type': 'int'}, + 'resource_move_details': {'key': 'properties.resourceMoveDetails', 'type': 'ResourceMoveDetails'}, + 'edge_profile': {'key': 'properties.edgeProfile', 'type': 'EdgeProfile'}, + 'data_residency': {'key': 'properties.dataResidency', 'type': 'DataResidency'}, + } + + def __init__( + self, + **kwargs + ): + super(DataBoxEdgeDevice, self).__init__(**kwargs) + self.location = kwargs['location'] + self.tags = kwargs.get('tags', None) + self.sku = kwargs.get('sku', None) + self.etag = kwargs.get('etag', None) + self.identity = kwargs.get('identity', None) + self.kind = kwargs.get('kind', None) + self.system_data = None + self.system_data_properties_system_data = None + self.data_box_edge_device_status = kwargs.get('data_box_edge_device_status', None) + self.serial_number = None + self.description = None + self.model_description = None + self.device_type = None + self.friendly_name = None + self.culture = None + self.device_model = None + self.device_software_version = None + self.device_local_capacity = None + self.time_zone = None + self.device_hcs_version = None + self.configured_role_types = None + self.node_count = None + self.resource_move_details = None + self.edge_profile = None + self.data_residency = kwargs.get('data_residency', None) + + +class DataBoxEdgeDeviceExtendedInfo(ArmBaseModel): + """The extended Info of the Data Box Edge/Gateway device. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: The path ID that uniquely identifies the object. + :vartype id: str + :ivar name: The object name. + :vartype name: str + :ivar type: The hierarchical type of the object. + :vartype type: str + :param encryption_key_thumbprint: The digital signature of encrypted certificate. + :type encryption_key_thumbprint: str + :param encryption_key: The public part of the encryption certificate. Client uses this to + encrypt any secret. + :type encryption_key: str + :ivar resource_key: The Resource ID of the Resource. + :vartype resource_key: str + :param client_secret_store_id: The Key Vault ARM Id for client secrets. + :type client_secret_store_id: str + :param client_secret_store_url: The url to access the Client Key Vault. + :type client_secret_store_url: str + :param channel_integrity_key_name: The name of Channel Integrity Key stored in the Client Key + Vault. + :type channel_integrity_key_name: str + :param channel_integrity_key_version: The version of Channel Integrity Key stored in the Client + Key Vault. + :type channel_integrity_key_version: str + :param key_vault_sync_status: Key vault sync status. Possible values include: "KeyVaultSynced", + "KeyVaultSyncFailed", "KeyVaultNotConfigured", "KeyVaultSyncPending", "KeyVaultSyncing", + "KeyVaultNotSynced". + :type key_vault_sync_status: str or ~data_box_edge_management_client.models.KeyVaultSyncStatus + :ivar device_secrets: Device secrets, will be returned only with ODataFilter + $expand=deviceSecrets. + :vartype device_secrets: dict[str, ~data_box_edge_management_client.models.Secret] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'resource_key': {'readonly': True}, + 'device_secrets': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'encryption_key_thumbprint': {'key': 'properties.encryptionKeyThumbprint', 'type': 'str'}, + 'encryption_key': {'key': 'properties.encryptionKey', 'type': 'str'}, + 'resource_key': {'key': 'properties.resourceKey', 'type': 'str'}, + 'client_secret_store_id': {'key': 'properties.clientSecretStoreId', 'type': 'str'}, + 'client_secret_store_url': {'key': 'properties.clientSecretStoreUrl', 'type': 'str'}, + 'channel_integrity_key_name': {'key': 'properties.channelIntegrityKeyName', 'type': 'str'}, + 'channel_integrity_key_version': {'key': 'properties.channelIntegrityKeyVersion', 'type': 'str'}, + 'key_vault_sync_status': {'key': 'properties.keyVaultSyncStatus', 'type': 'str'}, + 'device_secrets': {'key': 'properties.deviceSecrets', 'type': '{Secret}'}, + } + + def __init__( + self, + **kwargs + ): + super(DataBoxEdgeDeviceExtendedInfo, self).__init__(**kwargs) + self.encryption_key_thumbprint = kwargs.get('encryption_key_thumbprint', None) + self.encryption_key = kwargs.get('encryption_key', None) + self.resource_key = None + self.client_secret_store_id = kwargs.get('client_secret_store_id', None) + self.client_secret_store_url = kwargs.get('client_secret_store_url', None) + self.channel_integrity_key_name = kwargs.get('channel_integrity_key_name', None) + self.channel_integrity_key_version = kwargs.get('channel_integrity_key_version', None) + self.key_vault_sync_status = kwargs.get('key_vault_sync_status', None) + self.device_secrets = None + + +class DataBoxEdgeDeviceExtendedInfoPatch(msrest.serialization.Model): + """The Data Box Edge/Gateway device extended info patch. + + :param client_secret_store_id: The Key Vault ARM Id for client secrets. + :type client_secret_store_id: str + :param client_secret_store_url: The url to access the Client Key Vault. + :type client_secret_store_url: str + :param channel_integrity_key_name: The name for Channel Integrity Key stored in the Client Key + Vault. + :type channel_integrity_key_name: str + :param channel_integrity_key_version: The version of Channel Integrity Key stored in the Client + Key Vault. + :type channel_integrity_key_version: str + :param sync_status: For changing or to initiate the resync to key-vault set the status to + KeyVaultSyncPending, rest of the status will not be applicable. Possible values include: + "KeyVaultSynced", "KeyVaultSyncFailed", "KeyVaultNotConfigured", "KeyVaultSyncPending", + "KeyVaultSyncing", "KeyVaultNotSynced". + :type sync_status: str or ~data_box_edge_management_client.models.KeyVaultSyncStatus + """ + + _attribute_map = { + 'client_secret_store_id': {'key': 'clientSecretStoreId', 'type': 'str'}, + 'client_secret_store_url': {'key': 'clientSecretStoreUrl', 'type': 'str'}, + 'channel_integrity_key_name': {'key': 'channelIntegrityKeyName', 'type': 'str'}, + 'channel_integrity_key_version': {'key': 'channelIntegrityKeyVersion', 'type': 'str'}, + 'sync_status': {'key': 'syncStatus', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(DataBoxEdgeDeviceExtendedInfoPatch, self).__init__(**kwargs) + self.client_secret_store_id = kwargs.get('client_secret_store_id', None) + self.client_secret_store_url = kwargs.get('client_secret_store_url', None) + self.channel_integrity_key_name = kwargs.get('channel_integrity_key_name', None) + self.channel_integrity_key_version = kwargs.get('channel_integrity_key_version', None) + self.sync_status = kwargs.get('sync_status', None) + + +class DataBoxEdgeDeviceList(msrest.serialization.Model): + """The collection of Data Box Edge/Gateway devices. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar value: The list of Data Box Edge/Gateway devices. + :vartype value: list[~data_box_edge_management_client.models.DataBoxEdgeDevice] + :ivar next_link: Link to the next set of results. + :vartype next_link: str + """ + + _validation = { + 'value': {'readonly': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[DataBoxEdgeDevice]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(DataBoxEdgeDeviceList, self).__init__(**kwargs) + self.value = None + self.next_link = None + + +class DataBoxEdgeDevicePatch(msrest.serialization.Model): + """The Data Box Edge/Gateway device patch. + + :param tags: A set of tags. The tags attached to the Data Box Edge/Gateway resource. + :type tags: dict[str, str] + :param identity: Msi identity of the resource. + :type identity: ~data_box_edge_management_client.models.ResourceIdentity + :param edge_profile: Edge Profile property of the Data Box Edge/Gateway device. + :type edge_profile: ~data_box_edge_management_client.models.EdgeProfilePatch + """ + + _attribute_map = { + 'tags': {'key': 'tags', 'type': '{str}'}, + 'identity': {'key': 'identity', 'type': 'ResourceIdentity'}, + 'edge_profile': {'key': 'properties.edgeProfile', 'type': 'EdgeProfilePatch'}, + } + + def __init__( + self, + **kwargs + ): + super(DataBoxEdgeDevicePatch, self).__init__(**kwargs) + self.tags = kwargs.get('tags', None) + self.identity = kwargs.get('identity', None) + self.edge_profile = kwargs.get('edge_profile', None) + + +class DataBoxEdgeMoveRequest(msrest.serialization.Model): + """Resource Move details. + + All required parameters must be populated in order to send to Azure. + + :param target_resource_group: Required. Target resource group ARMId. + :type target_resource_group: str + :param resources: Required. List of resources to be moved. + :type resources: list[str] + """ + + _validation = { + 'target_resource_group': {'required': True}, + 'resources': {'required': True}, + } + + _attribute_map = { + 'target_resource_group': {'key': 'targetResourceGroup', 'type': 'str'}, + 'resources': {'key': 'resources', 'type': '[str]'}, + } + + def __init__( + self, + **kwargs + ): + super(DataBoxEdgeMoveRequest, self).__init__(**kwargs) + self.target_resource_group = kwargs['target_resource_group'] + self.resources = kwargs['resources'] + + +class DataBoxEdgeSku(msrest.serialization.Model): + """The Sku information. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar resource_type: The type of the resource. + :vartype resource_type: str + :ivar name: The Sku name. Possible values include: "Gateway", "Edge", "TEA_1Node", + "TEA_1Node_UPS", "TEA_1Node_Heater", "TEA_1Node_UPS_Heater", "TEA_4Node_Heater", + "TEA_4Node_UPS_Heater", "TMA", "TDC", "TCA_Small", "GPU", "TCA_Large", "EdgeP_Base", + "EdgeP_High", "EdgePR_Base", "EdgePR_Base_UPS", "EP2_64_1VPU_W", "EP2_128_1T4_Mx1_W", + "EP2_256_2T4_W", "EdgeMR_Mini", "RCA_Small", "RCA_Large", "RDC", "Management". + :vartype name: str or ~data_box_edge_management_client.models.SkuName + :ivar kind: The Sku kind. + :vartype kind: str + :ivar tier: The Sku tier. Possible values include: "Standard". + :vartype tier: str or ~data_box_edge_management_client.models.SkuTier + :ivar size: The Sku kind. + :vartype size: str + :ivar family: The Sku family. + :vartype family: str + :ivar locations: Availability of the Sku for the region. + :vartype locations: list[str] + :ivar api_versions: The API versions in which Sku is available. + :vartype api_versions: list[str] + :ivar location_info: Availability of the Sku for the location/zone/site. + :vartype location_info: list[~data_box_edge_management_client.models.SkuLocationInfo] + :ivar costs: The pricing info of the Sku. + :vartype costs: list[~data_box_edge_management_client.models.SkuCost] + :ivar signup_option: Sku can be signed up by customer or not. Possible values include: "None", + "Available". + :vartype signup_option: str or ~data_box_edge_management_client.models.SkuSignupOption + :ivar version: Availability of the Sku as preview/stable. Possible values include: "Stable", + "Preview". + :vartype version: str or ~data_box_edge_management_client.models.SkuVersion + :ivar availability: Links to the next set of results. Possible values include: "Available", + "Unavailable". + :vartype availability: str or ~data_box_edge_management_client.models.SkuAvailability + :ivar shipment_types: List of Shipment Types supported by this SKU. + :vartype shipment_types: list[str or ~data_box_edge_management_client.models.ShipmentType] + :ivar capabilities: The capability info of the SKU. + :vartype capabilities: list[~data_box_edge_management_client.models.SkuCapability] + """ + + _validation = { + 'resource_type': {'readonly': True}, + 'name': {'readonly': True}, + 'kind': {'readonly': True}, + 'tier': {'readonly': True}, + 'size': {'readonly': True}, + 'family': {'readonly': True}, + 'locations': {'readonly': True}, + 'api_versions': {'readonly': True}, + 'location_info': {'readonly': True}, + 'costs': {'readonly': True}, + 'signup_option': {'readonly': True}, + 'version': {'readonly': True}, + 'availability': {'readonly': True}, + 'shipment_types': {'readonly': True}, + 'capabilities': {'readonly': True}, + } + + _attribute_map = { + 'resource_type': {'key': 'resourceType', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'tier': {'key': 'tier', 'type': 'str'}, + 'size': {'key': 'size', 'type': 'str'}, + 'family': {'key': 'family', 'type': 'str'}, + 'locations': {'key': 'locations', 'type': '[str]'}, + 'api_versions': {'key': 'apiVersions', 'type': '[str]'}, + 'location_info': {'key': 'locationInfo', 'type': '[SkuLocationInfo]'}, + 'costs': {'key': 'costs', 'type': '[SkuCost]'}, + 'signup_option': {'key': 'signupOption', 'type': 'str'}, + 'version': {'key': 'version', 'type': 'str'}, + 'availability': {'key': 'availability', 'type': 'str'}, + 'shipment_types': {'key': 'shipmentTypes', 'type': '[str]'}, + 'capabilities': {'key': 'capabilities', 'type': '[SkuCapability]'}, + } + + def __init__( + self, + **kwargs + ): + super(DataBoxEdgeSku, self).__init__(**kwargs) + self.resource_type = None + self.name = None + self.kind = None + self.tier = None + self.size = None + self.family = None + self.locations = None + self.api_versions = None + self.location_info = None + self.costs = None + self.signup_option = None + self.version = None + self.availability = None + self.shipment_types = None + self.capabilities = None + + +class DataBoxEdgeSkuList(msrest.serialization.Model): + """List of SKU Information objects. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar value: List of ResourceType Sku. + :vartype value: list[~data_box_edge_management_client.models.DataBoxEdgeSku] + :ivar next_link: Links to the next set of results. + :vartype next_link: str + """ + + _validation = { + 'value': {'readonly': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[DataBoxEdgeSku]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(DataBoxEdgeSkuList, self).__init__(**kwargs) + self.value = None + self.next_link = None + + +class DataResidency(msrest.serialization.Model): + """Wraps data-residency related information for edge-resource and this should be used with ARM layer. + + :param type: DataResidencyType enum. Possible values include: "GeoZoneReplication", + "ZoneReplication". + :type type: str or ~data_box_edge_management_client.models.DataResidencyType + """ + + _attribute_map = { + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(DataResidency, self).__init__(**kwargs) + self.type = kwargs.get('type', None) + + +class DcAccessCode(msrest.serialization.Model): + """DC Access code in the case of Self Managed Shipping. + + :param auth_code: DCAccess Code for the Self Managed shipment. + :type auth_code: str + """ + + _attribute_map = { + 'auth_code': {'key': 'properties.authCode', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(DcAccessCode, self).__init__(**kwargs) + self.auth_code = kwargs.get('auth_code', None) + + +class DiagnosticProactiveLogCollectionSettings(ArmBaseModel): + """The diagnostic proactive log collection settings of a device. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: The path ID that uniquely identifies the object. + :vartype id: str + :ivar name: The object name. + :vartype name: str + :ivar type: The hierarchical type of the object. + :vartype type: str + :ivar system_data: DiagnosticProactiveLogCollectionSettings. + :vartype system_data: ~data_box_edge_management_client.models.SystemData + :param user_consent: Required. Proactive diagnostic collection consent flag. Possible values + include: "Enabled", "Disabled". + :type user_consent: str or ~data_box_edge_management_client.models.ProactiveDiagnosticsConsent + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'system_data': {'readonly': True}, + 'user_consent': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'user_consent': {'key': 'properties.userConsent', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(DiagnosticProactiveLogCollectionSettings, self).__init__(**kwargs) + self.system_data = None + self.user_consent = kwargs['user_consent'] + + +class DiagnosticRemoteSupportSettings(ArmBaseModel): + """The remote support settings of a device. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: The path ID that uniquely identifies the object. + :vartype id: str + :ivar name: The object name. + :vartype name: str + :ivar type: The hierarchical type of the object. + :vartype type: str + :ivar system_data: DiagnosticRemoteSupportSettings. + :vartype system_data: ~data_box_edge_management_client.models.SystemData + :param remote_support_settings_list: Remote support settings list according to the + RemoteApplicationType. + :type remote_support_settings_list: + list[~data_box_edge_management_client.models.RemoteSupportSettings] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'system_data': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'remote_support_settings_list': {'key': 'properties.remoteSupportSettingsList', 'type': '[RemoteSupportSettings]'}, + } + + def __init__( + self, + **kwargs + ): + super(DiagnosticRemoteSupportSettings, self).__init__(**kwargs) + self.system_data = None + self.remote_support_settings_list = kwargs.get('remote_support_settings_list', None) + + +class EdgeProfile(msrest.serialization.Model): + """Details about Edge Profile for the resource. + + :param subscription: Edge Profile Subscription. + :type subscription: ~data_box_edge_management_client.models.EdgeProfileSubscription + """ + + _attribute_map = { + 'subscription': {'key': 'subscription', 'type': 'EdgeProfileSubscription'}, + } + + def __init__( + self, + **kwargs + ): + super(EdgeProfile, self).__init__(**kwargs) + self.subscription = kwargs.get('subscription', None) + + +class EdgeProfilePatch(msrest.serialization.Model): + """The Data Box Edge/Gateway Edge Profile patch. + + :param subscription: The Data Box Edge/Gateway Edge Profile Subscription patch. + :type subscription: ~data_box_edge_management_client.models.EdgeProfileSubscriptionPatch + """ + + _attribute_map = { + 'subscription': {'key': 'subscription', 'type': 'EdgeProfileSubscriptionPatch'}, + } + + def __init__( + self, + **kwargs + ): + super(EdgeProfilePatch, self).__init__(**kwargs) + self.subscription = kwargs.get('subscription', None) + + +class EdgeProfileSubscription(msrest.serialization.Model): + """Subscription details for the Edge Profile. + + :param registration_id: Edge Subscription Registration ID. + :type registration_id: str + :param id: ARM ID of the subscription. + :type id: str + :param state: Possible values include: "Registered", "Warned", "Suspended", "Deleted", + "Unregistered". + :type state: str or ~data_box_edge_management_client.models.SubscriptionState + :param registration_date: + :type registration_date: str + :param subscription_id: + :type subscription_id: str + :param tenant_id: + :type tenant_id: str + :param location_placement_id: + :type location_placement_id: str + :param quota_id: + :type quota_id: str + :param serialized_details: + :type serialized_details: str + :param registered_features: + :type registered_features: + list[~data_box_edge_management_client.models.SubscriptionRegisteredFeatures] + """ + + _attribute_map = { + 'registration_id': {'key': 'registrationId', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + 'state': {'key': 'state', 'type': 'str'}, + 'registration_date': {'key': 'registrationDate', 'type': 'str'}, + 'subscription_id': {'key': 'subscriptionId', 'type': 'str'}, + 'tenant_id': {'key': 'properties.tenantId', 'type': 'str'}, + 'location_placement_id': {'key': 'properties.locationPlacementId', 'type': 'str'}, + 'quota_id': {'key': 'properties.quotaId', 'type': 'str'}, + 'serialized_details': {'key': 'properties.serializedDetails', 'type': 'str'}, + 'registered_features': {'key': 'properties.registeredFeatures', 'type': '[SubscriptionRegisteredFeatures]'}, + } + + def __init__( + self, + **kwargs + ): + super(EdgeProfileSubscription, self).__init__(**kwargs) + self.registration_id = kwargs.get('registration_id', None) + self.id = kwargs.get('id', None) + self.state = kwargs.get('state', None) + self.registration_date = kwargs.get('registration_date', None) + self.subscription_id = kwargs.get('subscription_id', None) + self.tenant_id = kwargs.get('tenant_id', None) + self.location_placement_id = kwargs.get('location_placement_id', None) + self.quota_id = kwargs.get('quota_id', None) + self.serialized_details = kwargs.get('serialized_details', None) + self.registered_features = kwargs.get('registered_features', None) + + +class EdgeProfileSubscriptionPatch(msrest.serialization.Model): + """The Data Box Edge/Gateway Edge Profile Subscription patch. + + :param id: The path ID that uniquely identifies the subscription of the edge profile. + :type id: str + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(EdgeProfileSubscriptionPatch, self).__init__(**kwargs) + self.id = kwargs.get('id', None) + + +class EtcdInfo(msrest.serialization.Model): + """Etcd configuration. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar type: Etcd type. + :vartype type: str + :ivar version: Etcd version. + :vartype version: str + """ + + _validation = { + 'type': {'readonly': True}, + 'version': {'readonly': True}, + } + + _attribute_map = { + 'type': {'key': 'type', 'type': 'str'}, + 'version': {'key': 'version', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(EtcdInfo, self).__init__(**kwargs) + self.type = None + self.version = None + + +class Trigger(ArmBaseModel): + """Trigger details. + + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: FileEventTrigger, PeriodicTimerEventTrigger. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: The path ID that uniquely identifies the object. + :vartype id: str + :ivar name: The object name. + :vartype name: str + :ivar type: The hierarchical type of the object. + :vartype type: str + :ivar system_data: Trigger in DataBoxEdge Resource. + :vartype system_data: ~data_box_edge_management_client.models.SystemData + :param kind: Required. Trigger Kind.Constant filled by server. Possible values include: + "FileEvent", "PeriodicTimerEvent". + :type kind: str or ~data_box_edge_management_client.models.TriggerEventType + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'system_data': {'readonly': True}, + 'kind': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'kind': {'key': 'kind', 'type': 'str'}, + } + + _subtype_map = { + 'kind': {'FileEvent': 'FileEventTrigger', 'PeriodicTimerEvent': 'PeriodicTimerEventTrigger'} + } + + def __init__( + self, + **kwargs + ): + super(Trigger, self).__init__(**kwargs) + self.system_data = None + self.kind = 'Trigger' # type: str + + +class FileEventTrigger(Trigger): + """Trigger details. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: The path ID that uniquely identifies the object. + :vartype id: str + :ivar name: The object name. + :vartype name: str + :ivar type: The hierarchical type of the object. + :vartype type: str + :ivar system_data: Trigger in DataBoxEdge Resource. + :vartype system_data: ~data_box_edge_management_client.models.SystemData + :param kind: Required. Trigger Kind.Constant filled by server. Possible values include: + "FileEvent", "PeriodicTimerEvent". + :type kind: str or ~data_box_edge_management_client.models.TriggerEventType + :param source_info: Required. File event source details. + :type source_info: ~data_box_edge_management_client.models.FileSourceInfo + :param sink_info: Required. Role sink info. + :type sink_info: ~data_box_edge_management_client.models.RoleSinkInfo + :param custom_context_tag: A custom context tag typically used to correlate the trigger against + its usage. For example, if a periodic timer trigger is intended for certain specific IoT + modules in the device, the tag can be the name or the image URL of the module. + :type custom_context_tag: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'system_data': {'readonly': True}, + 'kind': {'required': True}, + 'source_info': {'required': True}, + 'sink_info': {'required': True}, + 'custom_context_tag': {'max_length': 192, 'min_length': 0}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'source_info': {'key': 'properties.sourceInfo', 'type': 'FileSourceInfo'}, + 'sink_info': {'key': 'properties.sinkInfo', 'type': 'RoleSinkInfo'}, + 'custom_context_tag': {'key': 'properties.customContextTag', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(FileEventTrigger, self).__init__(**kwargs) + self.kind = 'FileEvent' # type: str + self.source_info = kwargs['source_info'] + self.sink_info = kwargs['sink_info'] + self.custom_context_tag = kwargs.get('custom_context_tag', None) + + +class FileSourceInfo(msrest.serialization.Model): + """File source details. + + All required parameters must be populated in order to send to Azure. + + :param share_id: Required. File share ID. + :type share_id: str + """ + + _validation = { + 'share_id': {'required': True}, + } + + _attribute_map = { + 'share_id': {'key': 'shareId', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(FileSourceInfo, self).__init__(**kwargs) + self.share_id = kwargs['share_id'] + + +class GenerateCertResponse(msrest.serialization.Model): + """Used in activation key generation flow. + + :param public_key: Gets or sets base64 encoded certificate raw data, + this is the public part needed to be uploaded to cert vault. + :type public_key: str + :param private_key: Gets or sets base64 encoded private part of the certificate, + needed to form the activation key. + :type private_key: str + :param expiry_time_in_utc: Gets or sets expiry time in UTC. + :type expiry_time_in_utc: str + """ + + _attribute_map = { + 'public_key': {'key': 'publicKey', 'type': 'str'}, + 'private_key': {'key': 'privateKey', 'type': 'str'}, + 'expiry_time_in_utc': {'key': 'expiryTimeInUTC', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(GenerateCertResponse, self).__init__(**kwargs) + self.public_key = kwargs.get('public_key', None) + self.private_key = kwargs.get('private_key', None) + self.expiry_time_in_utc = kwargs.get('expiry_time_in_utc', None) + + +class ImageRepositoryCredential(msrest.serialization.Model): + """Image repository credential. + + All required parameters must be populated in order to send to Azure. + + :param image_repository_url: Required. Image repository url (e.g.: mcr.microsoft.com). + :type image_repository_url: str + :param user_name: Required. Repository user name. + :type user_name: str + :param password: Repository user password. + :type password: ~data_box_edge_management_client.models.AsymmetricEncryptedSecret + """ + + _validation = { + 'image_repository_url': {'required': True}, + 'user_name': {'required': True}, + } + + _attribute_map = { + 'image_repository_url': {'key': 'imageRepositoryUrl', 'type': 'str'}, + 'user_name': {'key': 'userName', 'type': 'str'}, + 'password': {'key': 'password', 'type': 'AsymmetricEncryptedSecret'}, + } + + def __init__( + self, + **kwargs + ): + super(ImageRepositoryCredential, self).__init__(**kwargs) + self.image_repository_url = kwargs['image_repository_url'] + self.user_name = kwargs['user_name'] + self.password = kwargs.get('password', None) + + +class IoTAddon(Addon): + """IoT Addon. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: The path ID that uniquely identifies the object. + :vartype id: str + :ivar name: The object name. + :vartype name: str + :ivar type: The hierarchical type of the object. + :vartype type: str + :param kind: Required. Addon type.Constant filled by server. Possible values include: + "IotEdge", "ArcForKubernetes". + :type kind: str or ~data_box_edge_management_client.models.AddonType + :ivar system_data: Addon type. + :vartype system_data: ~data_box_edge_management_client.models.SystemData + :param io_t_device_details: Required. IoT device metadata to which appliance needs to be + connected. + :type io_t_device_details: ~data_box_edge_management_client.models.IoTDeviceInfo + :param io_t_edge_device_details: Required. IoT edge device to which the IoT Addon needs to be + configured. + :type io_t_edge_device_details: ~data_box_edge_management_client.models.IoTDeviceInfo + :ivar version: Version of IoT running on the appliance. + :vartype version: str + :ivar host_platform: Host OS supported by the IoT addon. Possible values include: "Windows", + "Linux". + :vartype host_platform: str or ~data_box_edge_management_client.models.PlatformType + :ivar host_platform_type: Platform where the runtime is hosted. Possible values include: + "KubernetesCluster", "LinuxVM". + :vartype host_platform_type: str or ~data_box_edge_management_client.models.HostPlatformType + :ivar provisioning_state: Addon Provisioning State. Possible values include: "Invalid", + "Creating", "Created", "Updating", "Reconfiguring", "Failed", "Deleting". + :vartype provisioning_state: str or ~data_box_edge_management_client.models.AddonState + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'kind': {'required': True}, + 'system_data': {'readonly': True}, + 'io_t_device_details': {'required': True}, + 'io_t_edge_device_details': {'required': True}, + 'version': {'readonly': True}, + 'host_platform': {'readonly': True}, + 'host_platform_type': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'io_t_device_details': {'key': 'properties.ioTDeviceDetails', 'type': 'IoTDeviceInfo'}, + 'io_t_edge_device_details': {'key': 'properties.ioTEdgeDeviceDetails', 'type': 'IoTDeviceInfo'}, + 'version': {'key': 'properties.version', 'type': 'str'}, + 'host_platform': {'key': 'properties.hostPlatform', 'type': 'str'}, + 'host_platform_type': {'key': 'properties.hostPlatformType', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(IoTAddon, self).__init__(**kwargs) + self.kind = 'IotEdge' # type: str + self.io_t_device_details = kwargs['io_t_device_details'] + self.io_t_edge_device_details = kwargs['io_t_edge_device_details'] + self.version = None + self.host_platform = None + self.host_platform_type = None + self.provisioning_state = None + + +class IoTDeviceInfo(msrest.serialization.Model): + """Metadata of IoT device/IoT Edge device to be configured. + + All required parameters must be populated in order to send to Azure. + + :param device_id: Required. ID of the IoT device/edge device. + :type device_id: str + :param io_t_host_hub: Required. Host name for the IoT hub associated to the device. + :type io_t_host_hub: str + :param io_t_host_hub_id: Id for the IoT hub associated to the device. + :type io_t_host_hub_id: str + :param authentication: Encrypted IoT device/IoT edge device connection string. + :type authentication: ~data_box_edge_management_client.models.Authentication + """ + + _validation = { + 'device_id': {'required': True}, + 'io_t_host_hub': {'required': True}, + } + + _attribute_map = { + 'device_id': {'key': 'deviceId', 'type': 'str'}, + 'io_t_host_hub': {'key': 'ioTHostHub', 'type': 'str'}, + 'io_t_host_hub_id': {'key': 'ioTHostHubId', 'type': 'str'}, + 'authentication': {'key': 'authentication', 'type': 'Authentication'}, + } + + def __init__( + self, + **kwargs + ): + super(IoTDeviceInfo, self).__init__(**kwargs) + self.device_id = kwargs['device_id'] + self.io_t_host_hub = kwargs['io_t_host_hub'] + self.io_t_host_hub_id = kwargs.get('io_t_host_hub_id', None) + self.authentication = kwargs.get('authentication', None) + + +class IoTEdgeAgentInfo(msrest.serialization.Model): + """IoT edge agent details is optional, this will be used for download system Agent module while bootstrapping IoT Role if specified. + + All required parameters must be populated in order to send to Azure. + + :param image_name: Required. Name of the IoT edge agent image. + :type image_name: str + :param tag: Required. Image Tag. + :type tag: str + :param image_repository: Image repository details. + :type image_repository: ~data_box_edge_management_client.models.ImageRepositoryCredential + """ + + _validation = { + 'image_name': {'required': True}, + 'tag': {'required': True}, + } + + _attribute_map = { + 'image_name': {'key': 'imageName', 'type': 'str'}, + 'tag': {'key': 'tag', 'type': 'str'}, + 'image_repository': {'key': 'imageRepository', 'type': 'ImageRepositoryCredential'}, + } + + def __init__( + self, + **kwargs + ): + super(IoTEdgeAgentInfo, self).__init__(**kwargs) + self.image_name = kwargs['image_name'] + self.tag = kwargs['tag'] + self.image_repository = kwargs.get('image_repository', None) + + +class IoTRole(Role): + """Compute role. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: The path ID that uniquely identifies the object. + :vartype id: str + :ivar name: The object name. + :vartype name: str + :ivar type: The hierarchical type of the object. + :vartype type: str + :param kind: Required. Role type.Constant filled by server. Possible values include: "IOT", + "ASA", "Functions", "Cognitive", "MEC", "CloudEdgeManagement", "Kubernetes". + :type kind: str or ~data_box_edge_management_client.models.RoleTypes + :ivar system_data: Role configured on ASE resource. + :vartype system_data: ~data_box_edge_management_client.models.SystemData + :param host_platform: Host OS supported by the IoT role. Possible values include: "Windows", + "Linux". + :type host_platform: str or ~data_box_edge_management_client.models.PlatformType + :param io_t_device_details: IoT device metadata to which data box edge device needs to be + connected. + :type io_t_device_details: ~data_box_edge_management_client.models.IoTDeviceInfo + :param io_t_edge_device_details: IoT edge device to which the IoT role needs to be configured. + :type io_t_edge_device_details: ~data_box_edge_management_client.models.IoTDeviceInfo + :param share_mappings: Mount points of shares in role(s). + :type share_mappings: list[~data_box_edge_management_client.models.MountPointMap] + :param io_t_edge_agent_info: Iot edge agent details to download the agent and bootstrap iot + runtime. + :type io_t_edge_agent_info: ~data_box_edge_management_client.models.IoTEdgeAgentInfo + :ivar host_platform_type: Platform where the Iot runtime is hosted. Possible values include: + "KubernetesCluster", "LinuxVM". + :vartype host_platform_type: str or ~data_box_edge_management_client.models.HostPlatformType + :param compute_resource: Resource allocation. + :type compute_resource: ~data_box_edge_management_client.models.ComputeResource + :param role_status: Role status. Possible values include: "Enabled", "Disabled". + :type role_status: str or ~data_box_edge_management_client.models.RoleStatus + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'kind': {'required': True}, + 'system_data': {'readonly': True}, + 'host_platform_type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'host_platform': {'key': 'properties.hostPlatform', 'type': 'str'}, + 'io_t_device_details': {'key': 'properties.ioTDeviceDetails', 'type': 'IoTDeviceInfo'}, + 'io_t_edge_device_details': {'key': 'properties.ioTEdgeDeviceDetails', 'type': 'IoTDeviceInfo'}, + 'share_mappings': {'key': 'properties.shareMappings', 'type': '[MountPointMap]'}, + 'io_t_edge_agent_info': {'key': 'properties.ioTEdgeAgentInfo', 'type': 'IoTEdgeAgentInfo'}, + 'host_platform_type': {'key': 'properties.hostPlatformType', 'type': 'str'}, + 'compute_resource': {'key': 'properties.computeResource', 'type': 'ComputeResource'}, + 'role_status': {'key': 'properties.roleStatus', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(IoTRole, self).__init__(**kwargs) + self.kind = 'IOT' # type: str + self.host_platform = kwargs.get('host_platform', None) + self.io_t_device_details = kwargs.get('io_t_device_details', None) + self.io_t_edge_device_details = kwargs.get('io_t_edge_device_details', None) + self.share_mappings = kwargs.get('share_mappings', None) + self.io_t_edge_agent_info = kwargs.get('io_t_edge_agent_info', None) + self.host_platform_type = None + self.compute_resource = kwargs.get('compute_resource', None) + self.role_status = kwargs.get('role_status', None) + + +class Ipv4Config(msrest.serialization.Model): + """Details related to the IPv4 address configuration. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar ip_address: The IPv4 address of the network adapter. + :vartype ip_address: str + :ivar subnet: The IPv4 subnet of the network adapter. + :vartype subnet: str + :ivar gateway: The IPv4 gateway of the network adapter. + :vartype gateway: str + """ + + _validation = { + 'ip_address': {'readonly': True}, + 'subnet': {'readonly': True}, + 'gateway': {'readonly': True}, + } + + _attribute_map = { + 'ip_address': {'key': 'ipAddress', 'type': 'str'}, + 'subnet': {'key': 'subnet', 'type': 'str'}, + 'gateway': {'key': 'gateway', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(Ipv4Config, self).__init__(**kwargs) + self.ip_address = None + self.subnet = None + self.gateway = None + + +class Ipv6Config(msrest.serialization.Model): + """Details related to the IPv6 address configuration. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar ip_address: The IPv6 address of the network adapter. + :vartype ip_address: str + :ivar prefix_length: The IPv6 prefix of the network adapter. + :vartype prefix_length: int + :ivar gateway: The IPv6 gateway of the network adapter. + :vartype gateway: str + """ + + _validation = { + 'ip_address': {'readonly': True}, + 'prefix_length': {'readonly': True}, + 'gateway': {'readonly': True}, + } + + _attribute_map = { + 'ip_address': {'key': 'ipAddress', 'type': 'str'}, + 'prefix_length': {'key': 'prefixLength', 'type': 'int'}, + 'gateway': {'key': 'gateway', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(Ipv6Config, self).__init__(**kwargs) + self.ip_address = None + self.prefix_length = None + self.gateway = None + + +class Job(msrest.serialization.Model): + """A device job. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: The path ID that uniquely identifies the object. + :vartype id: str + :ivar name: The name of the object. + :vartype name: str + :ivar type: The hierarchical type of the object. + :vartype type: str + :ivar status: The current status of the job. Possible values include: "Invalid", "Running", + "Succeeded", "Failed", "Canceled", "Paused", "Scheduled". + :vartype status: str or ~data_box_edge_management_client.models.JobStatus + :ivar start_time: The UTC date and time at which the job started. + :vartype start_time: ~datetime.datetime + :ivar end_time: The UTC date and time at which the job completed. + :vartype end_time: ~datetime.datetime + :ivar percent_complete: The percentage of the job that is complete. + :vartype percent_complete: int + :ivar error: The error details. + :vartype error: ~data_box_edge_management_client.models.JobErrorDetails + :ivar job_type: The type of the job. Possible values include: "Invalid", "ScanForUpdates", + "DownloadUpdates", "InstallUpdates", "RefreshShare", "RefreshContainer", "Backup", "Restore", + "TriggerSupportPackage". + :vartype job_type: str or ~data_box_edge_management_client.models.JobType + :ivar current_stage: Current stage of the update operation. Possible values include: "Unknown", + "Initial", "ScanStarted", "ScanComplete", "ScanFailed", "DownloadStarted", "DownloadComplete", + "DownloadFailed", "InstallStarted", "InstallComplete", "InstallFailed", "RebootInitiated", + "Success", "Failure", "RescanStarted", "RescanComplete", "RescanFailed". + :vartype current_stage: str or ~data_box_edge_management_client.models.UpdateOperationStage + :ivar download_progress: The download progress. + :vartype download_progress: ~data_box_edge_management_client.models.UpdateDownloadProgress + :ivar install_progress: The install progress. + :vartype install_progress: ~data_box_edge_management_client.models.UpdateInstallProgress + :ivar total_refresh_errors: Total number of errors encountered during the refresh process. + :vartype total_refresh_errors: int + :ivar error_manifest_file: Local share/remote container relative path to the error manifest + file of the refresh. + :vartype error_manifest_file: str + :ivar refreshed_entity_id: ARM ID of the entity that was refreshed. + :vartype refreshed_entity_id: str + :param folder: If only subfolders need to be refreshed, then the subfolder path inside the + share or container. (The path is empty if there are no subfolders.). + :type folder: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'status': {'readonly': True}, + 'start_time': {'readonly': True}, + 'end_time': {'readonly': True}, + 'percent_complete': {'readonly': True}, + 'error': {'readonly': True}, + 'job_type': {'readonly': True}, + 'current_stage': {'readonly': True}, + 'download_progress': {'readonly': True}, + 'install_progress': {'readonly': True}, + 'total_refresh_errors': {'readonly': True}, + 'error_manifest_file': {'readonly': True}, + 'refreshed_entity_id': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'status': {'key': 'status', 'type': 'str'}, + 'start_time': {'key': 'startTime', 'type': 'iso-8601'}, + 'end_time': {'key': 'endTime', 'type': 'iso-8601'}, + 'percent_complete': {'key': 'percentComplete', 'type': 'int'}, + 'error': {'key': 'error', 'type': 'JobErrorDetails'}, + 'job_type': {'key': 'properties.jobType', 'type': 'str'}, + 'current_stage': {'key': 'properties.currentStage', 'type': 'str'}, + 'download_progress': {'key': 'properties.downloadProgress', 'type': 'UpdateDownloadProgress'}, + 'install_progress': {'key': 'properties.installProgress', 'type': 'UpdateInstallProgress'}, + 'total_refresh_errors': {'key': 'properties.totalRefreshErrors', 'type': 'int'}, + 'error_manifest_file': {'key': 'properties.errorManifestFile', 'type': 'str'}, + 'refreshed_entity_id': {'key': 'properties.refreshedEntityId', 'type': 'str'}, + 'folder': {'key': 'properties.folder', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(Job, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None + self.status = None + self.start_time = None + self.end_time = None + self.percent_complete = None + self.error = None + self.job_type = None + self.current_stage = None + self.download_progress = None + self.install_progress = None + self.total_refresh_errors = None + self.error_manifest_file = None + self.refreshed_entity_id = None + self.folder = kwargs.get('folder', None) + + +class JobErrorDetails(msrest.serialization.Model): + """The job error information containing the list of job errors. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar error_details: The error details. + :vartype error_details: list[~data_box_edge_management_client.models.JobErrorItem] + :ivar code: The code intended for programmatic access. + :vartype code: str + :ivar message: The message that describes the error in detail. + :vartype message: str + """ + + _validation = { + 'error_details': {'readonly': True}, + 'code': {'readonly': True}, + 'message': {'readonly': True}, + } + + _attribute_map = { + 'error_details': {'key': 'errorDetails', 'type': '[JobErrorItem]'}, + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(JobErrorDetails, self).__init__(**kwargs) + self.error_details = None + self.code = None + self.message = None + + +class JobErrorItem(msrest.serialization.Model): + """The job error items. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar recommendations: The recommended actions. + :vartype recommendations: list[str] + :ivar code: The code intended for programmatic access. + :vartype code: str + :ivar message: The message that describes the error in detail. + :vartype message: str + """ + + _validation = { + 'recommendations': {'readonly': True}, + 'code': {'readonly': True}, + 'message': {'readonly': True}, + } + + _attribute_map = { + 'recommendations': {'key': 'recommendations', 'type': '[str]'}, + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(JobErrorItem, self).__init__(**kwargs) + self.recommendations = None + self.code = None + self.message = None + + +class KubernetesClusterInfo(msrest.serialization.Model): + """Kubernetes cluster configuration. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar etcd_info: Etcd configuration. + :vartype etcd_info: ~data_box_edge_management_client.models.EtcdInfo + :ivar nodes: Kubernetes cluster nodes. + :vartype nodes: list[~data_box_edge_management_client.models.NodeInfo] + :param version: Required. Kubernetes cluster version. + :type version: str + """ + + _validation = { + 'etcd_info': {'readonly': True}, + 'nodes': {'readonly': True}, + 'version': {'required': True}, + } + + _attribute_map = { + 'etcd_info': {'key': 'etcdInfo', 'type': 'EtcdInfo'}, + 'nodes': {'key': 'nodes', 'type': '[NodeInfo]'}, + 'version': {'key': 'version', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(KubernetesClusterInfo, self).__init__(**kwargs) + self.etcd_info = None + self.nodes = None + self.version = kwargs['version'] + + +class KubernetesIpConfiguration(msrest.serialization.Model): + """Kubernetes node IP configuration. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar port: Port of the Kubernetes node. + :vartype port: str + :param ip_address: IP address of the Kubernetes node. + :type ip_address: str + """ + + _validation = { + 'port': {'readonly': True}, + } + + _attribute_map = { + 'port': {'key': 'port', 'type': 'str'}, + 'ip_address': {'key': 'ipAddress', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(KubernetesIpConfiguration, self).__init__(**kwargs) + self.port = None + self.ip_address = kwargs.get('ip_address', None) + + +class KubernetesRole(Role): + """Kubernetes role, Currently it's in Private Preview. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: The path ID that uniquely identifies the object. + :vartype id: str + :ivar name: The object name. + :vartype name: str + :ivar type: The hierarchical type of the object. + :vartype type: str + :param kind: Required. Role type.Constant filled by server. Possible values include: "IOT", + "ASA", "Functions", "Cognitive", "MEC", "CloudEdgeManagement", "Kubernetes". + :type kind: str or ~data_box_edge_management_client.models.RoleTypes + :ivar system_data: Role configured on ASE resource. + :vartype system_data: ~data_box_edge_management_client.models.SystemData + :param host_platform: Host OS supported by the Kubernetes role. Possible values include: + "Windows", "Linux". + :type host_platform: str or ~data_box_edge_management_client.models.PlatformType + :ivar provisioning_state: State of Kubernetes deployment. Possible values include: "Invalid", + "Creating", "Created", "Updating", "Reconfiguring", "Failed", "Deleting". + :vartype provisioning_state: str or ~data_box_edge_management_client.models.KubernetesState + :ivar host_platform_type: Platform where the runtime is hosted. Possible values include: + "KubernetesCluster", "LinuxVM". + :vartype host_platform_type: str or ~data_box_edge_management_client.models.HostPlatformType + :param kubernetes_cluster_info: Kubernetes cluster configuration. + :type kubernetes_cluster_info: ~data_box_edge_management_client.models.KubernetesClusterInfo + :param kubernetes_role_resources: Kubernetes role resources. + :type kubernetes_role_resources: + ~data_box_edge_management_client.models.KubernetesRoleResources + :param role_status: Role status. Possible values include: "Enabled", "Disabled". + :type role_status: str or ~data_box_edge_management_client.models.RoleStatus + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'kind': {'required': True}, + 'system_data': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + 'host_platform_type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'host_platform': {'key': 'properties.hostPlatform', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'host_platform_type': {'key': 'properties.hostPlatformType', 'type': 'str'}, + 'kubernetes_cluster_info': {'key': 'properties.kubernetesClusterInfo', 'type': 'KubernetesClusterInfo'}, + 'kubernetes_role_resources': {'key': 'properties.kubernetesRoleResources', 'type': 'KubernetesRoleResources'}, + 'role_status': {'key': 'properties.roleStatus', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(KubernetesRole, self).__init__(**kwargs) + self.kind = 'Kubernetes' # type: str + self.host_platform = kwargs.get('host_platform', None) + self.provisioning_state = None + self.host_platform_type = None + self.kubernetes_cluster_info = kwargs.get('kubernetes_cluster_info', None) + self.kubernetes_role_resources = kwargs.get('kubernetes_role_resources', None) + self.role_status = kwargs.get('role_status', None) + + +class KubernetesRoleCompute(msrest.serialization.Model): + """Kubernetes role compute resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :param vm_profile: Required. VM profile. + :type vm_profile: str + :ivar memory_in_bytes: Memory in bytes. + :vartype memory_in_bytes: long + :ivar processor_count: Processor count. + :vartype processor_count: int + """ + + _validation = { + 'vm_profile': {'required': True}, + 'memory_in_bytes': {'readonly': True}, + 'processor_count': {'readonly': True}, + } + + _attribute_map = { + 'vm_profile': {'key': 'vmProfile', 'type': 'str'}, + 'memory_in_bytes': {'key': 'memoryInBytes', 'type': 'long'}, + 'processor_count': {'key': 'processorCount', 'type': 'int'}, + } + + def __init__( + self, + **kwargs + ): + super(KubernetesRoleCompute, self).__init__(**kwargs) + self.vm_profile = kwargs['vm_profile'] + self.memory_in_bytes = None + self.processor_count = None + + +class KubernetesRoleNetwork(msrest.serialization.Model): + """Kubernetes role network resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar cni_config: Cni configuration. + :vartype cni_config: ~data_box_edge_management_client.models.CniConfig + :ivar load_balancer_config: Load balancer configuration. + :vartype load_balancer_config: ~data_box_edge_management_client.models.LoadBalancerConfig + """ + + _validation = { + 'cni_config': {'readonly': True}, + 'load_balancer_config': {'readonly': True}, + } + + _attribute_map = { + 'cni_config': {'key': 'cniConfig', 'type': 'CniConfig'}, + 'load_balancer_config': {'key': 'loadBalancerConfig', 'type': 'LoadBalancerConfig'}, + } + + def __init__( + self, + **kwargs + ): + super(KubernetesRoleNetwork, self).__init__(**kwargs) + self.cni_config = None + self.load_balancer_config = None + + +class KubernetesRoleResources(msrest.serialization.Model): + """Kubernetes role resources. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :param storage: Kubernetes role storage resource. + :type storage: ~data_box_edge_management_client.models.KubernetesRoleStorage + :param compute: Required. Kubernetes role compute resource. + :type compute: ~data_box_edge_management_client.models.KubernetesRoleCompute + :ivar network: Kubernetes role network resource. + :vartype network: ~data_box_edge_management_client.models.KubernetesRoleNetwork + """ + + _validation = { + 'compute': {'required': True}, + 'network': {'readonly': True}, + } + + _attribute_map = { + 'storage': {'key': 'storage', 'type': 'KubernetesRoleStorage'}, + 'compute': {'key': 'compute', 'type': 'KubernetesRoleCompute'}, + 'network': {'key': 'network', 'type': 'KubernetesRoleNetwork'}, + } + + def __init__( + self, + **kwargs + ): + super(KubernetesRoleResources, self).__init__(**kwargs) + self.storage = kwargs.get('storage', None) + self.compute = kwargs['compute'] + self.network = None + + +class KubernetesRoleStorage(msrest.serialization.Model): + """Kubernetes role storage resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar storage_classes: Kubernetes storage class info. + :vartype storage_classes: + list[~data_box_edge_management_client.models.KubernetesRoleStorageClassInfo] + :param endpoints: Mount points of shares in role(s). + :type endpoints: list[~data_box_edge_management_client.models.MountPointMap] + """ + + _validation = { + 'storage_classes': {'readonly': True}, + } + + _attribute_map = { + 'storage_classes': {'key': 'storageClasses', 'type': '[KubernetesRoleStorageClassInfo]'}, + 'endpoints': {'key': 'endpoints', 'type': '[MountPointMap]'}, + } + + def __init__( + self, + **kwargs + ): + super(KubernetesRoleStorage, self).__init__(**kwargs) + self.storage_classes = None + self.endpoints = kwargs.get('endpoints', None) + + +class KubernetesRoleStorageClassInfo(msrest.serialization.Model): + """Kubernetes storage class info. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar name: Storage class name. + :vartype name: str + :ivar type: Storage class type. + :vartype type: str + :ivar posix_compliant: If provisioned storage is posix compliant. Possible values include: + "Invalid", "Enabled", "Disabled". + :vartype posix_compliant: str or ~data_box_edge_management_client.models.PosixComplianceStatus + """ + + _validation = { + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'posix_compliant': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'posix_compliant': {'key': 'posixCompliant', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(KubernetesRoleStorageClassInfo, self).__init__(**kwargs) + self.name = None + self.type = None + self.posix_compliant = None + + +class LoadBalancerConfig(msrest.serialization.Model): + """Load balancer configuration. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar type: Load balancer type. + :vartype type: str + :ivar version: Load balancer version. + :vartype version: str + """ + + _validation = { + 'type': {'readonly': True}, + 'version': {'readonly': True}, + } + + _attribute_map = { + 'type': {'key': 'type', 'type': 'str'}, + 'version': {'key': 'version', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(LoadBalancerConfig, self).__init__(**kwargs) + self.type = None + self.version = None + + +class MecRole(Role): + """MEC role. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: The path ID that uniquely identifies the object. + :vartype id: str + :ivar name: The object name. + :vartype name: str + :ivar type: The hierarchical type of the object. + :vartype type: str + :param kind: Required. Role type.Constant filled by server. Possible values include: "IOT", + "ASA", "Functions", "Cognitive", "MEC", "CloudEdgeManagement", "Kubernetes". + :type kind: str or ~data_box_edge_management_client.models.RoleTypes + :ivar system_data: Role configured on ASE resource. + :vartype system_data: ~data_box_edge_management_client.models.SystemData + :param connection_string: Activation key of the MEC. + :type connection_string: ~data_box_edge_management_client.models.AsymmetricEncryptedSecret + :param controller_endpoint: Controller Endpoint. + :type controller_endpoint: str + :param resource_unique_id: Unique Id of the Resource. + :type resource_unique_id: str + :param role_status: Role status. Possible values include: "Enabled", "Disabled". + :type role_status: str or ~data_box_edge_management_client.models.RoleStatus + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'kind': {'required': True}, + 'system_data': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'connection_string': {'key': 'properties.connectionString', 'type': 'AsymmetricEncryptedSecret'}, + 'controller_endpoint': {'key': 'properties.controllerEndpoint', 'type': 'str'}, + 'resource_unique_id': {'key': 'properties.resourceUniqueId', 'type': 'str'}, + 'role_status': {'key': 'properties.roleStatus', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(MecRole, self).__init__(**kwargs) + self.kind = 'MEC' # type: str + self.connection_string = kwargs.get('connection_string', None) + self.controller_endpoint = kwargs.get('controller_endpoint', None) + self.resource_unique_id = kwargs.get('resource_unique_id', None) + self.role_status = kwargs.get('role_status', None) + + +class MetricConfiguration(msrest.serialization.Model): + """Metric configuration. + + All required parameters must be populated in order to send to Azure. + + :param resource_id: Required. The Resource ID on which the metrics should be pushed. + :type resource_id: str + :param mdm_account: The MDM account to which the counters should be pushed. + :type mdm_account: str + :param metric_name_space: The MDM namespace to which the counters should be pushed. This is + required if MDMAccount is specified. + :type metric_name_space: str + :param counter_sets: Required. Host name for the IoT hub associated to the device. + :type counter_sets: list[~data_box_edge_management_client.models.MetricCounterSet] + """ + + _validation = { + 'resource_id': {'required': True}, + 'counter_sets': {'required': True}, + } + + _attribute_map = { + 'resource_id': {'key': 'resourceId', 'type': 'str'}, + 'mdm_account': {'key': 'mdmAccount', 'type': 'str'}, + 'metric_name_space': {'key': 'metricNameSpace', 'type': 'str'}, + 'counter_sets': {'key': 'counterSets', 'type': '[MetricCounterSet]'}, + } + + def __init__( + self, + **kwargs + ): + super(MetricConfiguration, self).__init__(**kwargs) + self.resource_id = kwargs['resource_id'] + self.mdm_account = kwargs.get('mdm_account', None) + self.metric_name_space = kwargs.get('metric_name_space', None) + self.counter_sets = kwargs['counter_sets'] + + +class MetricCounter(msrest.serialization.Model): + """The metric counter. + + All required parameters must be populated in order to send to Azure. + + :param name: Required. The counter name. + :type name: str + :param instance: The instance from which counter should be collected. + :type instance: str + :param dimension_filter: The dimension filter. + :type dimension_filter: list[~data_box_edge_management_client.models.MetricDimension] + :param additional_dimensions: The additional dimensions to be added to metric. + :type additional_dimensions: list[~data_box_edge_management_client.models.MetricDimension] + """ + + _validation = { + 'name': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'instance': {'key': 'instance', 'type': 'str'}, + 'dimension_filter': {'key': 'dimensionFilter', 'type': '[MetricDimension]'}, + 'additional_dimensions': {'key': 'additionalDimensions', 'type': '[MetricDimension]'}, + } + + def __init__( + self, + **kwargs + ): + super(MetricCounter, self).__init__(**kwargs) + self.name = kwargs['name'] + self.instance = kwargs.get('instance', None) + self.dimension_filter = kwargs.get('dimension_filter', None) + self.additional_dimensions = kwargs.get('additional_dimensions', None) + + +class MetricCounterSet(msrest.serialization.Model): + """The metric counter set. + + All required parameters must be populated in order to send to Azure. + + :param counters: Required. The counters that should be collected in this set. + :type counters: list[~data_box_edge_management_client.models.MetricCounter] + """ + + _validation = { + 'counters': {'required': True}, + } + + _attribute_map = { + 'counters': {'key': 'counters', 'type': '[MetricCounter]'}, + } + + def __init__( + self, + **kwargs + ): + super(MetricCounterSet, self).__init__(**kwargs) + self.counters = kwargs['counters'] + + +class MetricDimension(msrest.serialization.Model): + """The metric dimension. + + All required parameters must be populated in order to send to Azure. + + :param source_type: Required. The dimension type. + :type source_type: str + :param source_name: Required. The dimension value. + :type source_name: str + """ + + _validation = { + 'source_type': {'required': True}, + 'source_name': {'required': True}, + } + + _attribute_map = { + 'source_type': {'key': 'sourceType', 'type': 'str'}, + 'source_name': {'key': 'sourceName', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(MetricDimension, self).__init__(**kwargs) + self.source_type = kwargs['source_type'] + self.source_name = kwargs['source_name'] + + +class MetricDimensionV1(msrest.serialization.Model): + """Metric Dimension v1. + + :param name: Name of the metrics dimension. + :type name: str + :param display_name: Display name of the metrics dimension. + :type display_name: str + :param to_be_exported_for_shoebox: To be exported to shoe box. + :type to_be_exported_for_shoebox: bool + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'display_name': {'key': 'displayName', 'type': 'str'}, + 'to_be_exported_for_shoebox': {'key': 'toBeExportedForShoebox', 'type': 'bool'}, + } + + def __init__( + self, + **kwargs + ): + super(MetricDimensionV1, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.display_name = kwargs.get('display_name', None) + self.to_be_exported_for_shoebox = kwargs.get('to_be_exported_for_shoebox', None) + + +class MetricSpecificationV1(msrest.serialization.Model): + """Metric specification version 1. + + :param name: Name of the metric. + :type name: str + :param display_name: Display name of the metric. + :type display_name: str + :param display_description: Description of the metric to be displayed. + :type display_description: str + :param unit: Metric units. Possible values include: "NotSpecified", "Percent", "Count", + "Seconds", "Milliseconds", "Bytes", "BytesPerSecond", "CountPerSecond". + :type unit: str or ~data_box_edge_management_client.models.MetricUnit + :param aggregation_type: Metric aggregation type. Possible values include: "NotSpecified", + "None", "Average", "Minimum", "Maximum", "Total", "Count". + :type aggregation_type: str or ~data_box_edge_management_client.models.MetricAggregationType + :param dimensions: Metric dimensions, other than default dimension which is resource. + :type dimensions: list[~data_box_edge_management_client.models.MetricDimensionV1] + :param fill_gap_with_zero: Set true to fill the gaps with zero. + :type fill_gap_with_zero: bool + :param category: Metric category. Possible values include: "Capacity", "Transaction". + :type category: str or ~data_box_edge_management_client.models.MetricCategory + :param resource_id_dimension_name_override: Resource name override. + :type resource_id_dimension_name_override: str + :param supported_time_grain_types: Support granularity of metrics. + :type supported_time_grain_types: list[str or + ~data_box_edge_management_client.models.TimeGrain] + :param supported_aggregation_types: Support metric aggregation type. + :type supported_aggregation_types: list[str or + ~data_box_edge_management_client.models.MetricAggregationType] + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'display_name': {'key': 'displayName', 'type': 'str'}, + 'display_description': {'key': 'displayDescription', 'type': 'str'}, + 'unit': {'key': 'unit', 'type': 'str'}, + 'aggregation_type': {'key': 'aggregationType', 'type': 'str'}, + 'dimensions': {'key': 'dimensions', 'type': '[MetricDimensionV1]'}, + 'fill_gap_with_zero': {'key': 'fillGapWithZero', 'type': 'bool'}, + 'category': {'key': 'category', 'type': 'str'}, + 'resource_id_dimension_name_override': {'key': 'resourceIdDimensionNameOverride', 'type': 'str'}, + 'supported_time_grain_types': {'key': 'supportedTimeGrainTypes', 'type': '[str]'}, + 'supported_aggregation_types': {'key': 'supportedAggregationTypes', 'type': '[str]'}, + } + + def __init__( + self, + **kwargs + ): + super(MetricSpecificationV1, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.display_name = kwargs.get('display_name', None) + self.display_description = kwargs.get('display_description', None) + self.unit = kwargs.get('unit', None) + self.aggregation_type = kwargs.get('aggregation_type', None) + self.dimensions = kwargs.get('dimensions', None) + self.fill_gap_with_zero = kwargs.get('fill_gap_with_zero', None) + self.category = kwargs.get('category', None) + self.resource_id_dimension_name_override = kwargs.get('resource_id_dimension_name_override', None) + self.supported_time_grain_types = kwargs.get('supported_time_grain_types', None) + self.supported_aggregation_types = kwargs.get('supported_aggregation_types', None) + + +class MonitoringMetricConfiguration(ArmBaseModel): + """The metric setting details for the role. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: The path ID that uniquely identifies the object. + :vartype id: str + :ivar name: The object name. + :vartype name: str + :ivar type: The hierarchical type of the object. + :vartype type: str + :ivar system_data: MonitoringConfiguration on ASE device. + :vartype system_data: ~data_box_edge_management_client.models.SystemData + :param metric_configurations: Required. The metrics configuration details. + :type metric_configurations: list[~data_box_edge_management_client.models.MetricConfiguration] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'system_data': {'readonly': True}, + 'metric_configurations': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'metric_configurations': {'key': 'properties.metricConfigurations', 'type': '[MetricConfiguration]'}, + } + + def __init__( + self, + **kwargs + ): + super(MonitoringMetricConfiguration, self).__init__(**kwargs) + self.system_data = None + self.metric_configurations = kwargs['metric_configurations'] + + +class MonitoringMetricConfigurationList(msrest.serialization.Model): + """Collection of metric configurations. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar value: The list of metric configurations. + :vartype value: list[~data_box_edge_management_client.models.MonitoringMetricConfiguration] + :ivar next_link: Link to the next set of results. + :vartype next_link: str + """ + + _validation = { + 'value': {'readonly': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[MonitoringMetricConfiguration]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(MonitoringMetricConfigurationList, self).__init__(**kwargs) + self.value = None + self.next_link = None + + +class MountPointMap(msrest.serialization.Model): + """The share mount point. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :param share_id: Required. ID of the share mounted to the role VM. + :type share_id: str + :ivar role_id: ID of the role to which share is mounted. + :vartype role_id: str + :ivar mount_point: Mount point for the share. + :vartype mount_point: str + :ivar mount_type: Mounting type. Possible values include: "Volume", "HostPath". + :vartype mount_type: str or ~data_box_edge_management_client.models.MountType + :ivar role_type: Role type. Possible values include: "IOT", "ASA", "Functions", "Cognitive", + "MEC", "CloudEdgeManagement", "Kubernetes". + :vartype role_type: str or ~data_box_edge_management_client.models.RoleTypes + """ + + _validation = { + 'share_id': {'required': True}, + 'role_id': {'readonly': True}, + 'mount_point': {'readonly': True}, + 'mount_type': {'readonly': True}, + 'role_type': {'readonly': True}, + } + + _attribute_map = { + 'share_id': {'key': 'shareId', 'type': 'str'}, + 'role_id': {'key': 'roleId', 'type': 'str'}, + 'mount_point': {'key': 'mountPoint', 'type': 'str'}, + 'mount_type': {'key': 'mountType', 'type': 'str'}, + 'role_type': {'key': 'roleType', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(MountPointMap, self).__init__(**kwargs) + self.share_id = kwargs['share_id'] + self.role_id = None + self.mount_point = None + self.mount_type = None + self.role_type = None + + +class NetworkAdapter(msrest.serialization.Model): + """Represents the networkAdapter on a device. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar adapter_id: Instance ID of network adapter. + :vartype adapter_id: str + :ivar adapter_position: Hardware position of network adapter. + :vartype adapter_position: ~data_box_edge_management_client.models.NetworkAdapterPosition + :ivar index: Logical index of the adapter. + :vartype index: int + :ivar node_id: Node ID of the network adapter. + :vartype node_id: str + :ivar network_adapter_name: Network adapter name. + :vartype network_adapter_name: str + :ivar label: Hardware label for the adapter. + :vartype label: str + :ivar mac_address: MAC address. + :vartype mac_address: str + :ivar link_speed: Link speed. + :vartype link_speed: long + :ivar status: Value indicating whether this adapter is valid. Possible values include: + "Inactive", "Active". + :vartype status: str or ~data_box_edge_management_client.models.NetworkAdapterStatus + :param rdma_status: Value indicating whether this adapter is RDMA capable. Possible values + include: "Incapable", "Capable". + :type rdma_status: str or ~data_box_edge_management_client.models.NetworkAdapterRdmaStatus + :param dhcp_status: Value indicating whether this adapter has DHCP enabled. Possible values + include: "Disabled", "Enabled". + :type dhcp_status: str or ~data_box_edge_management_client.models.NetworkAdapterDhcpStatus + :ivar ipv4_configuration: The IPv4 configuration of the network adapter. + :vartype ipv4_configuration: ~data_box_edge_management_client.models.Ipv4Config + :ivar ipv6_configuration: The IPv6 configuration of the network adapter. + :vartype ipv6_configuration: ~data_box_edge_management_client.models.Ipv6Config + :ivar ipv6_link_local_address: The IPv6 local address. + :vartype ipv6_link_local_address: str + :ivar dns_servers: The list of DNS Servers of the device. + :vartype dns_servers: list[str] + """ + + _validation = { + 'adapter_id': {'readonly': True}, + 'adapter_position': {'readonly': True}, + 'index': {'readonly': True}, + 'node_id': {'readonly': True}, + 'network_adapter_name': {'readonly': True}, + 'label': {'readonly': True}, + 'mac_address': {'readonly': True}, + 'link_speed': {'readonly': True}, + 'status': {'readonly': True}, + 'ipv4_configuration': {'readonly': True}, + 'ipv6_configuration': {'readonly': True}, + 'ipv6_link_local_address': {'readonly': True}, + 'dns_servers': {'readonly': True}, + } + + _attribute_map = { + 'adapter_id': {'key': 'adapterId', 'type': 'str'}, + 'adapter_position': {'key': 'adapterPosition', 'type': 'NetworkAdapterPosition'}, + 'index': {'key': 'index', 'type': 'int'}, + 'node_id': {'key': 'nodeId', 'type': 'str'}, + 'network_adapter_name': {'key': 'networkAdapterName', 'type': 'str'}, + 'label': {'key': 'label', 'type': 'str'}, + 'mac_address': {'key': 'macAddress', 'type': 'str'}, + 'link_speed': {'key': 'linkSpeed', 'type': 'long'}, + 'status': {'key': 'status', 'type': 'str'}, + 'rdma_status': {'key': 'rdmaStatus', 'type': 'str'}, + 'dhcp_status': {'key': 'dhcpStatus', 'type': 'str'}, + 'ipv4_configuration': {'key': 'ipv4Configuration', 'type': 'Ipv4Config'}, + 'ipv6_configuration': {'key': 'ipv6Configuration', 'type': 'Ipv6Config'}, + 'ipv6_link_local_address': {'key': 'ipv6LinkLocalAddress', 'type': 'str'}, + 'dns_servers': {'key': 'dnsServers', 'type': '[str]'}, + } + + def __init__( + self, + **kwargs + ): + super(NetworkAdapter, self).__init__(**kwargs) + self.adapter_id = None + self.adapter_position = None + self.index = None + self.node_id = None + self.network_adapter_name = None + self.label = None + self.mac_address = None + self.link_speed = None + self.status = None + self.rdma_status = kwargs.get('rdma_status', None) + self.dhcp_status = kwargs.get('dhcp_status', None) + self.ipv4_configuration = None + self.ipv6_configuration = None + self.ipv6_link_local_address = None + self.dns_servers = None + + +class NetworkAdapterPosition(msrest.serialization.Model): + """The network adapter position. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar network_group: The network group. Possible values include: "None", "NonRDMA", "RDMA". + :vartype network_group: str or ~data_box_edge_management_client.models.NetworkGroup + :ivar port: The port. + :vartype port: int + """ + + _validation = { + 'network_group': {'readonly': True}, + 'port': {'readonly': True}, + } + + _attribute_map = { + 'network_group': {'key': 'networkGroup', 'type': 'str'}, + 'port': {'key': 'port', 'type': 'int'}, + } + + def __init__( + self, + **kwargs + ): + super(NetworkAdapterPosition, self).__init__(**kwargs) + self.network_group = None + self.port = None + + +class NetworkSettings(ArmBaseModel): + """The network settings of a device. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: The path ID that uniquely identifies the object. + :vartype id: str + :ivar name: The object name. + :vartype name: str + :ivar type: The hierarchical type of the object. + :vartype type: str + :ivar system_data: NetworkSettings on ASE device. + :vartype system_data: ~data_box_edge_management_client.models.SystemData + :ivar network_adapters: The network adapter list on the device. + :vartype network_adapters: list[~data_box_edge_management_client.models.NetworkAdapter] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'system_data': {'readonly': True}, + 'network_adapters': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'network_adapters': {'key': 'properties.networkAdapters', 'type': '[NetworkAdapter]'}, + } + + def __init__( + self, + **kwargs + ): + super(NetworkSettings, self).__init__(**kwargs) + self.system_data = None + self.network_adapters = None + + +class Node(ArmBaseModel): + """Represents a single node in a Data box Edge/Gateway device +Gateway devices, standalone Edge devices and a single node cluster Edge device will all have 1 node +Multi-node Edge devices will have more than 1 nodes. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: The path ID that uniquely identifies the object. + :vartype id: str + :ivar name: The object name. + :vartype name: str + :ivar type: The hierarchical type of the object. + :vartype type: str + :ivar node_status: The current status of the individual node. Possible values include: + "Unknown", "Up", "Down", "Rebooting", "ShuttingDown". + :vartype node_status: str or ~data_box_edge_management_client.models.NodeStatus + :ivar node_chassis_serial_number: Serial number of the Chassis. + :vartype node_chassis_serial_number: str + :ivar node_serial_number: Serial number of the individual node. + :vartype node_serial_number: str + :ivar node_display_name: Display Name of the individual node. + :vartype node_display_name: str + :ivar node_friendly_software_version: Friendly software version name that is currently + installed on the node. + :vartype node_friendly_software_version: str + :ivar node_hcs_version: HCS version that is currently installed on the node. + :vartype node_hcs_version: str + :ivar node_instance_id: Guid instance id of the node. + :vartype node_instance_id: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'node_status': {'readonly': True}, + 'node_chassis_serial_number': {'readonly': True}, + 'node_serial_number': {'readonly': True}, + 'node_display_name': {'readonly': True}, + 'node_friendly_software_version': {'readonly': True}, + 'node_hcs_version': {'readonly': True}, + 'node_instance_id': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'node_status': {'key': 'properties.nodeStatus', 'type': 'str'}, + 'node_chassis_serial_number': {'key': 'properties.nodeChassisSerialNumber', 'type': 'str'}, + 'node_serial_number': {'key': 'properties.nodeSerialNumber', 'type': 'str'}, + 'node_display_name': {'key': 'properties.nodeDisplayName', 'type': 'str'}, + 'node_friendly_software_version': {'key': 'properties.nodeFriendlySoftwareVersion', 'type': 'str'}, + 'node_hcs_version': {'key': 'properties.nodeHcsVersion', 'type': 'str'}, + 'node_instance_id': {'key': 'properties.nodeInstanceId', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(Node, self).__init__(**kwargs) + self.node_status = None + self.node_chassis_serial_number = None + self.node_serial_number = None + self.node_display_name = None + self.node_friendly_software_version = None + self.node_hcs_version = None + self.node_instance_id = None + + +class NodeInfo(msrest.serialization.Model): + """Kubernetes node info. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar name: Node name. + :vartype name: str + :ivar type: Node type - Master/Worker. Possible values include: "Invalid", "Master", "Worker". + :vartype type: str or ~data_box_edge_management_client.models.KubernetesNodeType + :param ip_configuration: IP Configuration of the Kubernetes node. + :type ip_configuration: list[~data_box_edge_management_client.models.KubernetesIpConfiguration] + """ + + _validation = { + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'ip_configuration': {'key': 'ipConfiguration', 'type': '[KubernetesIpConfiguration]'}, + } + + def __init__( + self, + **kwargs + ): + super(NodeInfo, self).__init__(**kwargs) + self.name = None + self.type = None + self.ip_configuration = kwargs.get('ip_configuration', None) + + +class NodeList(msrest.serialization.Model): + """Collection of Nodes. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar value: The list of Nodes. + :vartype value: list[~data_box_edge_management_client.models.Node] + :ivar next_link: Link to the next set of results. + :vartype next_link: str + """ + + _validation = { + 'value': {'readonly': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[Node]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(NodeList, self).__init__(**kwargs) + self.value = None + self.next_link = None + + +class Operation(msrest.serialization.Model): + """Operations. + + :param name: Name of the operation. + :type name: str + :param is_data_action: Is data action. + :type is_data_action: bool + :param display: Properties displayed for the operation. + :type display: ~data_box_edge_management_client.models.OperationDisplay + :param origin: Origin of the operation. + :type origin: str + :param service_specification: Service specification. + :type service_specification: ~data_box_edge_management_client.models.ServiceSpecification + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'is_data_action': {'key': 'isDataAction', 'type': 'bool'}, + 'display': {'key': 'display', 'type': 'OperationDisplay'}, + 'origin': {'key': 'origin', 'type': 'str'}, + 'service_specification': {'key': 'properties.serviceSpecification', 'type': 'ServiceSpecification'}, + } + + def __init__( + self, + **kwargs + ): + super(Operation, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.is_data_action = kwargs.get('is_data_action', None) + self.display = kwargs.get('display', None) + self.origin = kwargs.get('origin', None) + self.service_specification = kwargs.get('service_specification', None) + + +class OperationDisplay(msrest.serialization.Model): + """Operation display properties. + + :param provider: Provider name. + :type provider: str + :param resource: The type of resource in which the operation is performed. + :type resource: str + :param operation: Operation to be performed on the resource. + :type operation: str + :param description: Description of the operation to be performed. + :type description: str + """ + + _attribute_map = { + 'provider': {'key': 'provider', 'type': 'str'}, + 'resource': {'key': 'resource', 'type': 'str'}, + 'operation': {'key': 'operation', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(OperationDisplay, self).__init__(**kwargs) + self.provider = kwargs.get('provider', None) + self.resource = kwargs.get('resource', None) + self.operation = kwargs.get('operation', None) + self.description = kwargs.get('description', None) + + +class OperationsList(msrest.serialization.Model): + """The list of operations used for the discovery of available provider operations. + + All required parameters must be populated in order to send to Azure. + + :param value: Required. The value. + :type value: list[~data_box_edge_management_client.models.Operation] + :param next_link: Link to the next set of results. + :type next_link: str + """ + + _validation = { + 'value': {'required': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[Operation]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(OperationsList, self).__init__(**kwargs) + self.value = kwargs['value'] + self.next_link = kwargs.get('next_link', None) + + +class Order(ArmBaseModel): + """The order details. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: The path ID that uniquely identifies the object. + :vartype id: str + :ivar name: The object name. + :vartype name: str + :ivar type: The hierarchical type of the object. + :vartype type: str + :ivar system_data: Order configured on ASE resource. + :vartype system_data: ~data_box_edge_management_client.models.SystemData + :param contact_information: The contact details. + :type contact_information: ~data_box_edge_management_client.models.ContactDetails + :param shipping_address: The shipping address. + :type shipping_address: ~data_box_edge_management_client.models.Address + :ivar current_status: Current status of the order. + :vartype current_status: ~data_box_edge_management_client.models.OrderStatus + :ivar order_history: List of status changes in the order. + :vartype order_history: list[~data_box_edge_management_client.models.OrderStatus] + :ivar serial_number: Serial number of the device. + :vartype serial_number: str + :ivar delivery_tracking_info: Tracking information for the package delivered to the customer + whether it has an original or a replacement device. + :vartype delivery_tracking_info: list[~data_box_edge_management_client.models.TrackingInfo] + :ivar return_tracking_info: Tracking information for the package returned from the customer + whether it has an original or a replacement device. + :vartype return_tracking_info: list[~data_box_edge_management_client.models.TrackingInfo] + :param shipment_type: ShipmentType of the order. Possible values include: "NotApplicable", + "ShippedToCustomer", "SelfPickup". + :type shipment_type: str or ~data_box_edge_management_client.models.ShipmentType + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'system_data': {'readonly': True}, + 'current_status': {'readonly': True}, + 'order_history': {'readonly': True}, + 'serial_number': {'readonly': True}, + 'delivery_tracking_info': {'readonly': True}, + 'return_tracking_info': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'contact_information': {'key': 'properties.contactInformation', 'type': 'ContactDetails'}, + 'shipping_address': {'key': 'properties.shippingAddress', 'type': 'Address'}, + 'current_status': {'key': 'properties.currentStatus', 'type': 'OrderStatus'}, + 'order_history': {'key': 'properties.orderHistory', 'type': '[OrderStatus]'}, + 'serial_number': {'key': 'properties.serialNumber', 'type': 'str'}, + 'delivery_tracking_info': {'key': 'properties.deliveryTrackingInfo', 'type': '[TrackingInfo]'}, + 'return_tracking_info': {'key': 'properties.returnTrackingInfo', 'type': '[TrackingInfo]'}, + 'shipment_type': {'key': 'properties.shipmentType', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(Order, self).__init__(**kwargs) + self.system_data = None + self.contact_information = kwargs.get('contact_information', None) + self.shipping_address = kwargs.get('shipping_address', None) + self.current_status = None + self.order_history = None + self.serial_number = None + self.delivery_tracking_info = None + self.return_tracking_info = None + self.shipment_type = kwargs.get('shipment_type', None) + + +class OrderList(msrest.serialization.Model): + """List of order entities. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar value: The list of orders. + :vartype value: list[~data_box_edge_management_client.models.Order] + :ivar next_link: Link to the next set of results. + :vartype next_link: str + """ + + _validation = { + 'value': {'readonly': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[Order]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(OrderList, self).__init__(**kwargs) + self.value = None + self.next_link = None + + +class OrderStatus(msrest.serialization.Model): + """Represents a single status change. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :param status: Required. Status of the order as per the allowed status types. Possible values + include: "Untracked", "AwaitingFulfillment", "AwaitingPreparation", "AwaitingShipment", + "Shipped", "Arriving", "Delivered", "ReplacementRequested", "LostDevice", "Declined", + "ReturnInitiated", "AwaitingReturnShipment", "ShippedBack", "CollectedAtMicrosoft", + "AwaitingPickup", "PickupCompleted", "AwaitingDrop". + :type status: str or ~data_box_edge_management_client.models.OrderState + :ivar update_date_time: Time of status update. + :vartype update_date_time: ~datetime.datetime + :param comments: Comments related to this status change. + :type comments: str + :ivar tracking_information: Tracking information related to the state in the ordering flow. + :vartype tracking_information: ~data_box_edge_management_client.models.TrackingInfo + :ivar additional_order_details: Dictionary to hold generic information which is not stored + by the already existing properties. + :vartype additional_order_details: dict[str, str] + """ + + _validation = { + 'status': {'required': True}, + 'update_date_time': {'readonly': True}, + 'tracking_information': {'readonly': True}, + 'additional_order_details': {'readonly': True}, + } + + _attribute_map = { + 'status': {'key': 'status', 'type': 'str'}, + 'update_date_time': {'key': 'updateDateTime', 'type': 'iso-8601'}, + 'comments': {'key': 'comments', 'type': 'str'}, + 'tracking_information': {'key': 'trackingInformation', 'type': 'TrackingInfo'}, + 'additional_order_details': {'key': 'additionalOrderDetails', 'type': '{str}'}, + } + + def __init__( + self, + **kwargs + ): + super(OrderStatus, self).__init__(**kwargs) + self.status = kwargs['status'] + self.update_date_time = None + self.comments = kwargs.get('comments', None) + self.tracking_information = None + self.additional_order_details = None + + +class PeriodicTimerEventTrigger(Trigger): + """Trigger details. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: The path ID that uniquely identifies the object. + :vartype id: str + :ivar name: The object name. + :vartype name: str + :ivar type: The hierarchical type of the object. + :vartype type: str + :ivar system_data: Trigger in DataBoxEdge Resource. + :vartype system_data: ~data_box_edge_management_client.models.SystemData + :param kind: Required. Trigger Kind.Constant filled by server. Possible values include: + "FileEvent", "PeriodicTimerEvent". + :type kind: str or ~data_box_edge_management_client.models.TriggerEventType + :param source_info: Required. Periodic timer details. + :type source_info: ~data_box_edge_management_client.models.PeriodicTimerSourceInfo + :param sink_info: Required. Role Sink information. + :type sink_info: ~data_box_edge_management_client.models.RoleSinkInfo + :param custom_context_tag: A custom context tag typically used to correlate the trigger against + its usage. For example, if a periodic timer trigger is intended for certain specific IoT + modules in the device, the tag can be the name or the image URL of the module. + :type custom_context_tag: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'system_data': {'readonly': True}, + 'kind': {'required': True}, + 'source_info': {'required': True}, + 'sink_info': {'required': True}, + 'custom_context_tag': {'max_length': 192, 'min_length': 0}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'source_info': {'key': 'properties.sourceInfo', 'type': 'PeriodicTimerSourceInfo'}, + 'sink_info': {'key': 'properties.sinkInfo', 'type': 'RoleSinkInfo'}, + 'custom_context_tag': {'key': 'properties.customContextTag', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(PeriodicTimerEventTrigger, self).__init__(**kwargs) + self.kind = 'PeriodicTimerEvent' # type: str + self.source_info = kwargs['source_info'] + self.sink_info = kwargs['sink_info'] + self.custom_context_tag = kwargs.get('custom_context_tag', None) + + +class PeriodicTimerSourceInfo(msrest.serialization.Model): + """Periodic timer event source. + + All required parameters must be populated in order to send to Azure. + + :param start_time: Required. The time of the day that results in a valid trigger. Schedule is + computed with reference to the time specified upto seconds. If timezone is not specified the + time will considered to be in device timezone. The value will always be returned as UTC time. + :type start_time: ~datetime.datetime + :param schedule: Required. Periodic frequency at which timer event needs to be raised. Supports + daily, hourly, minutes, and seconds. + :type schedule: str + :param topic: Topic where periodic events are published to IoT device. + :type topic: str + """ + + _validation = { + 'start_time': {'required': True}, + 'schedule': {'required': True}, + } + + _attribute_map = { + 'start_time': {'key': 'startTime', 'type': 'iso-8601'}, + 'schedule': {'key': 'schedule', 'type': 'str'}, + 'topic': {'key': 'topic', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(PeriodicTimerSourceInfo, self).__init__(**kwargs) + self.start_time = kwargs['start_time'] + self.schedule = kwargs['schedule'] + self.topic = kwargs.get('topic', None) + + +class RefreshDetails(msrest.serialization.Model): + """Fields for tracking refresh job on the share or container. + + :param in_progress_refresh_job_id: If a refresh job is currently in progress on this share or + container, this field indicates the ARM resource ID of that job. The field is empty if no job + is in progress. + :type in_progress_refresh_job_id: str + :param last_completed_refresh_job_time_in_utc: Indicates the completed time for the last + refresh job on this particular share or container, if any.This could be a failed job or a + successful job. + :type last_completed_refresh_job_time_in_utc: ~datetime.datetime + :param error_manifest_file: Indicates the relative path of the error xml for the last refresh + job on this particular share or container, if any. This could be a failed job or a successful + job. + :type error_manifest_file: str + :param last_job: Indicates the id of the last refresh job on this particular share or + container,if any. This could be a failed job or a successful job. + :type last_job: str + """ + + _attribute_map = { + 'in_progress_refresh_job_id': {'key': 'inProgressRefreshJobId', 'type': 'str'}, + 'last_completed_refresh_job_time_in_utc': {'key': 'lastCompletedRefreshJobTimeInUTC', 'type': 'iso-8601'}, + 'error_manifest_file': {'key': 'errorManifestFile', 'type': 'str'}, + 'last_job': {'key': 'lastJob', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(RefreshDetails, self).__init__(**kwargs) + self.in_progress_refresh_job_id = kwargs.get('in_progress_refresh_job_id', None) + self.last_completed_refresh_job_time_in_utc = kwargs.get('last_completed_refresh_job_time_in_utc', None) + self.error_manifest_file = kwargs.get('error_manifest_file', None) + self.last_job = kwargs.get('last_job', None) + + +class RemoteSupportSettings(msrest.serialization.Model): + """RemoteApplicationType for which remote support settings is being modified. + + :param remote_application_type: Remote application type. Possible values include: "Powershell", + "WAC", "LocalUI", "AllApplications". + :type remote_application_type: str or + ~data_box_edge_management_client.models.RemoteApplicationType + :param access_level: Access level allowed for this remote application type. Possible values + include: "None", "ReadOnly", "ReadWrite", "FullAccess". + :type access_level: str or ~data_box_edge_management_client.models.AccessLevel + :param expiration_time_stamp_in_utc: Expiration time stamp. + :type expiration_time_stamp_in_utc: ~datetime.datetime + """ + + _attribute_map = { + 'remote_application_type': {'key': 'remoteApplicationType', 'type': 'str'}, + 'access_level': {'key': 'accessLevel', 'type': 'str'}, + 'expiration_time_stamp_in_utc': {'key': 'expirationTimeStampInUTC', 'type': 'iso-8601'}, + } + + def __init__( + self, + **kwargs + ): + super(RemoteSupportSettings, self).__init__(**kwargs) + self.remote_application_type = kwargs.get('remote_application_type', None) + self.access_level = kwargs.get('access_level', None) + self.expiration_time_stamp_in_utc = kwargs.get('expiration_time_stamp_in_utc', None) + + +class ResourceIdentity(msrest.serialization.Model): + """Msi identity details of the resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param type: Identity type. Possible values include: "None", "SystemAssigned", "UserAssigned". + :type type: str or ~data_box_edge_management_client.models.MsiIdentityType + :ivar principal_id: Service Principal Id backing the Msi. + :vartype principal_id: str + :ivar tenant_id: Home Tenant Id. + :vartype tenant_id: str + """ + + _validation = { + 'principal_id': {'readonly': True}, + 'tenant_id': {'readonly': True}, + } + + _attribute_map = { + 'type': {'key': 'type', 'type': 'str'}, + 'principal_id': {'key': 'principalId', 'type': 'str'}, + 'tenant_id': {'key': 'tenantId', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ResourceIdentity, self).__init__(**kwargs) + self.type = kwargs.get('type', None) + self.principal_id = None + self.tenant_id = None + + +class ResourceMoveDetails(msrest.serialization.Model): + """Fields for tracking resource move. + + :param operation_in_progress: Denotes whether move operation is in progress. Possible values + include: "None", "ResourceMoveInProgress", "ResourceMoveFailed". + :type operation_in_progress: str or ~data_box_edge_management_client.models.ResourceMoveStatus + :param operation_in_progress_lock_timeout_in_utc: Denotes the timeout of the operation to + finish. + :type operation_in_progress_lock_timeout_in_utc: ~datetime.datetime + """ + + _attribute_map = { + 'operation_in_progress': {'key': 'operationInProgress', 'type': 'str'}, + 'operation_in_progress_lock_timeout_in_utc': {'key': 'operationInProgressLockTimeoutInUTC', 'type': 'iso-8601'}, + } + + def __init__( + self, + **kwargs + ): + super(ResourceMoveDetails, self).__init__(**kwargs) + self.operation_in_progress = kwargs.get('operation_in_progress', None) + self.operation_in_progress_lock_timeout_in_utc = kwargs.get('operation_in_progress_lock_timeout_in_utc', None) + + +class ResourceTypeSku(msrest.serialization.Model): + """Resource type Sku object. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar resource_type: The resource type. + :vartype resource_type: str + :ivar skus: The skus. + :vartype skus: list[~data_box_edge_management_client.models.SkuInformation] + """ + + _validation = { + 'resource_type': {'readonly': True}, + 'skus': {'readonly': True}, + } + + _attribute_map = { + 'resource_type': {'key': 'resourceType', 'type': 'str'}, + 'skus': {'key': 'skus', 'type': '[SkuInformation]'}, + } + + def __init__( + self, + **kwargs + ): + super(ResourceTypeSku, self).__init__(**kwargs) + self.resource_type = None + self.skus = None + + +class RoleList(msrest.serialization.Model): + """Collection of all the roles on the Data Box Edge device. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar value: The Value. + :vartype value: list[~data_box_edge_management_client.models.Role] + :ivar next_link: Link to the next set of results. + :vartype next_link: str + """ + + _validation = { + 'value': {'readonly': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[Role]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(RoleList, self).__init__(**kwargs) + self.value = None + self.next_link = None + + +class RoleSinkInfo(msrest.serialization.Model): + """Compute role against which events will be raised. + + All required parameters must be populated in order to send to Azure. + + :param role_id: Required. Compute role ID. + :type role_id: str + """ + + _validation = { + 'role_id': {'required': True}, + } + + _attribute_map = { + 'role_id': {'key': 'roleId', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(RoleSinkInfo, self).__init__(**kwargs) + self.role_id = kwargs['role_id'] + + +class Secret(msrest.serialization.Model): + """Holds device secret either as a KeyVault reference or as an encrypted value. + + :param encrypted_secret: Encrypted (using device public key) secret value. + :type encrypted_secret: ~data_box_edge_management_client.models.AsymmetricEncryptedSecret + :param key_vault_id: Id of the Key-Vault where secret is stored (ex: + secrets/AuthClientSecret/82ef4346187a4033a10d629cde07d740). + :type key_vault_id: str + """ + + _attribute_map = { + 'encrypted_secret': {'key': 'encryptedSecret', 'type': 'AsymmetricEncryptedSecret'}, + 'key_vault_id': {'key': 'keyVaultId', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(Secret, self).__init__(**kwargs) + self.encrypted_secret = kwargs.get('encrypted_secret', None) + self.key_vault_id = kwargs.get('key_vault_id', None) + + +class SecuritySettings(ArmBaseModel): + """The security settings of a device. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: The path ID that uniquely identifies the object. + :vartype id: str + :ivar name: The object name. + :vartype name: str + :ivar type: The hierarchical type of the object. + :vartype type: str + :param device_admin_password: Required. Device administrator password as an encrypted string + (encrypted using RSA PKCS #1) is used to sign into the local web UI of the device. The Actual + password should have at least 8 characters that are a combination of uppercase, lowercase, + numeric, and special characters. + :type device_admin_password: ~data_box_edge_management_client.models.AsymmetricEncryptedSecret + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'device_admin_password': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'device_admin_password': {'key': 'properties.deviceAdminPassword', 'type': 'AsymmetricEncryptedSecret'}, + } + + def __init__( + self, + **kwargs + ): + super(SecuritySettings, self).__init__(**kwargs) + self.device_admin_password = kwargs['device_admin_password'] + + +class ServiceSpecification(msrest.serialization.Model): + """Service specification. + + :param metric_specifications: Metric specification as defined by shoebox. + :type metric_specifications: + list[~data_box_edge_management_client.models.MetricSpecificationV1] + """ + + _attribute_map = { + 'metric_specifications': {'key': 'metricSpecifications', 'type': '[MetricSpecificationV1]'}, + } + + def __init__( + self, + **kwargs + ): + super(ServiceSpecification, self).__init__(**kwargs) + self.metric_specifications = kwargs.get('metric_specifications', None) + + +class Share(ArmBaseModel): + """Represents a share on the Data Box Edge/Gateway device. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: The path ID that uniquely identifies the object. + :vartype id: str + :ivar name: The object name. + :vartype name: str + :ivar type: The hierarchical type of the object. + :vartype type: str + :ivar system_data: Share on ASE device. + :vartype system_data: ~data_box_edge_management_client.models.SystemData + :param description: Description for the share. + :type description: str + :param share_status: Required. Current status of the share. Possible values include: "Offline", + "Unknown", "OK", "Updating", "NeedsAttention". + :type share_status: str or ~data_box_edge_management_client.models.ShareStatus + :param monitoring_status: Required. Current monitoring status of the share. Possible values + include: "Enabled", "Disabled". + :type monitoring_status: str or ~data_box_edge_management_client.models.MonitoringStatus + :param azure_container_info: Azure container mapping for the share. + :type azure_container_info: ~data_box_edge_management_client.models.AzureContainerInfo + :param access_protocol: Required. Access protocol to be used by the share. Possible values + include: "SMB", "NFS". + :type access_protocol: str or ~data_box_edge_management_client.models.ShareAccessProtocol + :param user_access_rights: Mapping of users and corresponding access rights on the share + (required for SMB protocol). + :type user_access_rights: list[~data_box_edge_management_client.models.UserAccessRight] + :param client_access_rights: List of IP addresses and corresponding access rights on the + share(required for NFS protocol). + :type client_access_rights: list[~data_box_edge_management_client.models.ClientAccessRight] + :param refresh_details: Details of the refresh job on this share. + :type refresh_details: ~data_box_edge_management_client.models.RefreshDetails + :ivar share_mappings: Share mount point to the role. + :vartype share_mappings: list[~data_box_edge_management_client.models.MountPointMap] + :param data_policy: Data policy of the share. Possible values include: "Cloud", "Local". + :type data_policy: str or ~data_box_edge_management_client.models.DataPolicy + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'system_data': {'readonly': True}, + 'share_status': {'required': True}, + 'monitoring_status': {'required': True}, + 'access_protocol': {'required': True}, + 'share_mappings': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + 'share_status': {'key': 'properties.shareStatus', 'type': 'str'}, + 'monitoring_status': {'key': 'properties.monitoringStatus', 'type': 'str'}, + 'azure_container_info': {'key': 'properties.azureContainerInfo', 'type': 'AzureContainerInfo'}, + 'access_protocol': {'key': 'properties.accessProtocol', 'type': 'str'}, + 'user_access_rights': {'key': 'properties.userAccessRights', 'type': '[UserAccessRight]'}, + 'client_access_rights': {'key': 'properties.clientAccessRights', 'type': '[ClientAccessRight]'}, + 'refresh_details': {'key': 'properties.refreshDetails', 'type': 'RefreshDetails'}, + 'share_mappings': {'key': 'properties.shareMappings', 'type': '[MountPointMap]'}, + 'data_policy': {'key': 'properties.dataPolicy', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(Share, self).__init__(**kwargs) + self.system_data = None + self.description = kwargs.get('description', None) + self.share_status = kwargs['share_status'] + self.monitoring_status = kwargs['monitoring_status'] + self.azure_container_info = kwargs.get('azure_container_info', None) + self.access_protocol = kwargs['access_protocol'] + self.user_access_rights = kwargs.get('user_access_rights', None) + self.client_access_rights = kwargs.get('client_access_rights', None) + self.refresh_details = kwargs.get('refresh_details', None) + self.share_mappings = None + self.data_policy = kwargs.get('data_policy', None) + + +class ShareAccessRight(msrest.serialization.Model): + """Specifies the mapping between this particular user and the type of access he has on shares on this device. + + All required parameters must be populated in order to send to Azure. + + :param share_id: Required. The share ID. + :type share_id: str + :param access_type: Required. Type of access to be allowed on the share for this user. Possible + values include: "Change", "Read", "Custom". + :type access_type: str or ~data_box_edge_management_client.models.ShareAccessType + """ + + _validation = { + 'share_id': {'required': True}, + 'access_type': {'required': True}, + } + + _attribute_map = { + 'share_id': {'key': 'shareId', 'type': 'str'}, + 'access_type': {'key': 'accessType', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ShareAccessRight, self).__init__(**kwargs) + self.share_id = kwargs['share_id'] + self.access_type = kwargs['access_type'] + + +class ShareList(msrest.serialization.Model): + """Collection of all the shares on the Data Box Edge/Gateway device. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar value: The list of shares. + :vartype value: list[~data_box_edge_management_client.models.Share] + :ivar next_link: Link to the next set of results. + :vartype next_link: str + """ + + _validation = { + 'value': {'readonly': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[Share]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ShareList, self).__init__(**kwargs) + self.value = None + self.next_link = None + + +class Sku(msrest.serialization.Model): + """The SKU type. + + :param name: SKU name. Possible values include: "Gateway", "Edge", "TEA_1Node", + "TEA_1Node_UPS", "TEA_1Node_Heater", "TEA_1Node_UPS_Heater", "TEA_4Node_Heater", + "TEA_4Node_UPS_Heater", "TMA", "TDC", "TCA_Small", "GPU", "TCA_Large", "EdgeP_Base", + "EdgeP_High", "EdgePR_Base", "EdgePR_Base_UPS", "EP2_64_1VPU_W", "EP2_128_1T4_Mx1_W", + "EP2_256_2T4_W", "EdgeMR_Mini", "RCA_Small", "RCA_Large", "RDC", "Management". + :type name: str or ~data_box_edge_management_client.models.SkuName + :param tier: The SKU tier. This is based on the SKU name. Possible values include: "Standard". + :type tier: str or ~data_box_edge_management_client.models.SkuTier + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'tier': {'key': 'tier', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(Sku, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.tier = kwargs.get('tier', None) + + +class SkuCapability(msrest.serialization.Model): + """The metadata to describe the capability. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar name: An invariant to describe the feature. + :vartype name: str + :ivar value: An invariant if the feature is measured by quantity. + :vartype value: str + """ + + _validation = { + 'name': {'readonly': True}, + 'value': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'value': {'key': 'value', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(SkuCapability, self).__init__(**kwargs) + self.name = None + self.value = None + + +class SkuCost(msrest.serialization.Model): + """The metadata for retrieving price info. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar meter_id: Used for querying price from commerce. + :vartype meter_id: str + :ivar quantity: The cost quantity. + :vartype quantity: long + :ivar extended_unit: The extended unit. + :vartype extended_unit: str + """ + + _validation = { + 'meter_id': {'readonly': True}, + 'quantity': {'readonly': True}, + 'extended_unit': {'readonly': True}, + } + + _attribute_map = { + 'meter_id': {'key': 'meterId', 'type': 'str'}, + 'quantity': {'key': 'quantity', 'type': 'long'}, + 'extended_unit': {'key': 'extendedUnit', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(SkuCost, self).__init__(**kwargs) + self.meter_id = None + self.quantity = None + self.extended_unit = None + + +class SkuInformation(msrest.serialization.Model): + """Sku information. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar name: The sku name. + :vartype name: str + :ivar tier: The sku tier. + :vartype tier: str + :ivar kind: The sku kind. + :vartype kind: str + :ivar family: The Sku family. + :vartype family: str + :ivar costs: The pricing info of the Sku. + :vartype costs: list[~data_box_edge_management_client.models.SkuCost] + :ivar locations: The locations where Sku is available. + :vartype locations: list[str] + :ivar location_info: The locations where Sku is available with zones and sites info. + :vartype location_info: list[~data_box_edge_management_client.models.SkuLocationInfo] + :ivar required_quota_ids: The required quotaIds for the sku to be available. + :vartype required_quota_ids: list[str] + :ivar required_features: The required features for the sku to be available. + :vartype required_features: list[str] + """ + + _validation = { + 'name': {'readonly': True}, + 'tier': {'readonly': True}, + 'kind': {'readonly': True}, + 'family': {'readonly': True}, + 'costs': {'readonly': True}, + 'locations': {'readonly': True}, + 'location_info': {'readonly': True}, + 'required_quota_ids': {'readonly': True}, + 'required_features': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'tier': {'key': 'tier', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'family': {'key': 'family', 'type': 'str'}, + 'costs': {'key': 'costs', 'type': '[SkuCost]'}, + 'locations': {'key': 'locations', 'type': '[str]'}, + 'location_info': {'key': 'locationInfo', 'type': '[SkuLocationInfo]'}, + 'required_quota_ids': {'key': 'requiredQuotaIds', 'type': '[str]'}, + 'required_features': {'key': 'requiredFeatures', 'type': '[str]'}, + } + + def __init__( + self, + **kwargs + ): + super(SkuInformation, self).__init__(**kwargs) + self.name = None + self.tier = None + self.kind = None + self.family = None + self.costs = None + self.locations = None + self.location_info = None + self.required_quota_ids = None + self.required_features = None + + +class SkuInformationList(msrest.serialization.Model): + """List of SKU Information objects. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar value: List of ResourceTypeSku objects. + :vartype value: list[~data_box_edge_management_client.models.ResourceTypeSku] + :ivar next_link: Links to the next set of results. + :vartype next_link: str + """ + + _validation = { + 'value': {'readonly': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[ResourceTypeSku]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(SkuInformationList, self).__init__(**kwargs) + self.value = None + self.next_link = None + + +class SkuLocationInfo(msrest.serialization.Model): + """The location info. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar location: The location. + :vartype location: str + :ivar zones: The zones. + :vartype zones: list[str] + :ivar sites: The sites. + :vartype sites: list[str] + """ + + _validation = { + 'location': {'readonly': True}, + 'zones': {'readonly': True}, + 'sites': {'readonly': True}, + } + + _attribute_map = { + 'location': {'key': 'location', 'type': 'str'}, + 'zones': {'key': 'zones', 'type': '[str]'}, + 'sites': {'key': 'sites', 'type': '[str]'}, + } + + def __init__( + self, + **kwargs + ): + super(SkuLocationInfo, self).__init__(**kwargs) + self.location = None + self.zones = None + self.sites = None + + +class StorageAccount(ArmBaseModel): + """Represents a Storage Account on the Data Box Edge/Gateway device. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: The path ID that uniquely identifies the object. + :vartype id: str + :ivar name: The object name. + :vartype name: str + :ivar type: The hierarchical type of the object. + :vartype type: str + :ivar system_data: StorageAccount object on ASE device. + :vartype system_data: ~data_box_edge_management_client.models.SystemData + :param description: Description for the storage Account. + :type description: str + :param storage_account_status: Current status of the storage account. Possible values include: + "OK", "Offline", "Unknown", "Updating", "NeedsAttention". + :type storage_account_status: str or + ~data_box_edge_management_client.models.StorageAccountStatus + :param data_policy: Required. Data policy of the storage Account. Possible values include: + "Cloud", "Local". + :type data_policy: str or ~data_box_edge_management_client.models.DataPolicy + :param storage_account_credential_id: Storage Account Credential Id. + :type storage_account_credential_id: str + :ivar blob_endpoint: BlobEndpoint of Storage Account. + :vartype blob_endpoint: str + :ivar container_count: The Container Count. Present only for Storage Accounts with DataPolicy + set to Cloud. + :vartype container_count: int + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'system_data': {'readonly': True}, + 'data_policy': {'required': True}, + 'blob_endpoint': {'readonly': True}, + 'container_count': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + 'storage_account_status': {'key': 'properties.storageAccountStatus', 'type': 'str'}, + 'data_policy': {'key': 'properties.dataPolicy', 'type': 'str'}, + 'storage_account_credential_id': {'key': 'properties.storageAccountCredentialId', 'type': 'str'}, + 'blob_endpoint': {'key': 'properties.blobEndpoint', 'type': 'str'}, + 'container_count': {'key': 'properties.containerCount', 'type': 'int'}, + } + + def __init__( + self, + **kwargs + ): + super(StorageAccount, self).__init__(**kwargs) + self.system_data = None + self.description = kwargs.get('description', None) + self.storage_account_status = kwargs.get('storage_account_status', None) + self.data_policy = kwargs['data_policy'] + self.storage_account_credential_id = kwargs.get('storage_account_credential_id', None) + self.blob_endpoint = None + self.container_count = None + + +class StorageAccountCredential(ArmBaseModel): + """The storage account credential. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: The path ID that uniquely identifies the object. + :vartype id: str + :ivar name: The object name. + :vartype name: str + :ivar type: The hierarchical type of the object. + :vartype type: str + :ivar system_data: StorageAccountCredential object. + :vartype system_data: ~data_box_edge_management_client.models.SystemData + :param alias: Required. Alias for the storage account. + :type alias: str + :param user_name: Username for the storage account. + :type user_name: str + :param account_key: Encrypted storage key. + :type account_key: ~data_box_edge_management_client.models.AsymmetricEncryptedSecret + :param connection_string: Connection string for the storage account. Use this string if + username and account key are not specified. + :type connection_string: str + :param ssl_status: Required. Signifies whether SSL needs to be enabled or not. Possible values + include: "Enabled", "Disabled". + :type ssl_status: str or ~data_box_edge_management_client.models.SslStatus + :param blob_domain_name: Blob end point for private clouds. + :type blob_domain_name: str + :param account_type: Required. Type of storage accessed on the storage account. Possible values + include: "GeneralPurposeStorage", "BlobStorage". + :type account_type: str or ~data_box_edge_management_client.models.AccountType + :param storage_account_id: Id of the storage account. + :type storage_account_id: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'system_data': {'readonly': True}, + 'alias': {'required': True}, + 'ssl_status': {'required': True}, + 'account_type': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'alias': {'key': 'properties.alias', 'type': 'str'}, + 'user_name': {'key': 'properties.userName', 'type': 'str'}, + 'account_key': {'key': 'properties.accountKey', 'type': 'AsymmetricEncryptedSecret'}, + 'connection_string': {'key': 'properties.connectionString', 'type': 'str'}, + 'ssl_status': {'key': 'properties.sslStatus', 'type': 'str'}, + 'blob_domain_name': {'key': 'properties.blobDomainName', 'type': 'str'}, + 'account_type': {'key': 'properties.accountType', 'type': 'str'}, + 'storage_account_id': {'key': 'properties.storageAccountId', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(StorageAccountCredential, self).__init__(**kwargs) + self.system_data = None + self.alias = kwargs['alias'] + self.user_name = kwargs.get('user_name', None) + self.account_key = kwargs.get('account_key', None) + self.connection_string = kwargs.get('connection_string', None) + self.ssl_status = kwargs['ssl_status'] + self.blob_domain_name = kwargs.get('blob_domain_name', None) + self.account_type = kwargs['account_type'] + self.storage_account_id = kwargs.get('storage_account_id', None) + + +class StorageAccountCredentialList(msrest.serialization.Model): + """The collection of storage account credentials. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar value: The value. + :vartype value: list[~data_box_edge_management_client.models.StorageAccountCredential] + :ivar next_link: Link to the next set of results. + :vartype next_link: str + """ + + _validation = { + 'value': {'readonly': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[StorageAccountCredential]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(StorageAccountCredentialList, self).__init__(**kwargs) + self.value = None + self.next_link = None + + +class StorageAccountList(msrest.serialization.Model): + """Collection of all the Storage Accounts on the Data Box Edge/Gateway device. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar value: The list of storageAccounts. + :vartype value: list[~data_box_edge_management_client.models.StorageAccount] + :ivar next_link: Link to the next set of results. + :vartype next_link: str + """ + + _validation = { + 'value': {'readonly': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[StorageAccount]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(StorageAccountList, self).__init__(**kwargs) + self.value = None + self.next_link = None + + +class SubscriptionRegisteredFeatures(msrest.serialization.Model): + """SubscriptionRegisteredFeatures. + + :param name: + :type name: str + :param state: + :type state: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'state': {'key': 'state', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(SubscriptionRegisteredFeatures, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.state = kwargs.get('state', None) + + +class SymmetricKey(msrest.serialization.Model): + """Symmetric key for authentication. + + :param connection_string: Connection string based on the symmetric key. + :type connection_string: ~data_box_edge_management_client.models.AsymmetricEncryptedSecret + """ + + _attribute_map = { + 'connection_string': {'key': 'connectionString', 'type': 'AsymmetricEncryptedSecret'}, + } + + def __init__( + self, + **kwargs + ): + super(SymmetricKey, self).__init__(**kwargs) + self.connection_string = kwargs.get('connection_string', None) + + +class SystemData(msrest.serialization.Model): + """Metadata pertaining to creation and last modification of the resource. + + :param created_by: The identity that created the resource. + :type created_by: str + :param created_by_type: The type of identity that created the resource. Possible values + include: "User", "Application", "ManagedIdentity", "Key". + :type created_by_type: str or ~data_box_edge_management_client.models.CreatedByType + :param created_at: The timestamp of resource creation (UTC). + :type created_at: ~datetime.datetime + :param last_modified_by: The identity that last modified the resource. + :type last_modified_by: str + :param last_modified_by_type: The type of identity that last modified the resource. Possible + values include: "User", "Application", "ManagedIdentity", "Key". + :type last_modified_by_type: str or ~data_box_edge_management_client.models.CreatedByType + :param last_modified_at: The type of identity that last modified the resource. + :type last_modified_at: ~datetime.datetime + """ + + _attribute_map = { + 'created_by': {'key': 'createdBy', 'type': 'str'}, + 'created_by_type': {'key': 'createdByType', 'type': 'str'}, + 'created_at': {'key': 'createdAt', 'type': 'iso-8601'}, + 'last_modified_by': {'key': 'lastModifiedBy', 'type': 'str'}, + 'last_modified_by_type': {'key': 'lastModifiedByType', 'type': 'str'}, + 'last_modified_at': {'key': 'lastModifiedAt', 'type': 'iso-8601'}, + } + + def __init__( + self, + **kwargs + ): + super(SystemData, self).__init__(**kwargs) + self.created_by = kwargs.get('created_by', None) + self.created_by_type = kwargs.get('created_by_type', None) + self.created_at = kwargs.get('created_at', None) + self.last_modified_by = kwargs.get('last_modified_by', None) + self.last_modified_by_type = kwargs.get('last_modified_by_type', None) + self.last_modified_at = kwargs.get('last_modified_at', None) + + +class TrackingInfo(msrest.serialization.Model): + """Tracking courier information. + + :param serial_number: Serial number of the device being tracked. + :type serial_number: str + :param carrier_name: Name of the carrier used in the delivery. + :type carrier_name: str + :param tracking_id: Tracking ID of the shipment. + :type tracking_id: str + :param tracking_url: Tracking URL of the shipment. + :type tracking_url: str + """ + + _attribute_map = { + 'serial_number': {'key': 'serialNumber', 'type': 'str'}, + 'carrier_name': {'key': 'carrierName', 'type': 'str'}, + 'tracking_id': {'key': 'trackingId', 'type': 'str'}, + 'tracking_url': {'key': 'trackingUrl', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(TrackingInfo, self).__init__(**kwargs) + self.serial_number = kwargs.get('serial_number', None) + self.carrier_name = kwargs.get('carrier_name', None) + self.tracking_id = kwargs.get('tracking_id', None) + self.tracking_url = kwargs.get('tracking_url', None) + + +class TriggerList(msrest.serialization.Model): + """Collection of all trigger on the data box edge device. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar value: The list of triggers. + :vartype value: list[~data_box_edge_management_client.models.Trigger] + :ivar next_link: Link to the next set of results. + :vartype next_link: str + """ + + _validation = { + 'value': {'readonly': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[Trigger]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(TriggerList, self).__init__(**kwargs) + self.value = None + self.next_link = None + + +class TriggerSupportPackageRequest(ArmBaseModel): + """The request object for trigger support package. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: The path ID that uniquely identifies the object. + :vartype id: str + :ivar name: The object name. + :vartype name: str + :ivar type: The hierarchical type of the object. + :vartype type: str + :param minimum_time_stamp: MinimumTimeStamp from where logs need to be collected. + :type minimum_time_stamp: ~datetime.datetime + :param maximum_time_stamp: MaximumTimeStamp until where logs need to be collected. + :type maximum_time_stamp: ~datetime.datetime + :param include: Type of files, which need to be included in the logs + This will contain the type of logs (Default/DefaultWithDumps/None/All/DefaultWithArchived) + or a comma separated list of log types that are required. + :type include: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'minimum_time_stamp': {'key': 'properties.minimumTimeStamp', 'type': 'iso-8601'}, + 'maximum_time_stamp': {'key': 'properties.maximumTimeStamp', 'type': 'iso-8601'}, + 'include': {'key': 'properties.include', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(TriggerSupportPackageRequest, self).__init__(**kwargs) + self.minimum_time_stamp = kwargs.get('minimum_time_stamp', None) + self.maximum_time_stamp = kwargs.get('maximum_time_stamp', None) + self.include = kwargs.get('include', None) + + +class UpdateDetails(msrest.serialization.Model): + """Update Specific attributes. + + :param update_title: Title of the Update. + :type update_title: str + :param update_size: Size of the update(In Bytes). + :type update_size: float + :param update_type: Type of the Update. Possible values include: "Software", "Kubernetes", + "Firmware". + :type update_type: str or ~data_box_edge_management_client.models.UpdateType + :param target_version: Target Version number. + :type target_version: str + :param friendly_version_number: Friendly Version Number. + :type friendly_version_number: str + :param estimated_install_time_in_mins: Estimated Install Time for the update. + :type estimated_install_time_in_mins: int + :param reboot_behavior: Indicates if updates are available and at least one of the updates + needs a reboot. Possible values include: "NeverReboots", "RequiresReboot", "RequestReboot". + :type reboot_behavior: str or ~data_box_edge_management_client.models.InstallRebootBehavior + :param installation_impact: Impact of Installing an updateType. Possible values include: + "None", "DeviceRebooted", "KubernetesWorkloadsDown". + :type installation_impact: str or ~data_box_edge_management_client.models.InstallationImpact + :param status: Status of the update. Possible values include: "DownloadPending", + "DownloadStarted", "DownloadCompleted", "InstallStarted", "InstallCompleted". + :type status: str or ~data_box_edge_management_client.models.UpdateStatus + """ + + _attribute_map = { + 'update_title': {'key': 'updateTitle', 'type': 'str'}, + 'update_size': {'key': 'updateSize', 'type': 'float'}, + 'update_type': {'key': 'updateType', 'type': 'str'}, + 'target_version': {'key': 'targetVersion', 'type': 'str'}, + 'friendly_version_number': {'key': 'friendlyVersionNumber', 'type': 'str'}, + 'estimated_install_time_in_mins': {'key': 'estimatedInstallTimeInMins', 'type': 'int'}, + 'reboot_behavior': {'key': 'rebootBehavior', 'type': 'str'}, + 'installation_impact': {'key': 'installationImpact', 'type': 'str'}, + 'status': {'key': 'status', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(UpdateDetails, self).__init__(**kwargs) + self.update_title = kwargs.get('update_title', None) + self.update_size = kwargs.get('update_size', None) + self.update_type = kwargs.get('update_type', None) + self.target_version = kwargs.get('target_version', None) + self.friendly_version_number = kwargs.get('friendly_version_number', None) + self.estimated_install_time_in_mins = kwargs.get('estimated_install_time_in_mins', None) + self.reboot_behavior = kwargs.get('reboot_behavior', None) + self.installation_impact = kwargs.get('installation_impact', None) + self.status = kwargs.get('status', None) + + +class UpdateDownloadProgress(msrest.serialization.Model): + """Details about the download progress of update. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar download_phase: The download phase. Possible values include: "Unknown", "Initializing", + "Downloading", "Verifying". + :vartype download_phase: str or ~data_box_edge_management_client.models.DownloadPhase + :ivar percent_complete: Percentage of completion. + :vartype percent_complete: int + :ivar total_bytes_to_download: Total bytes to download. + :vartype total_bytes_to_download: float + :ivar total_bytes_downloaded: Total bytes downloaded. + :vartype total_bytes_downloaded: float + :ivar number_of_updates_to_download: Number of updates to download. + :vartype number_of_updates_to_download: int + :ivar number_of_updates_downloaded: Number of updates downloaded. + :vartype number_of_updates_downloaded: int + """ + + _validation = { + 'download_phase': {'readonly': True}, + 'percent_complete': {'readonly': True}, + 'total_bytes_to_download': {'readonly': True}, + 'total_bytes_downloaded': {'readonly': True}, + 'number_of_updates_to_download': {'readonly': True}, + 'number_of_updates_downloaded': {'readonly': True}, + } + + _attribute_map = { + 'download_phase': {'key': 'downloadPhase', 'type': 'str'}, + 'percent_complete': {'key': 'percentComplete', 'type': 'int'}, + 'total_bytes_to_download': {'key': 'totalBytesToDownload', 'type': 'float'}, + 'total_bytes_downloaded': {'key': 'totalBytesDownloaded', 'type': 'float'}, + 'number_of_updates_to_download': {'key': 'numberOfUpdatesToDownload', 'type': 'int'}, + 'number_of_updates_downloaded': {'key': 'numberOfUpdatesDownloaded', 'type': 'int'}, + } + + def __init__( + self, + **kwargs + ): + super(UpdateDownloadProgress, self).__init__(**kwargs) + self.download_phase = None + self.percent_complete = None + self.total_bytes_to_download = None + self.total_bytes_downloaded = None + self.number_of_updates_to_download = None + self.number_of_updates_downloaded = None + + +class UpdateInstallProgress(msrest.serialization.Model): + """Progress details during installation of updates. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar percent_complete: Percentage completed. + :vartype percent_complete: int + :ivar number_of_updates_to_install: Number of updates to install. + :vartype number_of_updates_to_install: int + :ivar number_of_updates_installed: Number of updates installed. + :vartype number_of_updates_installed: int + """ + + _validation = { + 'percent_complete': {'readonly': True}, + 'number_of_updates_to_install': {'readonly': True}, + 'number_of_updates_installed': {'readonly': True}, + } + + _attribute_map = { + 'percent_complete': {'key': 'percentComplete', 'type': 'int'}, + 'number_of_updates_to_install': {'key': 'numberOfUpdatesToInstall', 'type': 'int'}, + 'number_of_updates_installed': {'key': 'numberOfUpdatesInstalled', 'type': 'int'}, + } + + def __init__( + self, + **kwargs + ): + super(UpdateInstallProgress, self).__init__(**kwargs) + self.percent_complete = None + self.number_of_updates_to_install = None + self.number_of_updates_installed = None + + +class UpdateSummary(ArmBaseModel): + """Details about ongoing updates and availability of updates on the device. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: The path ID that uniquely identifies the object. + :vartype id: str + :ivar name: The object name. + :vartype name: str + :ivar type: The hierarchical type of the object. + :vartype type: str + :ivar system_data: UpdateSummary Result. + :vartype system_data: ~data_box_edge_management_client.models.SystemData + :param device_version_number: The current version of the device in format: 1.2.17312.13.",. + :type device_version_number: str + :param friendly_device_version_name: The current version of the device in text format. + :type friendly_device_version_name: str + :param device_last_scanned_date_time: The last time when a scan was done on the device. + :type device_last_scanned_date_time: ~datetime.datetime + :param last_completed_scan_job_date_time: The time when the last scan job was completed + (success/cancelled/failed) on the appliance. + :type last_completed_scan_job_date_time: ~datetime.datetime + :param last_successful_scan_job_time: Time when the last scan job is successfully completed. + :type last_successful_scan_job_time: ~datetime.datetime + :ivar last_completed_download_job_date_time: The time when the last Download job was completed + (success/cancelled/failed) on the appliance. + :vartype last_completed_download_job_date_time: ~datetime.datetime + :ivar last_completed_download_job_id: JobId of the last ran download job.(Can be + success/cancelled/failed). + :vartype last_completed_download_job_id: str + :ivar last_download_job_status: JobStatus of the last ran download job. Possible values + include: "Invalid", "Running", "Succeeded", "Failed", "Canceled", "Paused", "Scheduled". + :vartype last_download_job_status: str or ~data_box_edge_management_client.models.JobStatus + :param last_successful_install_job_date_time: The time when the Last Install job was completed + successfully on the appliance. + :type last_successful_install_job_date_time: ~datetime.datetime + :ivar last_completed_install_job_date_time: The time when the last Install job was completed + (success/cancelled/failed) on the appliance. + :vartype last_completed_install_job_date_time: ~datetime.datetime + :ivar last_completed_install_job_id: JobId of the last ran install job.(Can be + success/cancelled/failed). + :vartype last_completed_install_job_id: str + :ivar last_install_job_status: JobStatus of the last ran install job. Possible values include: + "Invalid", "Running", "Succeeded", "Failed", "Canceled", "Paused", "Scheduled". + :vartype last_install_job_status: str or ~data_box_edge_management_client.models.JobStatus + :ivar total_number_of_updates_available: The number of updates available for the current device + version as per the last device scan. + :vartype total_number_of_updates_available: int + :ivar total_number_of_updates_pending_download: The total number of items pending download. + :vartype total_number_of_updates_pending_download: int + :ivar total_number_of_updates_pending_install: The total number of items pending install. + :vartype total_number_of_updates_pending_install: int + :ivar reboot_behavior: Indicates if updates are available and at least one of the updates needs + a reboot. Possible values include: "NeverReboots", "RequiresReboot", "RequestReboot". + :vartype reboot_behavior: str or ~data_box_edge_management_client.models.InstallRebootBehavior + :ivar ongoing_update_operation: The current update operation. Possible values include: "None", + "Scan", "Download", "Install". + :vartype ongoing_update_operation: str or + ~data_box_edge_management_client.models.UpdateOperation + :ivar in_progress_download_job_id: The job ID of the download job in progress. + :vartype in_progress_download_job_id: str + :ivar in_progress_install_job_id: The job ID of the install job in progress. + :vartype in_progress_install_job_id: str + :ivar in_progress_download_job_started_date_time: The time when the currently running download + (if any) started. + :vartype in_progress_download_job_started_date_time: ~datetime.datetime + :ivar in_progress_install_job_started_date_time: The time when the currently running install + (if any) started. + :vartype in_progress_install_job_started_date_time: ~datetime.datetime + :ivar update_titles: The list of updates available for install. + :vartype update_titles: list[str] + :ivar updates: The list of updates available for install. + :vartype updates: list[~data_box_edge_management_client.models.UpdateDetails] + :ivar total_update_size_in_bytes: The total size of updates available for download in bytes. + :vartype total_update_size_in_bytes: float + :ivar total_time_in_minutes: The total time in Minutes. + :vartype total_time_in_minutes: int + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'system_data': {'readonly': True}, + 'last_completed_download_job_date_time': {'readonly': True}, + 'last_completed_download_job_id': {'readonly': True}, + 'last_download_job_status': {'readonly': True}, + 'last_completed_install_job_date_time': {'readonly': True}, + 'last_completed_install_job_id': {'readonly': True}, + 'last_install_job_status': {'readonly': True}, + 'total_number_of_updates_available': {'readonly': True}, + 'total_number_of_updates_pending_download': {'readonly': True}, + 'total_number_of_updates_pending_install': {'readonly': True}, + 'reboot_behavior': {'readonly': True}, + 'ongoing_update_operation': {'readonly': True}, + 'in_progress_download_job_id': {'readonly': True}, + 'in_progress_install_job_id': {'readonly': True}, + 'in_progress_download_job_started_date_time': {'readonly': True}, + 'in_progress_install_job_started_date_time': {'readonly': True}, + 'update_titles': {'readonly': True}, + 'updates': {'readonly': True}, + 'total_update_size_in_bytes': {'readonly': True}, + 'total_time_in_minutes': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'device_version_number': {'key': 'properties.deviceVersionNumber', 'type': 'str'}, + 'friendly_device_version_name': {'key': 'properties.friendlyDeviceVersionName', 'type': 'str'}, + 'device_last_scanned_date_time': {'key': 'properties.deviceLastScannedDateTime', 'type': 'iso-8601'}, + 'last_completed_scan_job_date_time': {'key': 'properties.lastCompletedScanJobDateTime', 'type': 'iso-8601'}, + 'last_successful_scan_job_time': {'key': 'properties.lastSuccessfulScanJobTime', 'type': 'iso-8601'}, + 'last_completed_download_job_date_time': {'key': 'properties.lastCompletedDownloadJobDateTime', 'type': 'iso-8601'}, + 'last_completed_download_job_id': {'key': 'properties.lastCompletedDownloadJobId', 'type': 'str'}, + 'last_download_job_status': {'key': 'properties.lastDownloadJobStatus', 'type': 'str'}, + 'last_successful_install_job_date_time': {'key': 'properties.lastSuccessfulInstallJobDateTime', 'type': 'iso-8601'}, + 'last_completed_install_job_date_time': {'key': 'properties.lastCompletedInstallJobDateTime', 'type': 'iso-8601'}, + 'last_completed_install_job_id': {'key': 'properties.lastCompletedInstallJobId', 'type': 'str'}, + 'last_install_job_status': {'key': 'properties.lastInstallJobStatus', 'type': 'str'}, + 'total_number_of_updates_available': {'key': 'properties.totalNumberOfUpdatesAvailable', 'type': 'int'}, + 'total_number_of_updates_pending_download': {'key': 'properties.totalNumberOfUpdatesPendingDownload', 'type': 'int'}, + 'total_number_of_updates_pending_install': {'key': 'properties.totalNumberOfUpdatesPendingInstall', 'type': 'int'}, + 'reboot_behavior': {'key': 'properties.rebootBehavior', 'type': 'str'}, + 'ongoing_update_operation': {'key': 'properties.ongoingUpdateOperation', 'type': 'str'}, + 'in_progress_download_job_id': {'key': 'properties.inProgressDownloadJobId', 'type': 'str'}, + 'in_progress_install_job_id': {'key': 'properties.inProgressInstallJobId', 'type': 'str'}, + 'in_progress_download_job_started_date_time': {'key': 'properties.inProgressDownloadJobStartedDateTime', 'type': 'iso-8601'}, + 'in_progress_install_job_started_date_time': {'key': 'properties.inProgressInstallJobStartedDateTime', 'type': 'iso-8601'}, + 'update_titles': {'key': 'properties.updateTitles', 'type': '[str]'}, + 'updates': {'key': 'properties.updates', 'type': '[UpdateDetails]'}, + 'total_update_size_in_bytes': {'key': 'properties.totalUpdateSizeInBytes', 'type': 'float'}, + 'total_time_in_minutes': {'key': 'properties.totalTimeInMinutes', 'type': 'int'}, + } + + def __init__( + self, + **kwargs + ): + super(UpdateSummary, self).__init__(**kwargs) + self.system_data = None + self.device_version_number = kwargs.get('device_version_number', None) + self.friendly_device_version_name = kwargs.get('friendly_device_version_name', None) + self.device_last_scanned_date_time = kwargs.get('device_last_scanned_date_time', None) + self.last_completed_scan_job_date_time = kwargs.get('last_completed_scan_job_date_time', None) + self.last_successful_scan_job_time = kwargs.get('last_successful_scan_job_time', None) + self.last_completed_download_job_date_time = None + self.last_completed_download_job_id = None + self.last_download_job_status = None + self.last_successful_install_job_date_time = kwargs.get('last_successful_install_job_date_time', None) + self.last_completed_install_job_date_time = None + self.last_completed_install_job_id = None + self.last_install_job_status = None + self.total_number_of_updates_available = None + self.total_number_of_updates_pending_download = None + self.total_number_of_updates_pending_install = None + self.reboot_behavior = None + self.ongoing_update_operation = None + self.in_progress_download_job_id = None + self.in_progress_install_job_id = None + self.in_progress_download_job_started_date_time = None + self.in_progress_install_job_started_date_time = None + self.update_titles = None + self.updates = None + self.total_update_size_in_bytes = None + self.total_time_in_minutes = None + + +class UploadCertificateRequest(msrest.serialization.Model): + """The upload certificate request. + + All required parameters must be populated in order to send to Azure. + + :param authentication_type: The authentication type. Possible values include: "Invalid", + "AzureActiveDirectory". + :type authentication_type: str or ~data_box_edge_management_client.models.AuthenticationType + :param certificate: Required. The base64 encoded certificate raw data. + :type certificate: str + """ + + _validation = { + 'certificate': {'required': True}, + } + + _attribute_map = { + 'authentication_type': {'key': 'properties.authenticationType', 'type': 'str'}, + 'certificate': {'key': 'properties.certificate', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(UploadCertificateRequest, self).__init__(**kwargs) + self.authentication_type = kwargs.get('authentication_type', None) + self.certificate = kwargs['certificate'] + + +class UploadCertificateResponse(msrest.serialization.Model): + """The upload registration certificate response. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param auth_type: Specifies authentication type. Possible values include: "Invalid", + "AzureActiveDirectory". + :type auth_type: str or ~data_box_edge_management_client.models.AuthenticationType + :ivar resource_id: The resource ID of the Data Box Edge/Gateway device. + :vartype resource_id: str + :ivar aad_authority: Azure Active Directory tenant authority. + :vartype aad_authority: str + :ivar aad_tenant_id: Azure Active Directory tenant ID. + :vartype aad_tenant_id: str + :ivar service_principal_client_id: Azure Active Directory service principal client ID. + :vartype service_principal_client_id: str + :ivar service_principal_object_id: Azure Active Directory service principal object ID. + :vartype service_principal_object_id: str + :ivar azure_management_endpoint_audience: The azure management endpoint audience. + :vartype azure_management_endpoint_audience: str + :ivar aad_audience: Identifier of the target resource that is the recipient of the requested + token. + :vartype aad_audience: str + """ + + _validation = { + 'resource_id': {'readonly': True}, + 'aad_authority': {'readonly': True}, + 'aad_tenant_id': {'readonly': True}, + 'service_principal_client_id': {'readonly': True}, + 'service_principal_object_id': {'readonly': True}, + 'azure_management_endpoint_audience': {'readonly': True}, + 'aad_audience': {'readonly': True}, + } + + _attribute_map = { + 'auth_type': {'key': 'authType', 'type': 'str'}, + 'resource_id': {'key': 'resourceId', 'type': 'str'}, + 'aad_authority': {'key': 'aadAuthority', 'type': 'str'}, + 'aad_tenant_id': {'key': 'aadTenantId', 'type': 'str'}, + 'service_principal_client_id': {'key': 'servicePrincipalClientId', 'type': 'str'}, + 'service_principal_object_id': {'key': 'servicePrincipalObjectId', 'type': 'str'}, + 'azure_management_endpoint_audience': {'key': 'azureManagementEndpointAudience', 'type': 'str'}, + 'aad_audience': {'key': 'aadAudience', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(UploadCertificateResponse, self).__init__(**kwargs) + self.auth_type = kwargs.get('auth_type', None) + self.resource_id = None + self.aad_authority = None + self.aad_tenant_id = None + self.service_principal_client_id = None + self.service_principal_object_id = None + self.azure_management_endpoint_audience = None + self.aad_audience = None + + +class User(ArmBaseModel): + """Represents a user who has access to one or more shares on the Data Box Edge/Gateway device. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: The path ID that uniquely identifies the object. + :vartype id: str + :ivar name: The object name. + :vartype name: str + :ivar type: The hierarchical type of the object. + :vartype type: str + :ivar system_data: User in DataBoxEdge Resource. + :vartype system_data: ~data_box_edge_management_client.models.SystemData + :param encrypted_password: The password details. + :type encrypted_password: ~data_box_edge_management_client.models.AsymmetricEncryptedSecret + :ivar share_access_rights: List of shares that the user has rights on. This field should not be + specified during user creation. + :vartype share_access_rights: list[~data_box_edge_management_client.models.ShareAccessRight] + :param user_type: Required. Type of the user. Possible values include: "Share", + "LocalManagement", "ARM". + :type user_type: str or ~data_box_edge_management_client.models.UserType + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'system_data': {'readonly': True}, + 'share_access_rights': {'readonly': True}, + 'user_type': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'encrypted_password': {'key': 'properties.encryptedPassword', 'type': 'AsymmetricEncryptedSecret'}, + 'share_access_rights': {'key': 'properties.shareAccessRights', 'type': '[ShareAccessRight]'}, + 'user_type': {'key': 'properties.userType', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(User, self).__init__(**kwargs) + self.system_data = None + self.encrypted_password = kwargs.get('encrypted_password', None) + self.share_access_rights = None + self.user_type = kwargs['user_type'] + + +class UserAccessRight(msrest.serialization.Model): + """The mapping between a particular user and the access type on the SMB share. + + All required parameters must be populated in order to send to Azure. + + :param user_id: Required. User ID (already existing in the device). + :type user_id: str + :param access_type: Required. Type of access to be allowed for the user. Possible values + include: "Change", "Read", "Custom". + :type access_type: str or ~data_box_edge_management_client.models.ShareAccessType + """ + + _validation = { + 'user_id': {'required': True}, + 'access_type': {'required': True}, + } + + _attribute_map = { + 'user_id': {'key': 'userId', 'type': 'str'}, + 'access_type': {'key': 'accessType', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(UserAccessRight, self).__init__(**kwargs) + self.user_id = kwargs['user_id'] + self.access_type = kwargs['access_type'] + + +class UserList(msrest.serialization.Model): + """Collection of users. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar value: The list of users. + :vartype value: list[~data_box_edge_management_client.models.User] + :ivar next_link: Link to the next set of results. + :vartype next_link: str + """ + + _validation = { + 'value': {'readonly': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[User]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(UserList, self).__init__(**kwargs) + self.value = None + self.next_link = None diff --git a/src/databoxedge/azext_databoxedge/vendored_sdks/databoxedge/models/_models_py3.py b/src/databoxedge/azext_databoxedge/vendored_sdks/databoxedge/models/_models_py3.py new file mode 100644 index 00000000000..4225aeef563 --- /dev/null +++ b/src/databoxedge/azext_databoxedge/vendored_sdks/databoxedge/models/_models_py3.py @@ -0,0 +1,5716 @@ +# 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 datetime +from typing import Dict, List, Optional, Union + +import msrest.serialization + +from ._data_box_edge_management_client_enums import * + + +class ArmBaseModel(msrest.serialization.Model): + """Represents the base class for all object models. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: The path ID that uniquely identifies the object. + :vartype id: str + :ivar name: The object name. + :vartype name: str + :ivar type: The hierarchical type of the object. + :vartype type: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ArmBaseModel, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None + + +class Addon(ArmBaseModel): + """Role Addon. + + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: ArcAddon, IoTAddon. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: The path ID that uniquely identifies the object. + :vartype id: str + :ivar name: The object name. + :vartype name: str + :ivar type: The hierarchical type of the object. + :vartype type: str + :param kind: Required. Addon type.Constant filled by server. Possible values include: + "IotEdge", "ArcForKubernetes". + :type kind: str or ~data_box_edge_management_client.models.AddonType + :ivar system_data: Addon type. + :vartype system_data: ~data_box_edge_management_client.models.SystemData + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'kind': {'required': True}, + 'system_data': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + } + + _subtype_map = { + 'kind': {'ArcForKubernetes': 'ArcAddon', 'IotEdge': 'IoTAddon'} + } + + def __init__( + self, + **kwargs + ): + super(Addon, self).__init__(**kwargs) + self.kind = 'Addon' # type: str + self.system_data = None + + +class AddonList(msrest.serialization.Model): + """Collection of all the Role addon on the Azure Stack Edge device. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar value: The Value. + :vartype value: list[~data_box_edge_management_client.models.Addon] + :ivar next_link: Link to the next set of results. + :vartype next_link: str + """ + + _validation = { + 'value': {'readonly': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[Addon]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(AddonList, self).__init__(**kwargs) + self.value = None + self.next_link = None + + +class Address(msrest.serialization.Model): + """The shipping address of the customer. + + All required parameters must be populated in order to send to Azure. + + :param address_line1: The address line1. + :type address_line1: str + :param address_line2: The address line2. + :type address_line2: str + :param address_line3: The address line3. + :type address_line3: str + :param postal_code: The postal code. + :type postal_code: str + :param city: The city name. + :type city: str + :param state: The state name. + :type state: str + :param country: Required. The country name. + :type country: str + """ + + _validation = { + 'country': {'required': True}, + } + + _attribute_map = { + 'address_line1': {'key': 'addressLine1', 'type': 'str'}, + 'address_line2': {'key': 'addressLine2', 'type': 'str'}, + 'address_line3': {'key': 'addressLine3', 'type': 'str'}, + 'postal_code': {'key': 'postalCode', 'type': 'str'}, + 'city': {'key': 'city', 'type': 'str'}, + 'state': {'key': 'state', 'type': 'str'}, + 'country': {'key': 'country', 'type': 'str'}, + } + + def __init__( + self, + *, + country: str, + address_line1: Optional[str] = None, + address_line2: Optional[str] = None, + address_line3: Optional[str] = None, + postal_code: Optional[str] = None, + city: Optional[str] = None, + state: Optional[str] = None, + **kwargs + ): + super(Address, self).__init__(**kwargs) + self.address_line1 = address_line1 + self.address_line2 = address_line2 + self.address_line3 = address_line3 + self.postal_code = postal_code + self.city = city + self.state = state + self.country = country + + +class Alert(ArmBaseModel): + """Alert on the data box edge/gateway device. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: The path ID that uniquely identifies the object. + :vartype id: str + :ivar name: The object name. + :vartype name: str + :ivar type: The hierarchical type of the object. + :vartype type: str + :ivar system_data: Alert generated in the resource. + :vartype system_data: ~data_box_edge_management_client.models.SystemData + :ivar title: Alert title. + :vartype title: str + :ivar alert_type: Alert type. + :vartype alert_type: str + :ivar appeared_at_date_time: UTC time when the alert appeared. + :vartype appeared_at_date_time: ~datetime.datetime + :ivar recommendation: Alert recommendation. + :vartype recommendation: str + :ivar severity: Severity of the alert. Possible values include: "Informational", "Warning", + "Critical". + :vartype severity: str or ~data_box_edge_management_client.models.AlertSeverity + :ivar error_details: Error details of the alert. + :vartype error_details: ~data_box_edge_management_client.models.AlertErrorDetails + :ivar detailed_information: Alert details. + :vartype detailed_information: dict[str, str] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'system_data': {'readonly': True}, + 'title': {'readonly': True}, + 'alert_type': {'readonly': True}, + 'appeared_at_date_time': {'readonly': True}, + 'recommendation': {'readonly': True}, + 'severity': {'readonly': True}, + 'error_details': {'readonly': True}, + 'detailed_information': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'title': {'key': 'properties.title', 'type': 'str'}, + 'alert_type': {'key': 'properties.alertType', 'type': 'str'}, + 'appeared_at_date_time': {'key': 'properties.appearedAtDateTime', 'type': 'iso-8601'}, + 'recommendation': {'key': 'properties.recommendation', 'type': 'str'}, + 'severity': {'key': 'properties.severity', 'type': 'str'}, + 'error_details': {'key': 'properties.errorDetails', 'type': 'AlertErrorDetails'}, + 'detailed_information': {'key': 'properties.detailedInformation', 'type': '{str}'}, + } + + def __init__( + self, + **kwargs + ): + super(Alert, self).__init__(**kwargs) + self.system_data = None + self.title = None + self.alert_type = None + self.appeared_at_date_time = None + self.recommendation = None + self.severity = None + self.error_details = None + self.detailed_information = None + + +class AlertErrorDetails(msrest.serialization.Model): + """Error details for the alert. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar error_code: Error code. + :vartype error_code: str + :ivar error_message: Error Message. + :vartype error_message: str + :ivar occurrences: Number of occurrences. + :vartype occurrences: int + """ + + _validation = { + 'error_code': {'readonly': True}, + 'error_message': {'readonly': True}, + 'occurrences': {'readonly': True}, + } + + _attribute_map = { + 'error_code': {'key': 'errorCode', 'type': 'str'}, + 'error_message': {'key': 'errorMessage', 'type': 'str'}, + 'occurrences': {'key': 'occurrences', 'type': 'int'}, + } + + def __init__( + self, + **kwargs + ): + super(AlertErrorDetails, self).__init__(**kwargs) + self.error_code = None + self.error_message = None + self.occurrences = None + + +class AlertList(msrest.serialization.Model): + """Collection of alerts. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar value: The value. + :vartype value: list[~data_box_edge_management_client.models.Alert] + :ivar next_link: Link to the next set of results. + :vartype next_link: str + """ + + _validation = { + 'value': {'readonly': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[Alert]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(AlertList, self).__init__(**kwargs) + self.value = None + self.next_link = None + + +class ArcAddon(Addon): + """Arc Addon. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: The path ID that uniquely identifies the object. + :vartype id: str + :ivar name: The object name. + :vartype name: str + :ivar type: The hierarchical type of the object. + :vartype type: str + :param kind: Required. Addon type.Constant filled by server. Possible values include: + "IotEdge", "ArcForKubernetes". + :type kind: str or ~data_box_edge_management_client.models.AddonType + :ivar system_data: Addon type. + :vartype system_data: ~data_box_edge_management_client.models.SystemData + :param subscription_id: Required. Arc resource subscription Id. + :type subscription_id: str + :param resource_group_name: Required. Arc resource group name. + :type resource_group_name: str + :param resource_name: Required. Arc resource Name. + :type resource_name: str + :param resource_location: Required. Arc resource location. + :type resource_location: str + :ivar version: Arc resource version. + :vartype version: str + :ivar host_platform: Host OS supported by the Arc addon. Possible values include: "Windows", + "Linux". + :vartype host_platform: str or ~data_box_edge_management_client.models.PlatformType + :ivar host_platform_type: Platform where the runtime is hosted. Possible values include: + "KubernetesCluster", "LinuxVM". + :vartype host_platform_type: str or ~data_box_edge_management_client.models.HostPlatformType + :ivar provisioning_state: Addon Provisioning State. Possible values include: "Invalid", + "Creating", "Created", "Updating", "Reconfiguring", "Failed", "Deleting". + :vartype provisioning_state: str or ~data_box_edge_management_client.models.AddonState + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'kind': {'required': True}, + 'system_data': {'readonly': True}, + 'subscription_id': {'required': True}, + 'resource_group_name': {'required': True}, + 'resource_name': {'required': True}, + 'resource_location': {'required': True}, + 'version': {'readonly': True}, + 'host_platform': {'readonly': True}, + 'host_platform_type': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'subscription_id': {'key': 'properties.subscriptionId', 'type': 'str'}, + 'resource_group_name': {'key': 'properties.resourceGroupName', 'type': 'str'}, + 'resource_name': {'key': 'properties.resourceName', 'type': 'str'}, + 'resource_location': {'key': 'properties.resourceLocation', 'type': 'str'}, + 'version': {'key': 'properties.version', 'type': 'str'}, + 'host_platform': {'key': 'properties.hostPlatform', 'type': 'str'}, + 'host_platform_type': {'key': 'properties.hostPlatformType', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + } + + def __init__( + self, + *, + subscription_id: str, + resource_group_name: str, + resource_name: str, + resource_location: str, + **kwargs + ): + super(ArcAddon, self).__init__(**kwargs) + self.kind = 'ArcForKubernetes' # type: str + self.subscription_id = subscription_id + self.resource_group_name = resource_group_name + self.resource_name = resource_name + self.resource_location = resource_location + self.version = None + self.host_platform = None + self.host_platform_type = None + self.provisioning_state = None + + +class AsymmetricEncryptedSecret(msrest.serialization.Model): + """Represent the secrets intended for encryption with asymmetric key pair. + + All required parameters must be populated in order to send to Azure. + + :param value: Required. The value of the secret. + :type value: str + :param encryption_cert_thumbprint: Thumbprint certificate used to encrypt \"Value\". If the + value is unencrypted, it will be null. + :type encryption_cert_thumbprint: str + :param encryption_algorithm: Required. The algorithm used to encrypt "Value". Possible values + include: "None", "AES256", "RSAES_PKCS1_v_1_5". + :type encryption_algorithm: str or ~data_box_edge_management_client.models.EncryptionAlgorithm + """ + + _validation = { + 'value': {'required': True}, + 'encryption_algorithm': {'required': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': 'str'}, + 'encryption_cert_thumbprint': {'key': 'encryptionCertThumbprint', 'type': 'str'}, + 'encryption_algorithm': {'key': 'encryptionAlgorithm', 'type': 'str'}, + } + + def __init__( + self, + *, + value: str, + encryption_algorithm: Union[str, "EncryptionAlgorithm"], + encryption_cert_thumbprint: Optional[str] = None, + **kwargs + ): + super(AsymmetricEncryptedSecret, self).__init__(**kwargs) + self.value = value + self.encryption_cert_thumbprint = encryption_cert_thumbprint + self.encryption_algorithm = encryption_algorithm + + +class Authentication(msrest.serialization.Model): + """Authentication mechanism for IoT devices. + + :param symmetric_key: Symmetric key for authentication. + :type symmetric_key: ~data_box_edge_management_client.models.SymmetricKey + """ + + _attribute_map = { + 'symmetric_key': {'key': 'symmetricKey', 'type': 'SymmetricKey'}, + } + + def __init__( + self, + *, + symmetric_key: Optional["SymmetricKey"] = None, + **kwargs + ): + super(Authentication, self).__init__(**kwargs) + self.symmetric_key = symmetric_key + + +class AzureContainerInfo(msrest.serialization.Model): + """Azure container mapping of the endpoint. + + All required parameters must be populated in order to send to Azure. + + :param storage_account_credential_id: Required. ID of the storage account credential used to + access storage. + :type storage_account_credential_id: str + :param container_name: Required. Container name (Based on the data format specified, this + represents the name of Azure Files/Page blob/Block blob). + :type container_name: str + :param data_format: Required. Storage format used for the file represented by the share. + Possible values include: "BlockBlob", "PageBlob", "AzureFile". + :type data_format: str or ~data_box_edge_management_client.models.AzureContainerDataFormat + """ + + _validation = { + 'storage_account_credential_id': {'required': True}, + 'container_name': {'required': True}, + 'data_format': {'required': True}, + } + + _attribute_map = { + 'storage_account_credential_id': {'key': 'storageAccountCredentialId', 'type': 'str'}, + 'container_name': {'key': 'containerName', 'type': 'str'}, + 'data_format': {'key': 'dataFormat', 'type': 'str'}, + } + + def __init__( + self, + *, + storage_account_credential_id: str, + container_name: str, + data_format: Union[str, "AzureContainerDataFormat"], + **kwargs + ): + super(AzureContainerInfo, self).__init__(**kwargs) + self.storage_account_credential_id = storage_account_credential_id + self.container_name = container_name + self.data_format = data_format + + +class BandwidthSchedule(ArmBaseModel): + """The bandwidth schedule details. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: The path ID that uniquely identifies the object. + :vartype id: str + :ivar name: The object name. + :vartype name: str + :ivar type: The hierarchical type of the object. + :vartype type: str + :ivar system_data: Bandwidth object related to ASE resource. + :vartype system_data: ~data_box_edge_management_client.models.SystemData + :param start: Required. The start time of the schedule in UTC. + :type start: str + :param stop: Required. The stop time of the schedule in UTC. + :type stop: str + :param rate_in_mbps: Required. The bandwidth rate in Mbps. + :type rate_in_mbps: int + :param days: Required. The days of the week when this schedule is applicable. + :type days: list[str or ~data_box_edge_management_client.models.DayOfWeek] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'system_data': {'readonly': True}, + 'start': {'required': True}, + 'stop': {'required': True}, + 'rate_in_mbps': {'required': True}, + 'days': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'start': {'key': 'properties.start', 'type': 'str'}, + 'stop': {'key': 'properties.stop', 'type': 'str'}, + 'rate_in_mbps': {'key': 'properties.rateInMbps', 'type': 'int'}, + 'days': {'key': 'properties.days', 'type': '[str]'}, + } + + def __init__( + self, + *, + start: str, + stop: str, + rate_in_mbps: int, + days: List[Union[str, "DayOfWeek"]], + **kwargs + ): + super(BandwidthSchedule, self).__init__(**kwargs) + self.system_data = None + self.start = start + self.stop = stop + self.rate_in_mbps = rate_in_mbps + self.days = days + + +class BandwidthSchedulesList(msrest.serialization.Model): + """The collection of bandwidth schedules. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar value: The list of bandwidth schedules. + :vartype value: list[~data_box_edge_management_client.models.BandwidthSchedule] + :ivar next_link: Link to the next set of results. + :vartype next_link: str + """ + + _validation = { + 'value': {'readonly': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[BandwidthSchedule]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(BandwidthSchedulesList, self).__init__(**kwargs) + self.value = None + self.next_link = None + + +class ClientAccessRight(msrest.serialization.Model): + """The mapping between a particular client IP and the type of access client has on the NFS share. + + All required parameters must be populated in order to send to Azure. + + :param client: Required. IP of the client. + :type client: str + :param access_permission: Required. Type of access to be allowed for the client. Possible + values include: "NoAccess", "ReadOnly", "ReadWrite". + :type access_permission: str or ~data_box_edge_management_client.models.ClientPermissionType + """ + + _validation = { + 'client': {'required': True}, + 'access_permission': {'required': True}, + } + + _attribute_map = { + 'client': {'key': 'client', 'type': 'str'}, + 'access_permission': {'key': 'accessPermission', 'type': 'str'}, + } + + def __init__( + self, + *, + client: str, + access_permission: Union[str, "ClientPermissionType"], + **kwargs + ): + super(ClientAccessRight, self).__init__(**kwargs) + self.client = client + self.access_permission = access_permission + + +class Role(ArmBaseModel): + """Compute role. + + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: CloudEdgeManagementRole, IoTRole, KubernetesRole, MecRole. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: The path ID that uniquely identifies the object. + :vartype id: str + :ivar name: The object name. + :vartype name: str + :ivar type: The hierarchical type of the object. + :vartype type: str + :param kind: Required. Role type.Constant filled by server. Possible values include: "IOT", + "ASA", "Functions", "Cognitive", "MEC", "CloudEdgeManagement", "Kubernetes". + :type kind: str or ~data_box_edge_management_client.models.RoleTypes + :ivar system_data: Role configured on ASE resource. + :vartype system_data: ~data_box_edge_management_client.models.SystemData + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'kind': {'required': True}, + 'system_data': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + } + + _subtype_map = { + 'kind': {'CloudEdgeManagement': 'CloudEdgeManagementRole', 'IOT': 'IoTRole', 'Kubernetes': 'KubernetesRole', 'MEC': 'MecRole'} + } + + def __init__( + self, + **kwargs + ): + super(Role, self).__init__(**kwargs) + self.kind = 'Role' # type: str + self.system_data = None + + +class CloudEdgeManagementRole(Role): + """CloudEdgeManagementRole role, Currently It's in Private Preview. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: The path ID that uniquely identifies the object. + :vartype id: str + :ivar name: The object name. + :vartype name: str + :ivar type: The hierarchical type of the object. + :vartype type: str + :param kind: Required. Role type.Constant filled by server. Possible values include: "IOT", + "ASA", "Functions", "Cognitive", "MEC", "CloudEdgeManagement", "Kubernetes". + :type kind: str or ~data_box_edge_management_client.models.RoleTypes + :ivar system_data: Role configured on ASE resource. + :vartype system_data: ~data_box_edge_management_client.models.SystemData + :ivar local_management_status: Local Edge Management Status. Possible values include: + "Enabled", "Disabled". + :vartype local_management_status: str or ~data_box_edge_management_client.models.RoleStatus + :ivar edge_profile: Edge Profile of the resource. + :vartype edge_profile: ~data_box_edge_management_client.models.EdgeProfile + :param role_status: Role status. Possible values include: "Enabled", "Disabled". + :type role_status: str or ~data_box_edge_management_client.models.RoleStatus + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'kind': {'required': True}, + 'system_data': {'readonly': True}, + 'local_management_status': {'readonly': True}, + 'edge_profile': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'local_management_status': {'key': 'properties.localManagementStatus', 'type': 'str'}, + 'edge_profile': {'key': 'properties.edgeProfile', 'type': 'EdgeProfile'}, + 'role_status': {'key': 'properties.roleStatus', 'type': 'str'}, + } + + def __init__( + self, + *, + role_status: Optional[Union[str, "RoleStatus"]] = None, + **kwargs + ): + super(CloudEdgeManagementRole, self).__init__(**kwargs) + self.kind = 'CloudEdgeManagement' # type: str + self.local_management_status = None + self.edge_profile = None + self.role_status = role_status + + +class CloudErrorBody(msrest.serialization.Model): + """An error response from the service. + + :param code: An identifier for the error. Codes are invariant and are intended to be consumed + programmatically. + :type code: str + :param message: A message describing the error, intended to be suitable for display in a user + interface. + :type message: str + :param details: A list of additional details about the error. + :type details: list[~data_box_edge_management_client.models.CloudErrorBody] + """ + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + 'details': {'key': 'details', 'type': '[CloudErrorBody]'}, + } + + def __init__( + self, + *, + code: Optional[str] = None, + message: Optional[str] = None, + details: Optional[List["CloudErrorBody"]] = None, + **kwargs + ): + super(CloudErrorBody, self).__init__(**kwargs) + self.code = code + self.message = message + self.details = details + + +class CniConfig(msrest.serialization.Model): + """Cni configuration. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar type: Cni type. + :vartype type: str + :ivar version: Cni version. + :vartype version: str + :ivar pod_subnet: Pod Subnet. + :vartype pod_subnet: str + :ivar service_subnet: Service subnet. + :vartype service_subnet: str + """ + + _validation = { + 'type': {'readonly': True}, + 'version': {'readonly': True}, + 'pod_subnet': {'readonly': True}, + 'service_subnet': {'readonly': True}, + } + + _attribute_map = { + 'type': {'key': 'type', 'type': 'str'}, + 'version': {'key': 'version', 'type': 'str'}, + 'pod_subnet': {'key': 'podSubnet', 'type': 'str'}, + 'service_subnet': {'key': 'serviceSubnet', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(CniConfig, self).__init__(**kwargs) + self.type = None + self.version = None + self.pod_subnet = None + self.service_subnet = None + + +class ComputeResource(msrest.serialization.Model): + """Compute infrastructure Resource. + + All required parameters must be populated in order to send to Azure. + + :param processor_count: Required. Processor count. + :type processor_count: int + :param memory_in_gb: Required. Memory in GB. + :type memory_in_gb: long + """ + + _validation = { + 'processor_count': {'required': True}, + 'memory_in_gb': {'required': True}, + } + + _attribute_map = { + 'processor_count': {'key': 'processorCount', 'type': 'int'}, + 'memory_in_gb': {'key': 'memoryInGB', 'type': 'long'}, + } + + def __init__( + self, + *, + processor_count: int, + memory_in_gb: int, + **kwargs + ): + super(ComputeResource, self).__init__(**kwargs) + self.processor_count = processor_count + self.memory_in_gb = memory_in_gb + + +class ContactDetails(msrest.serialization.Model): + """Contains all the contact details of the customer. + + All required parameters must be populated in order to send to Azure. + + :param contact_person: Required. The contact person name. + :type contact_person: str + :param company_name: Required. The name of the company. + :type company_name: str + :param phone: Required. The phone number. + :type phone: str + :param email_list: Required. The email list. + :type email_list: list[str] + """ + + _validation = { + 'contact_person': {'required': True}, + 'company_name': {'required': True}, + 'phone': {'required': True}, + 'email_list': {'required': True}, + } + + _attribute_map = { + 'contact_person': {'key': 'contactPerson', 'type': 'str'}, + 'company_name': {'key': 'companyName', 'type': 'str'}, + 'phone': {'key': 'phone', 'type': 'str'}, + 'email_list': {'key': 'emailList', 'type': '[str]'}, + } + + def __init__( + self, + *, + contact_person: str, + company_name: str, + phone: str, + email_list: List[str], + **kwargs + ): + super(ContactDetails, self).__init__(**kwargs) + self.contact_person = contact_person + self.company_name = company_name + self.phone = phone + self.email_list = email_list + + +class Container(ArmBaseModel): + """Represents a container on the Data Box Edge/Gateway device. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: The path ID that uniquely identifies the object. + :vartype id: str + :ivar name: The object name. + :vartype name: str + :ivar type: The hierarchical type of the object. + :vartype type: str + :ivar system_data: Container in DataBoxEdge Resource. + :vartype system_data: ~data_box_edge_management_client.models.SystemData + :ivar container_status: Current status of the container. Possible values include: "OK", + "Offline", "Unknown", "Updating", "NeedsAttention". + :vartype container_status: str or ~data_box_edge_management_client.models.ContainerStatus + :param data_format: Required. DataFormat for Container. Possible values include: "BlockBlob", + "PageBlob", "AzureFile". + :type data_format: str or ~data_box_edge_management_client.models.AzureContainerDataFormat + :ivar refresh_details: Details of the refresh job on this container. + :vartype refresh_details: ~data_box_edge_management_client.models.RefreshDetails + :ivar created_date_time: The UTC time when container got created. + :vartype created_date_time: ~datetime.datetime + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'system_data': {'readonly': True}, + 'container_status': {'readonly': True}, + 'data_format': {'required': True}, + 'refresh_details': {'readonly': True}, + 'created_date_time': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'container_status': {'key': 'properties.containerStatus', 'type': 'str'}, + 'data_format': {'key': 'properties.dataFormat', 'type': 'str'}, + 'refresh_details': {'key': 'properties.refreshDetails', 'type': 'RefreshDetails'}, + 'created_date_time': {'key': 'properties.createdDateTime', 'type': 'iso-8601'}, + } + + def __init__( + self, + *, + data_format: Union[str, "AzureContainerDataFormat"], + **kwargs + ): + super(Container, self).__init__(**kwargs) + self.system_data = None + self.container_status = None + self.data_format = data_format + self.refresh_details = None + self.created_date_time = None + + +class ContainerList(msrest.serialization.Model): + """Collection of all the containers on the Data Box Edge/Gateway device. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar value: The list of containers. + :vartype value: list[~data_box_edge_management_client.models.Container] + :ivar next_link: Link to the next set of results. + :vartype next_link: str + """ + + _validation = { + 'value': {'readonly': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[Container]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ContainerList, self).__init__(**kwargs) + self.value = None + self.next_link = None + + +class DataBoxEdgeDevice(ArmBaseModel): + """The Data Box Edge/Gateway device. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: The path ID that uniquely identifies the object. + :vartype id: str + :ivar name: The object name. + :vartype name: str + :ivar type: The hierarchical type of the object. + :vartype type: str + :param location: Required. 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. + :type location: str + :param tags: A set of tags. The list of tags that describe the device. These tags can be used + to view and group this device (across resource groups). + :type tags: dict[str, str] + :param sku: The SKU type. + :type sku: ~data_box_edge_management_client.models.Sku + :param etag: The etag for the devices. + :type etag: str + :param identity: Msi identity of the resource. + :type identity: ~data_box_edge_management_client.models.ResourceIdentity + :param kind: The kind of the device. Possible values include: "AzureDataBoxGateway", + "AzureStackEdge", "AzureStackHub", "AzureModularDataCentre". + :type kind: str or ~data_box_edge_management_client.models.DataBoxEdgeDeviceKind + :ivar system_data: DataBoxEdge Resource. + :vartype system_data: ~data_box_edge_management_client.models.SystemData + :ivar system_data_properties_system_data: DataBoxEdge Device Properties. + :vartype system_data_properties_system_data: ~data_box_edge_management_client.models.SystemData + :param data_box_edge_device_status: The status of the Data Box Edge/Gateway device. Possible + values include: "ReadyToSetup", "Online", "Offline", "NeedsAttention", "Disconnected", + "PartiallyDisconnected", "Maintenance". + :type data_box_edge_device_status: str or + ~data_box_edge_management_client.models.DataBoxEdgeDeviceStatus + :ivar serial_number: The Serial Number of Data Box Edge/Gateway device. + :vartype serial_number: str + :ivar description: The Description of the Data Box Edge/Gateway device. + :vartype description: str + :ivar model_description: The description of the Data Box Edge/Gateway device model. + :vartype model_description: str + :ivar device_type: The type of the Data Box Edge/Gateway device. Possible values include: + "DataBoxEdgeDevice". + :vartype device_type: str or ~data_box_edge_management_client.models.DeviceType + :ivar friendly_name: The Data Box Edge/Gateway device name. + :vartype friendly_name: str + :ivar culture: The Data Box Edge/Gateway device culture. + :vartype culture: str + :ivar device_model: The Data Box Edge/Gateway device model. + :vartype device_model: str + :ivar device_software_version: The Data Box Edge/Gateway device software version. + :vartype device_software_version: str + :ivar device_local_capacity: The Data Box Edge/Gateway device local capacity in MB. + :vartype device_local_capacity: long + :ivar time_zone: The Data Box Edge/Gateway device timezone. + :vartype time_zone: str + :ivar device_hcs_version: The device software version number of the device (eg: 1.2.18105.6). + :vartype device_hcs_version: str + :ivar configured_role_types: Type of compute roles configured. + :vartype configured_role_types: list[str or ~data_box_edge_management_client.models.RoleTypes] + :ivar node_count: The number of nodes in the cluster. + :vartype node_count: int + :ivar resource_move_details: The details of the move operation on this resource. + :vartype resource_move_details: ~data_box_edge_management_client.models.ResourceMoveDetails + :ivar edge_profile: The details of Edge Profile for this resource. + :vartype edge_profile: ~data_box_edge_management_client.models.EdgeProfile + :param data_residency: The details of data-residency related properties for this resource. + :type data_residency: ~data_box_edge_management_client.models.DataResidency + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': True}, + 'system_data': {'readonly': True}, + 'system_data_properties_system_data': {'readonly': True}, + 'serial_number': {'readonly': True}, + 'description': {'readonly': True}, + 'model_description': {'readonly': True}, + 'device_type': {'readonly': True}, + 'friendly_name': {'readonly': True}, + 'culture': {'readonly': True}, + 'device_model': {'readonly': True}, + 'device_software_version': {'readonly': True}, + 'device_local_capacity': {'readonly': True}, + 'time_zone': {'readonly': True}, + 'device_hcs_version': {'readonly': True}, + 'configured_role_types': {'readonly': True}, + 'node_count': {'readonly': True}, + 'resource_move_details': {'readonly': True}, + 'edge_profile': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'sku': {'key': 'sku', 'type': 'Sku'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'identity': {'key': 'identity', 'type': 'ResourceIdentity'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'system_data_properties_system_data': {'key': 'properties.systemData', 'type': 'SystemData'}, + 'data_box_edge_device_status': {'key': 'properties.dataBoxEdgeDeviceStatus', 'type': 'str'}, + 'serial_number': {'key': 'properties.serialNumber', 'type': 'str'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + 'model_description': {'key': 'properties.modelDescription', 'type': 'str'}, + 'device_type': {'key': 'properties.deviceType', 'type': 'str'}, + 'friendly_name': {'key': 'properties.friendlyName', 'type': 'str'}, + 'culture': {'key': 'properties.culture', 'type': 'str'}, + 'device_model': {'key': 'properties.deviceModel', 'type': 'str'}, + 'device_software_version': {'key': 'properties.deviceSoftwareVersion', 'type': 'str'}, + 'device_local_capacity': {'key': 'properties.deviceLocalCapacity', 'type': 'long'}, + 'time_zone': {'key': 'properties.timeZone', 'type': 'str'}, + 'device_hcs_version': {'key': 'properties.deviceHcsVersion', 'type': 'str'}, + 'configured_role_types': {'key': 'properties.configuredRoleTypes', 'type': '[str]'}, + 'node_count': {'key': 'properties.nodeCount', 'type': 'int'}, + 'resource_move_details': {'key': 'properties.resourceMoveDetails', 'type': 'ResourceMoveDetails'}, + 'edge_profile': {'key': 'properties.edgeProfile', 'type': 'EdgeProfile'}, + 'data_residency': {'key': 'properties.dataResidency', 'type': 'DataResidency'}, + } + + def __init__( + self, + *, + location: str, + tags: Optional[Dict[str, str]] = None, + sku: Optional["Sku"] = None, + etag: Optional[str] = None, + identity: Optional["ResourceIdentity"] = None, + kind: Optional[Union[str, "DataBoxEdgeDeviceKind"]] = None, + data_box_edge_device_status: Optional[Union[str, "DataBoxEdgeDeviceStatus"]] = None, + data_residency: Optional["DataResidency"] = None, + **kwargs + ): + super(DataBoxEdgeDevice, self).__init__(**kwargs) + self.location = location + self.tags = tags + self.sku = sku + self.etag = etag + self.identity = identity + self.kind = kind + self.system_data = None + self.system_data_properties_system_data = None + self.data_box_edge_device_status = data_box_edge_device_status + self.serial_number = None + self.description = None + self.model_description = None + self.device_type = None + self.friendly_name = None + self.culture = None + self.device_model = None + self.device_software_version = None + self.device_local_capacity = None + self.time_zone = None + self.device_hcs_version = None + self.configured_role_types = None + self.node_count = None + self.resource_move_details = None + self.edge_profile = None + self.data_residency = data_residency + + +class DataBoxEdgeDeviceExtendedInfo(ArmBaseModel): + """The extended Info of the Data Box Edge/Gateway device. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: The path ID that uniquely identifies the object. + :vartype id: str + :ivar name: The object name. + :vartype name: str + :ivar type: The hierarchical type of the object. + :vartype type: str + :param encryption_key_thumbprint: The digital signature of encrypted certificate. + :type encryption_key_thumbprint: str + :param encryption_key: The public part of the encryption certificate. Client uses this to + encrypt any secret. + :type encryption_key: str + :ivar resource_key: The Resource ID of the Resource. + :vartype resource_key: str + :param client_secret_store_id: The Key Vault ARM Id for client secrets. + :type client_secret_store_id: str + :param client_secret_store_url: The url to access the Client Key Vault. + :type client_secret_store_url: str + :param channel_integrity_key_name: The name of Channel Integrity Key stored in the Client Key + Vault. + :type channel_integrity_key_name: str + :param channel_integrity_key_version: The version of Channel Integrity Key stored in the Client + Key Vault. + :type channel_integrity_key_version: str + :param key_vault_sync_status: Key vault sync status. Possible values include: "KeyVaultSynced", + "KeyVaultSyncFailed", "KeyVaultNotConfigured", "KeyVaultSyncPending", "KeyVaultSyncing", + "KeyVaultNotSynced". + :type key_vault_sync_status: str or ~data_box_edge_management_client.models.KeyVaultSyncStatus + :ivar device_secrets: Device secrets, will be returned only with ODataFilter + $expand=deviceSecrets. + :vartype device_secrets: dict[str, ~data_box_edge_management_client.models.Secret] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'resource_key': {'readonly': True}, + 'device_secrets': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'encryption_key_thumbprint': {'key': 'properties.encryptionKeyThumbprint', 'type': 'str'}, + 'encryption_key': {'key': 'properties.encryptionKey', 'type': 'str'}, + 'resource_key': {'key': 'properties.resourceKey', 'type': 'str'}, + 'client_secret_store_id': {'key': 'properties.clientSecretStoreId', 'type': 'str'}, + 'client_secret_store_url': {'key': 'properties.clientSecretStoreUrl', 'type': 'str'}, + 'channel_integrity_key_name': {'key': 'properties.channelIntegrityKeyName', 'type': 'str'}, + 'channel_integrity_key_version': {'key': 'properties.channelIntegrityKeyVersion', 'type': 'str'}, + 'key_vault_sync_status': {'key': 'properties.keyVaultSyncStatus', 'type': 'str'}, + 'device_secrets': {'key': 'properties.deviceSecrets', 'type': '{Secret}'}, + } + + def __init__( + self, + *, + encryption_key_thumbprint: Optional[str] = None, + encryption_key: Optional[str] = None, + client_secret_store_id: Optional[str] = None, + client_secret_store_url: Optional[str] = None, + channel_integrity_key_name: Optional[str] = None, + channel_integrity_key_version: Optional[str] = None, + key_vault_sync_status: Optional[Union[str, "KeyVaultSyncStatus"]] = None, + **kwargs + ): + super(DataBoxEdgeDeviceExtendedInfo, self).__init__(**kwargs) + self.encryption_key_thumbprint = encryption_key_thumbprint + self.encryption_key = encryption_key + self.resource_key = None + self.client_secret_store_id = client_secret_store_id + self.client_secret_store_url = client_secret_store_url + self.channel_integrity_key_name = channel_integrity_key_name + self.channel_integrity_key_version = channel_integrity_key_version + self.key_vault_sync_status = key_vault_sync_status + self.device_secrets = None + + +class DataBoxEdgeDeviceExtendedInfoPatch(msrest.serialization.Model): + """The Data Box Edge/Gateway device extended info patch. + + :param client_secret_store_id: The Key Vault ARM Id for client secrets. + :type client_secret_store_id: str + :param client_secret_store_url: The url to access the Client Key Vault. + :type client_secret_store_url: str + :param channel_integrity_key_name: The name for Channel Integrity Key stored in the Client Key + Vault. + :type channel_integrity_key_name: str + :param channel_integrity_key_version: The version of Channel Integrity Key stored in the Client + Key Vault. + :type channel_integrity_key_version: str + :param sync_status: For changing or to initiate the resync to key-vault set the status to + KeyVaultSyncPending, rest of the status will not be applicable. Possible values include: + "KeyVaultSynced", "KeyVaultSyncFailed", "KeyVaultNotConfigured", "KeyVaultSyncPending", + "KeyVaultSyncing", "KeyVaultNotSynced". + :type sync_status: str or ~data_box_edge_management_client.models.KeyVaultSyncStatus + """ + + _attribute_map = { + 'client_secret_store_id': {'key': 'clientSecretStoreId', 'type': 'str'}, + 'client_secret_store_url': {'key': 'clientSecretStoreUrl', 'type': 'str'}, + 'channel_integrity_key_name': {'key': 'channelIntegrityKeyName', 'type': 'str'}, + 'channel_integrity_key_version': {'key': 'channelIntegrityKeyVersion', 'type': 'str'}, + 'sync_status': {'key': 'syncStatus', 'type': 'str'}, + } + + def __init__( + self, + *, + client_secret_store_id: Optional[str] = None, + client_secret_store_url: Optional[str] = None, + channel_integrity_key_name: Optional[str] = None, + channel_integrity_key_version: Optional[str] = None, + sync_status: Optional[Union[str, "KeyVaultSyncStatus"]] = None, + **kwargs + ): + super(DataBoxEdgeDeviceExtendedInfoPatch, self).__init__(**kwargs) + self.client_secret_store_id = client_secret_store_id + self.client_secret_store_url = client_secret_store_url + self.channel_integrity_key_name = channel_integrity_key_name + self.channel_integrity_key_version = channel_integrity_key_version + self.sync_status = sync_status + + +class DataBoxEdgeDeviceList(msrest.serialization.Model): + """The collection of Data Box Edge/Gateway devices. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar value: The list of Data Box Edge/Gateway devices. + :vartype value: list[~data_box_edge_management_client.models.DataBoxEdgeDevice] + :ivar next_link: Link to the next set of results. + :vartype next_link: str + """ + + _validation = { + 'value': {'readonly': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[DataBoxEdgeDevice]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(DataBoxEdgeDeviceList, self).__init__(**kwargs) + self.value = None + self.next_link = None + + +class DataBoxEdgeDevicePatch(msrest.serialization.Model): + """The Data Box Edge/Gateway device patch. + + :param tags: A set of tags. The tags attached to the Data Box Edge/Gateway resource. + :type tags: dict[str, str] + :param identity: Msi identity of the resource. + :type identity: ~data_box_edge_management_client.models.ResourceIdentity + :param edge_profile: Edge Profile property of the Data Box Edge/Gateway device. + :type edge_profile: ~data_box_edge_management_client.models.EdgeProfilePatch + """ + + _attribute_map = { + 'tags': {'key': 'tags', 'type': '{str}'}, + 'identity': {'key': 'identity', 'type': 'ResourceIdentity'}, + 'edge_profile': {'key': 'properties.edgeProfile', 'type': 'EdgeProfilePatch'}, + } + + def __init__( + self, + *, + tags: Optional[Dict[str, str]] = None, + identity: Optional["ResourceIdentity"] = None, + edge_profile: Optional["EdgeProfilePatch"] = None, + **kwargs + ): + super(DataBoxEdgeDevicePatch, self).__init__(**kwargs) + self.tags = tags + self.identity = identity + self.edge_profile = edge_profile + + +class DataBoxEdgeMoveRequest(msrest.serialization.Model): + """Resource Move details. + + All required parameters must be populated in order to send to Azure. + + :param target_resource_group: Required. Target resource group ARMId. + :type target_resource_group: str + :param resources: Required. List of resources to be moved. + :type resources: list[str] + """ + + _validation = { + 'target_resource_group': {'required': True}, + 'resources': {'required': True}, + } + + _attribute_map = { + 'target_resource_group': {'key': 'targetResourceGroup', 'type': 'str'}, + 'resources': {'key': 'resources', 'type': '[str]'}, + } + + def __init__( + self, + *, + target_resource_group: str, + resources: List[str], + **kwargs + ): + super(DataBoxEdgeMoveRequest, self).__init__(**kwargs) + self.target_resource_group = target_resource_group + self.resources = resources + + +class DataBoxEdgeSku(msrest.serialization.Model): + """The Sku information. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar resource_type: The type of the resource. + :vartype resource_type: str + :ivar name: The Sku name. Possible values include: "Gateway", "Edge", "TEA_1Node", + "TEA_1Node_UPS", "TEA_1Node_Heater", "TEA_1Node_UPS_Heater", "TEA_4Node_Heater", + "TEA_4Node_UPS_Heater", "TMA", "TDC", "TCA_Small", "GPU", "TCA_Large", "EdgeP_Base", + "EdgeP_High", "EdgePR_Base", "EdgePR_Base_UPS", "EP2_64_1VPU_W", "EP2_128_1T4_Mx1_W", + "EP2_256_2T4_W", "EdgeMR_Mini", "RCA_Small", "RCA_Large", "RDC", "Management". + :vartype name: str or ~data_box_edge_management_client.models.SkuName + :ivar kind: The Sku kind. + :vartype kind: str + :ivar tier: The Sku tier. Possible values include: "Standard". + :vartype tier: str or ~data_box_edge_management_client.models.SkuTier + :ivar size: The Sku kind. + :vartype size: str + :ivar family: The Sku family. + :vartype family: str + :ivar locations: Availability of the Sku for the region. + :vartype locations: list[str] + :ivar api_versions: The API versions in which Sku is available. + :vartype api_versions: list[str] + :ivar location_info: Availability of the Sku for the location/zone/site. + :vartype location_info: list[~data_box_edge_management_client.models.SkuLocationInfo] + :ivar costs: The pricing info of the Sku. + :vartype costs: list[~data_box_edge_management_client.models.SkuCost] + :ivar signup_option: Sku can be signed up by customer or not. Possible values include: "None", + "Available". + :vartype signup_option: str or ~data_box_edge_management_client.models.SkuSignupOption + :ivar version: Availability of the Sku as preview/stable. Possible values include: "Stable", + "Preview". + :vartype version: str or ~data_box_edge_management_client.models.SkuVersion + :ivar availability: Links to the next set of results. Possible values include: "Available", + "Unavailable". + :vartype availability: str or ~data_box_edge_management_client.models.SkuAvailability + :ivar shipment_types: List of Shipment Types supported by this SKU. + :vartype shipment_types: list[str or ~data_box_edge_management_client.models.ShipmentType] + :ivar capabilities: The capability info of the SKU. + :vartype capabilities: list[~data_box_edge_management_client.models.SkuCapability] + """ + + _validation = { + 'resource_type': {'readonly': True}, + 'name': {'readonly': True}, + 'kind': {'readonly': True}, + 'tier': {'readonly': True}, + 'size': {'readonly': True}, + 'family': {'readonly': True}, + 'locations': {'readonly': True}, + 'api_versions': {'readonly': True}, + 'location_info': {'readonly': True}, + 'costs': {'readonly': True}, + 'signup_option': {'readonly': True}, + 'version': {'readonly': True}, + 'availability': {'readonly': True}, + 'shipment_types': {'readonly': True}, + 'capabilities': {'readonly': True}, + } + + _attribute_map = { + 'resource_type': {'key': 'resourceType', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'tier': {'key': 'tier', 'type': 'str'}, + 'size': {'key': 'size', 'type': 'str'}, + 'family': {'key': 'family', 'type': 'str'}, + 'locations': {'key': 'locations', 'type': '[str]'}, + 'api_versions': {'key': 'apiVersions', 'type': '[str]'}, + 'location_info': {'key': 'locationInfo', 'type': '[SkuLocationInfo]'}, + 'costs': {'key': 'costs', 'type': '[SkuCost]'}, + 'signup_option': {'key': 'signupOption', 'type': 'str'}, + 'version': {'key': 'version', 'type': 'str'}, + 'availability': {'key': 'availability', 'type': 'str'}, + 'shipment_types': {'key': 'shipmentTypes', 'type': '[str]'}, + 'capabilities': {'key': 'capabilities', 'type': '[SkuCapability]'}, + } + + def __init__( + self, + **kwargs + ): + super(DataBoxEdgeSku, self).__init__(**kwargs) + self.resource_type = None + self.name = None + self.kind = None + self.tier = None + self.size = None + self.family = None + self.locations = None + self.api_versions = None + self.location_info = None + self.costs = None + self.signup_option = None + self.version = None + self.availability = None + self.shipment_types = None + self.capabilities = None + + +class DataBoxEdgeSkuList(msrest.serialization.Model): + """List of SKU Information objects. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar value: List of ResourceType Sku. + :vartype value: list[~data_box_edge_management_client.models.DataBoxEdgeSku] + :ivar next_link: Links to the next set of results. + :vartype next_link: str + """ + + _validation = { + 'value': {'readonly': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[DataBoxEdgeSku]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(DataBoxEdgeSkuList, self).__init__(**kwargs) + self.value = None + self.next_link = None + + +class DataResidency(msrest.serialization.Model): + """Wraps data-residency related information for edge-resource and this should be used with ARM layer. + + :param type: DataResidencyType enum. Possible values include: "GeoZoneReplication", + "ZoneReplication". + :type type: str or ~data_box_edge_management_client.models.DataResidencyType + """ + + _attribute_map = { + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__( + self, + *, + type: Optional[Union[str, "DataResidencyType"]] = None, + **kwargs + ): + super(DataResidency, self).__init__(**kwargs) + self.type = type + + +class DcAccessCode(msrest.serialization.Model): + """DC Access code in the case of Self Managed Shipping. + + :param auth_code: DCAccess Code for the Self Managed shipment. + :type auth_code: str + """ + + _attribute_map = { + 'auth_code': {'key': 'properties.authCode', 'type': 'str'}, + } + + def __init__( + self, + *, + auth_code: Optional[str] = None, + **kwargs + ): + super(DcAccessCode, self).__init__(**kwargs) + self.auth_code = auth_code + + +class DiagnosticProactiveLogCollectionSettings(ArmBaseModel): + """The diagnostic proactive log collection settings of a device. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: The path ID that uniquely identifies the object. + :vartype id: str + :ivar name: The object name. + :vartype name: str + :ivar type: The hierarchical type of the object. + :vartype type: str + :ivar system_data: DiagnosticProactiveLogCollectionSettings. + :vartype system_data: ~data_box_edge_management_client.models.SystemData + :param user_consent: Required. Proactive diagnostic collection consent flag. Possible values + include: "Enabled", "Disabled". + :type user_consent: str or ~data_box_edge_management_client.models.ProactiveDiagnosticsConsent + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'system_data': {'readonly': True}, + 'user_consent': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'user_consent': {'key': 'properties.userConsent', 'type': 'str'}, + } + + def __init__( + self, + *, + user_consent: Union[str, "ProactiveDiagnosticsConsent"], + **kwargs + ): + super(DiagnosticProactiveLogCollectionSettings, self).__init__(**kwargs) + self.system_data = None + self.user_consent = user_consent + + +class DiagnosticRemoteSupportSettings(ArmBaseModel): + """The remote support settings of a device. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: The path ID that uniquely identifies the object. + :vartype id: str + :ivar name: The object name. + :vartype name: str + :ivar type: The hierarchical type of the object. + :vartype type: str + :ivar system_data: DiagnosticRemoteSupportSettings. + :vartype system_data: ~data_box_edge_management_client.models.SystemData + :param remote_support_settings_list: Remote support settings list according to the + RemoteApplicationType. + :type remote_support_settings_list: + list[~data_box_edge_management_client.models.RemoteSupportSettings] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'system_data': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'remote_support_settings_list': {'key': 'properties.remoteSupportSettingsList', 'type': '[RemoteSupportSettings]'}, + } + + def __init__( + self, + *, + remote_support_settings_list: Optional[List["RemoteSupportSettings"]] = None, + **kwargs + ): + super(DiagnosticRemoteSupportSettings, self).__init__(**kwargs) + self.system_data = None + self.remote_support_settings_list = remote_support_settings_list + + +class EdgeProfile(msrest.serialization.Model): + """Details about Edge Profile for the resource. + + :param subscription: Edge Profile Subscription. + :type subscription: ~data_box_edge_management_client.models.EdgeProfileSubscription + """ + + _attribute_map = { + 'subscription': {'key': 'subscription', 'type': 'EdgeProfileSubscription'}, + } + + def __init__( + self, + *, + subscription: Optional["EdgeProfileSubscription"] = None, + **kwargs + ): + super(EdgeProfile, self).__init__(**kwargs) + self.subscription = subscription + + +class EdgeProfilePatch(msrest.serialization.Model): + """The Data Box Edge/Gateway Edge Profile patch. + + :param subscription: The Data Box Edge/Gateway Edge Profile Subscription patch. + :type subscription: ~data_box_edge_management_client.models.EdgeProfileSubscriptionPatch + """ + + _attribute_map = { + 'subscription': {'key': 'subscription', 'type': 'EdgeProfileSubscriptionPatch'}, + } + + def __init__( + self, + *, + subscription: Optional["EdgeProfileSubscriptionPatch"] = None, + **kwargs + ): + super(EdgeProfilePatch, self).__init__(**kwargs) + self.subscription = subscription + + +class EdgeProfileSubscription(msrest.serialization.Model): + """Subscription details for the Edge Profile. + + :param registration_id: Edge Subscription Registration ID. + :type registration_id: str + :param id: ARM ID of the subscription. + :type id: str + :param state: Possible values include: "Registered", "Warned", "Suspended", "Deleted", + "Unregistered". + :type state: str or ~data_box_edge_management_client.models.SubscriptionState + :param registration_date: + :type registration_date: str + :param subscription_id: + :type subscription_id: str + :param tenant_id: + :type tenant_id: str + :param location_placement_id: + :type location_placement_id: str + :param quota_id: + :type quota_id: str + :param serialized_details: + :type serialized_details: str + :param registered_features: + :type registered_features: + list[~data_box_edge_management_client.models.SubscriptionRegisteredFeatures] + """ + + _attribute_map = { + 'registration_id': {'key': 'registrationId', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + 'state': {'key': 'state', 'type': 'str'}, + 'registration_date': {'key': 'registrationDate', 'type': 'str'}, + 'subscription_id': {'key': 'subscriptionId', 'type': 'str'}, + 'tenant_id': {'key': 'properties.tenantId', 'type': 'str'}, + 'location_placement_id': {'key': 'properties.locationPlacementId', 'type': 'str'}, + 'quota_id': {'key': 'properties.quotaId', 'type': 'str'}, + 'serialized_details': {'key': 'properties.serializedDetails', 'type': 'str'}, + 'registered_features': {'key': 'properties.registeredFeatures', 'type': '[SubscriptionRegisteredFeatures]'}, + } + + def __init__( + self, + *, + registration_id: Optional[str] = None, + id: Optional[str] = None, + state: Optional[Union[str, "SubscriptionState"]] = None, + registration_date: Optional[str] = None, + subscription_id: Optional[str] = None, + tenant_id: Optional[str] = None, + location_placement_id: Optional[str] = None, + quota_id: Optional[str] = None, + serialized_details: Optional[str] = None, + registered_features: Optional[List["SubscriptionRegisteredFeatures"]] = None, + **kwargs + ): + super(EdgeProfileSubscription, self).__init__(**kwargs) + self.registration_id = registration_id + self.id = id + self.state = state + self.registration_date = registration_date + self.subscription_id = subscription_id + self.tenant_id = tenant_id + self.location_placement_id = location_placement_id + self.quota_id = quota_id + self.serialized_details = serialized_details + self.registered_features = registered_features + + +class EdgeProfileSubscriptionPatch(msrest.serialization.Model): + """The Data Box Edge/Gateway Edge Profile Subscription patch. + + :param id: The path ID that uniquely identifies the subscription of the edge profile. + :type id: str + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + } + + def __init__( + self, + *, + id: Optional[str] = None, + **kwargs + ): + super(EdgeProfileSubscriptionPatch, self).__init__(**kwargs) + self.id = id + + +class EtcdInfo(msrest.serialization.Model): + """Etcd configuration. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar type: Etcd type. + :vartype type: str + :ivar version: Etcd version. + :vartype version: str + """ + + _validation = { + 'type': {'readonly': True}, + 'version': {'readonly': True}, + } + + _attribute_map = { + 'type': {'key': 'type', 'type': 'str'}, + 'version': {'key': 'version', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(EtcdInfo, self).__init__(**kwargs) + self.type = None + self.version = None + + +class Trigger(ArmBaseModel): + """Trigger details. + + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: FileEventTrigger, PeriodicTimerEventTrigger. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: The path ID that uniquely identifies the object. + :vartype id: str + :ivar name: The object name. + :vartype name: str + :ivar type: The hierarchical type of the object. + :vartype type: str + :ivar system_data: Trigger in DataBoxEdge Resource. + :vartype system_data: ~data_box_edge_management_client.models.SystemData + :param kind: Required. Trigger Kind.Constant filled by server. Possible values include: + "FileEvent", "PeriodicTimerEvent". + :type kind: str or ~data_box_edge_management_client.models.TriggerEventType + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'system_data': {'readonly': True}, + 'kind': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'kind': {'key': 'kind', 'type': 'str'}, + } + + _subtype_map = { + 'kind': {'FileEvent': 'FileEventTrigger', 'PeriodicTimerEvent': 'PeriodicTimerEventTrigger'} + } + + def __init__( + self, + **kwargs + ): + super(Trigger, self).__init__(**kwargs) + self.system_data = None + self.kind = 'Trigger' # type: str + + +class FileEventTrigger(Trigger): + """Trigger details. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: The path ID that uniquely identifies the object. + :vartype id: str + :ivar name: The object name. + :vartype name: str + :ivar type: The hierarchical type of the object. + :vartype type: str + :ivar system_data: Trigger in DataBoxEdge Resource. + :vartype system_data: ~data_box_edge_management_client.models.SystemData + :param kind: Required. Trigger Kind.Constant filled by server. Possible values include: + "FileEvent", "PeriodicTimerEvent". + :type kind: str or ~data_box_edge_management_client.models.TriggerEventType + :param source_info: Required. File event source details. + :type source_info: ~data_box_edge_management_client.models.FileSourceInfo + :param sink_info: Required. Role sink info. + :type sink_info: ~data_box_edge_management_client.models.RoleSinkInfo + :param custom_context_tag: A custom context tag typically used to correlate the trigger against + its usage. For example, if a periodic timer trigger is intended for certain specific IoT + modules in the device, the tag can be the name or the image URL of the module. + :type custom_context_tag: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'system_data': {'readonly': True}, + 'kind': {'required': True}, + 'source_info': {'required': True}, + 'sink_info': {'required': True}, + 'custom_context_tag': {'max_length': 192, 'min_length': 0}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'source_info': {'key': 'properties.sourceInfo', 'type': 'FileSourceInfo'}, + 'sink_info': {'key': 'properties.sinkInfo', 'type': 'RoleSinkInfo'}, + 'custom_context_tag': {'key': 'properties.customContextTag', 'type': 'str'}, + } + + def __init__( + self, + *, + source_info: "FileSourceInfo", + sink_info: "RoleSinkInfo", + custom_context_tag: Optional[str] = None, + **kwargs + ): + super(FileEventTrigger, self).__init__(**kwargs) + self.kind = 'FileEvent' # type: str + self.source_info = source_info + self.sink_info = sink_info + self.custom_context_tag = custom_context_tag + + +class FileSourceInfo(msrest.serialization.Model): + """File source details. + + All required parameters must be populated in order to send to Azure. + + :param share_id: Required. File share ID. + :type share_id: str + """ + + _validation = { + 'share_id': {'required': True}, + } + + _attribute_map = { + 'share_id': {'key': 'shareId', 'type': 'str'}, + } + + def __init__( + self, + *, + share_id: str, + **kwargs + ): + super(FileSourceInfo, self).__init__(**kwargs) + self.share_id = share_id + + +class GenerateCertResponse(msrest.serialization.Model): + """Used in activation key generation flow. + + :param public_key: Gets or sets base64 encoded certificate raw data, + this is the public part needed to be uploaded to cert vault. + :type public_key: str + :param private_key: Gets or sets base64 encoded private part of the certificate, + needed to form the activation key. + :type private_key: str + :param expiry_time_in_utc: Gets or sets expiry time in UTC. + :type expiry_time_in_utc: str + """ + + _attribute_map = { + 'public_key': {'key': 'publicKey', 'type': 'str'}, + 'private_key': {'key': 'privateKey', 'type': 'str'}, + 'expiry_time_in_utc': {'key': 'expiryTimeInUTC', 'type': 'str'}, + } + + def __init__( + self, + *, + public_key: Optional[str] = None, + private_key: Optional[str] = None, + expiry_time_in_utc: Optional[str] = None, + **kwargs + ): + super(GenerateCertResponse, self).__init__(**kwargs) + self.public_key = public_key + self.private_key = private_key + self.expiry_time_in_utc = expiry_time_in_utc + + +class ImageRepositoryCredential(msrest.serialization.Model): + """Image repository credential. + + All required parameters must be populated in order to send to Azure. + + :param image_repository_url: Required. Image repository url (e.g.: mcr.microsoft.com). + :type image_repository_url: str + :param user_name: Required. Repository user name. + :type user_name: str + :param password: Repository user password. + :type password: ~data_box_edge_management_client.models.AsymmetricEncryptedSecret + """ + + _validation = { + 'image_repository_url': {'required': True}, + 'user_name': {'required': True}, + } + + _attribute_map = { + 'image_repository_url': {'key': 'imageRepositoryUrl', 'type': 'str'}, + 'user_name': {'key': 'userName', 'type': 'str'}, + 'password': {'key': 'password', 'type': 'AsymmetricEncryptedSecret'}, + } + + def __init__( + self, + *, + image_repository_url: str, + user_name: str, + password: Optional["AsymmetricEncryptedSecret"] = None, + **kwargs + ): + super(ImageRepositoryCredential, self).__init__(**kwargs) + self.image_repository_url = image_repository_url + self.user_name = user_name + self.password = password + + +class IoTAddon(Addon): + """IoT Addon. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: The path ID that uniquely identifies the object. + :vartype id: str + :ivar name: The object name. + :vartype name: str + :ivar type: The hierarchical type of the object. + :vartype type: str + :param kind: Required. Addon type.Constant filled by server. Possible values include: + "IotEdge", "ArcForKubernetes". + :type kind: str or ~data_box_edge_management_client.models.AddonType + :ivar system_data: Addon type. + :vartype system_data: ~data_box_edge_management_client.models.SystemData + :param io_t_device_details: Required. IoT device metadata to which appliance needs to be + connected. + :type io_t_device_details: ~data_box_edge_management_client.models.IoTDeviceInfo + :param io_t_edge_device_details: Required. IoT edge device to which the IoT Addon needs to be + configured. + :type io_t_edge_device_details: ~data_box_edge_management_client.models.IoTDeviceInfo + :ivar version: Version of IoT running on the appliance. + :vartype version: str + :ivar host_platform: Host OS supported by the IoT addon. Possible values include: "Windows", + "Linux". + :vartype host_platform: str or ~data_box_edge_management_client.models.PlatformType + :ivar host_platform_type: Platform where the runtime is hosted. Possible values include: + "KubernetesCluster", "LinuxVM". + :vartype host_platform_type: str or ~data_box_edge_management_client.models.HostPlatformType + :ivar provisioning_state: Addon Provisioning State. Possible values include: "Invalid", + "Creating", "Created", "Updating", "Reconfiguring", "Failed", "Deleting". + :vartype provisioning_state: str or ~data_box_edge_management_client.models.AddonState + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'kind': {'required': True}, + 'system_data': {'readonly': True}, + 'io_t_device_details': {'required': True}, + 'io_t_edge_device_details': {'required': True}, + 'version': {'readonly': True}, + 'host_platform': {'readonly': True}, + 'host_platform_type': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'io_t_device_details': {'key': 'properties.ioTDeviceDetails', 'type': 'IoTDeviceInfo'}, + 'io_t_edge_device_details': {'key': 'properties.ioTEdgeDeviceDetails', 'type': 'IoTDeviceInfo'}, + 'version': {'key': 'properties.version', 'type': 'str'}, + 'host_platform': {'key': 'properties.hostPlatform', 'type': 'str'}, + 'host_platform_type': {'key': 'properties.hostPlatformType', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + } + + def __init__( + self, + *, + io_t_device_details: "IoTDeviceInfo", + io_t_edge_device_details: "IoTDeviceInfo", + **kwargs + ): + super(IoTAddon, self).__init__(**kwargs) + self.kind = 'IotEdge' # type: str + self.io_t_device_details = io_t_device_details + self.io_t_edge_device_details = io_t_edge_device_details + self.version = None + self.host_platform = None + self.host_platform_type = None + self.provisioning_state = None + + +class IoTDeviceInfo(msrest.serialization.Model): + """Metadata of IoT device/IoT Edge device to be configured. + + All required parameters must be populated in order to send to Azure. + + :param device_id: Required. ID of the IoT device/edge device. + :type device_id: str + :param io_t_host_hub: Required. Host name for the IoT hub associated to the device. + :type io_t_host_hub: str + :param io_t_host_hub_id: Id for the IoT hub associated to the device. + :type io_t_host_hub_id: str + :param authentication: Encrypted IoT device/IoT edge device connection string. + :type authentication: ~data_box_edge_management_client.models.Authentication + """ + + _validation = { + 'device_id': {'required': True}, + 'io_t_host_hub': {'required': True}, + } + + _attribute_map = { + 'device_id': {'key': 'deviceId', 'type': 'str'}, + 'io_t_host_hub': {'key': 'ioTHostHub', 'type': 'str'}, + 'io_t_host_hub_id': {'key': 'ioTHostHubId', 'type': 'str'}, + 'authentication': {'key': 'authentication', 'type': 'Authentication'}, + } + + def __init__( + self, + *, + device_id: str, + io_t_host_hub: str, + io_t_host_hub_id: Optional[str] = None, + authentication: Optional["Authentication"] = None, + **kwargs + ): + super(IoTDeviceInfo, self).__init__(**kwargs) + self.device_id = device_id + self.io_t_host_hub = io_t_host_hub + self.io_t_host_hub_id = io_t_host_hub_id + self.authentication = authentication + + +class IoTEdgeAgentInfo(msrest.serialization.Model): + """IoT edge agent details is optional, this will be used for download system Agent module while bootstrapping IoT Role if specified. + + All required parameters must be populated in order to send to Azure. + + :param image_name: Required. Name of the IoT edge agent image. + :type image_name: str + :param tag: Required. Image Tag. + :type tag: str + :param image_repository: Image repository details. + :type image_repository: ~data_box_edge_management_client.models.ImageRepositoryCredential + """ + + _validation = { + 'image_name': {'required': True}, + 'tag': {'required': True}, + } + + _attribute_map = { + 'image_name': {'key': 'imageName', 'type': 'str'}, + 'tag': {'key': 'tag', 'type': 'str'}, + 'image_repository': {'key': 'imageRepository', 'type': 'ImageRepositoryCredential'}, + } + + def __init__( + self, + *, + image_name: str, + tag: str, + image_repository: Optional["ImageRepositoryCredential"] = None, + **kwargs + ): + super(IoTEdgeAgentInfo, self).__init__(**kwargs) + self.image_name = image_name + self.tag = tag + self.image_repository = image_repository + + +class IoTRole(Role): + """Compute role. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: The path ID that uniquely identifies the object. + :vartype id: str + :ivar name: The object name. + :vartype name: str + :ivar type: The hierarchical type of the object. + :vartype type: str + :param kind: Required. Role type.Constant filled by server. Possible values include: "IOT", + "ASA", "Functions", "Cognitive", "MEC", "CloudEdgeManagement", "Kubernetes". + :type kind: str or ~data_box_edge_management_client.models.RoleTypes + :ivar system_data: Role configured on ASE resource. + :vartype system_data: ~data_box_edge_management_client.models.SystemData + :param host_platform: Host OS supported by the IoT role. Possible values include: "Windows", + "Linux". + :type host_platform: str or ~data_box_edge_management_client.models.PlatformType + :param io_t_device_details: IoT device metadata to which data box edge device needs to be + connected. + :type io_t_device_details: ~data_box_edge_management_client.models.IoTDeviceInfo + :param io_t_edge_device_details: IoT edge device to which the IoT role needs to be configured. + :type io_t_edge_device_details: ~data_box_edge_management_client.models.IoTDeviceInfo + :param share_mappings: Mount points of shares in role(s). + :type share_mappings: list[~data_box_edge_management_client.models.MountPointMap] + :param io_t_edge_agent_info: Iot edge agent details to download the agent and bootstrap iot + runtime. + :type io_t_edge_agent_info: ~data_box_edge_management_client.models.IoTEdgeAgentInfo + :ivar host_platform_type: Platform where the Iot runtime is hosted. Possible values include: + "KubernetesCluster", "LinuxVM". + :vartype host_platform_type: str or ~data_box_edge_management_client.models.HostPlatformType + :param compute_resource: Resource allocation. + :type compute_resource: ~data_box_edge_management_client.models.ComputeResource + :param role_status: Role status. Possible values include: "Enabled", "Disabled". + :type role_status: str or ~data_box_edge_management_client.models.RoleStatus + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'kind': {'required': True}, + 'system_data': {'readonly': True}, + 'host_platform_type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'host_platform': {'key': 'properties.hostPlatform', 'type': 'str'}, + 'io_t_device_details': {'key': 'properties.ioTDeviceDetails', 'type': 'IoTDeviceInfo'}, + 'io_t_edge_device_details': {'key': 'properties.ioTEdgeDeviceDetails', 'type': 'IoTDeviceInfo'}, + 'share_mappings': {'key': 'properties.shareMappings', 'type': '[MountPointMap]'}, + 'io_t_edge_agent_info': {'key': 'properties.ioTEdgeAgentInfo', 'type': 'IoTEdgeAgentInfo'}, + 'host_platform_type': {'key': 'properties.hostPlatformType', 'type': 'str'}, + 'compute_resource': {'key': 'properties.computeResource', 'type': 'ComputeResource'}, + 'role_status': {'key': 'properties.roleStatus', 'type': 'str'}, + } + + def __init__( + self, + *, + host_platform: Optional[Union[str, "PlatformType"]] = None, + io_t_device_details: Optional["IoTDeviceInfo"] = None, + io_t_edge_device_details: Optional["IoTDeviceInfo"] = None, + share_mappings: Optional[List["MountPointMap"]] = None, + io_t_edge_agent_info: Optional["IoTEdgeAgentInfo"] = None, + compute_resource: Optional["ComputeResource"] = None, + role_status: Optional[Union[str, "RoleStatus"]] = None, + **kwargs + ): + super(IoTRole, self).__init__(**kwargs) + self.kind = 'IOT' # type: str + self.host_platform = host_platform + self.io_t_device_details = io_t_device_details + self.io_t_edge_device_details = io_t_edge_device_details + self.share_mappings = share_mappings + self.io_t_edge_agent_info = io_t_edge_agent_info + self.host_platform_type = None + self.compute_resource = compute_resource + self.role_status = role_status + + +class Ipv4Config(msrest.serialization.Model): + """Details related to the IPv4 address configuration. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar ip_address: The IPv4 address of the network adapter. + :vartype ip_address: str + :ivar subnet: The IPv4 subnet of the network adapter. + :vartype subnet: str + :ivar gateway: The IPv4 gateway of the network adapter. + :vartype gateway: str + """ + + _validation = { + 'ip_address': {'readonly': True}, + 'subnet': {'readonly': True}, + 'gateway': {'readonly': True}, + } + + _attribute_map = { + 'ip_address': {'key': 'ipAddress', 'type': 'str'}, + 'subnet': {'key': 'subnet', 'type': 'str'}, + 'gateway': {'key': 'gateway', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(Ipv4Config, self).__init__(**kwargs) + self.ip_address = None + self.subnet = None + self.gateway = None + + +class Ipv6Config(msrest.serialization.Model): + """Details related to the IPv6 address configuration. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar ip_address: The IPv6 address of the network adapter. + :vartype ip_address: str + :ivar prefix_length: The IPv6 prefix of the network adapter. + :vartype prefix_length: int + :ivar gateway: The IPv6 gateway of the network adapter. + :vartype gateway: str + """ + + _validation = { + 'ip_address': {'readonly': True}, + 'prefix_length': {'readonly': True}, + 'gateway': {'readonly': True}, + } + + _attribute_map = { + 'ip_address': {'key': 'ipAddress', 'type': 'str'}, + 'prefix_length': {'key': 'prefixLength', 'type': 'int'}, + 'gateway': {'key': 'gateway', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(Ipv6Config, self).__init__(**kwargs) + self.ip_address = None + self.prefix_length = None + self.gateway = None + + +class Job(msrest.serialization.Model): + """A device job. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: The path ID that uniquely identifies the object. + :vartype id: str + :ivar name: The name of the object. + :vartype name: str + :ivar type: The hierarchical type of the object. + :vartype type: str + :ivar status: The current status of the job. Possible values include: "Invalid", "Running", + "Succeeded", "Failed", "Canceled", "Paused", "Scheduled". + :vartype status: str or ~data_box_edge_management_client.models.JobStatus + :ivar start_time: The UTC date and time at which the job started. + :vartype start_time: ~datetime.datetime + :ivar end_time: The UTC date and time at which the job completed. + :vartype end_time: ~datetime.datetime + :ivar percent_complete: The percentage of the job that is complete. + :vartype percent_complete: int + :ivar error: The error details. + :vartype error: ~data_box_edge_management_client.models.JobErrorDetails + :ivar job_type: The type of the job. Possible values include: "Invalid", "ScanForUpdates", + "DownloadUpdates", "InstallUpdates", "RefreshShare", "RefreshContainer", "Backup", "Restore", + "TriggerSupportPackage". + :vartype job_type: str or ~data_box_edge_management_client.models.JobType + :ivar current_stage: Current stage of the update operation. Possible values include: "Unknown", + "Initial", "ScanStarted", "ScanComplete", "ScanFailed", "DownloadStarted", "DownloadComplete", + "DownloadFailed", "InstallStarted", "InstallComplete", "InstallFailed", "RebootInitiated", + "Success", "Failure", "RescanStarted", "RescanComplete", "RescanFailed". + :vartype current_stage: str or ~data_box_edge_management_client.models.UpdateOperationStage + :ivar download_progress: The download progress. + :vartype download_progress: ~data_box_edge_management_client.models.UpdateDownloadProgress + :ivar install_progress: The install progress. + :vartype install_progress: ~data_box_edge_management_client.models.UpdateInstallProgress + :ivar total_refresh_errors: Total number of errors encountered during the refresh process. + :vartype total_refresh_errors: int + :ivar error_manifest_file: Local share/remote container relative path to the error manifest + file of the refresh. + :vartype error_manifest_file: str + :ivar refreshed_entity_id: ARM ID of the entity that was refreshed. + :vartype refreshed_entity_id: str + :param folder: If only subfolders need to be refreshed, then the subfolder path inside the + share or container. (The path is empty if there are no subfolders.). + :type folder: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'status': {'readonly': True}, + 'start_time': {'readonly': True}, + 'end_time': {'readonly': True}, + 'percent_complete': {'readonly': True}, + 'error': {'readonly': True}, + 'job_type': {'readonly': True}, + 'current_stage': {'readonly': True}, + 'download_progress': {'readonly': True}, + 'install_progress': {'readonly': True}, + 'total_refresh_errors': {'readonly': True}, + 'error_manifest_file': {'readonly': True}, + 'refreshed_entity_id': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'status': {'key': 'status', 'type': 'str'}, + 'start_time': {'key': 'startTime', 'type': 'iso-8601'}, + 'end_time': {'key': 'endTime', 'type': 'iso-8601'}, + 'percent_complete': {'key': 'percentComplete', 'type': 'int'}, + 'error': {'key': 'error', 'type': 'JobErrorDetails'}, + 'job_type': {'key': 'properties.jobType', 'type': 'str'}, + 'current_stage': {'key': 'properties.currentStage', 'type': 'str'}, + 'download_progress': {'key': 'properties.downloadProgress', 'type': 'UpdateDownloadProgress'}, + 'install_progress': {'key': 'properties.installProgress', 'type': 'UpdateInstallProgress'}, + 'total_refresh_errors': {'key': 'properties.totalRefreshErrors', 'type': 'int'}, + 'error_manifest_file': {'key': 'properties.errorManifestFile', 'type': 'str'}, + 'refreshed_entity_id': {'key': 'properties.refreshedEntityId', 'type': 'str'}, + 'folder': {'key': 'properties.folder', 'type': 'str'}, + } + + def __init__( + self, + *, + folder: Optional[str] = None, + **kwargs + ): + super(Job, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None + self.status = None + self.start_time = None + self.end_time = None + self.percent_complete = None + self.error = None + self.job_type = None + self.current_stage = None + self.download_progress = None + self.install_progress = None + self.total_refresh_errors = None + self.error_manifest_file = None + self.refreshed_entity_id = None + self.folder = folder + + +class JobErrorDetails(msrest.serialization.Model): + """The job error information containing the list of job errors. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar error_details: The error details. + :vartype error_details: list[~data_box_edge_management_client.models.JobErrorItem] + :ivar code: The code intended for programmatic access. + :vartype code: str + :ivar message: The message that describes the error in detail. + :vartype message: str + """ + + _validation = { + 'error_details': {'readonly': True}, + 'code': {'readonly': True}, + 'message': {'readonly': True}, + } + + _attribute_map = { + 'error_details': {'key': 'errorDetails', 'type': '[JobErrorItem]'}, + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(JobErrorDetails, self).__init__(**kwargs) + self.error_details = None + self.code = None + self.message = None + + +class JobErrorItem(msrest.serialization.Model): + """The job error items. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar recommendations: The recommended actions. + :vartype recommendations: list[str] + :ivar code: The code intended for programmatic access. + :vartype code: str + :ivar message: The message that describes the error in detail. + :vartype message: str + """ + + _validation = { + 'recommendations': {'readonly': True}, + 'code': {'readonly': True}, + 'message': {'readonly': True}, + } + + _attribute_map = { + 'recommendations': {'key': 'recommendations', 'type': '[str]'}, + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(JobErrorItem, self).__init__(**kwargs) + self.recommendations = None + self.code = None + self.message = None + + +class KubernetesClusterInfo(msrest.serialization.Model): + """Kubernetes cluster configuration. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar etcd_info: Etcd configuration. + :vartype etcd_info: ~data_box_edge_management_client.models.EtcdInfo + :ivar nodes: Kubernetes cluster nodes. + :vartype nodes: list[~data_box_edge_management_client.models.NodeInfo] + :param version: Required. Kubernetes cluster version. + :type version: str + """ + + _validation = { + 'etcd_info': {'readonly': True}, + 'nodes': {'readonly': True}, + 'version': {'required': True}, + } + + _attribute_map = { + 'etcd_info': {'key': 'etcdInfo', 'type': 'EtcdInfo'}, + 'nodes': {'key': 'nodes', 'type': '[NodeInfo]'}, + 'version': {'key': 'version', 'type': 'str'}, + } + + def __init__( + self, + *, + version: str, + **kwargs + ): + super(KubernetesClusterInfo, self).__init__(**kwargs) + self.etcd_info = None + self.nodes = None + self.version = version + + +class KubernetesIpConfiguration(msrest.serialization.Model): + """Kubernetes node IP configuration. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar port: Port of the Kubernetes node. + :vartype port: str + :param ip_address: IP address of the Kubernetes node. + :type ip_address: str + """ + + _validation = { + 'port': {'readonly': True}, + } + + _attribute_map = { + 'port': {'key': 'port', 'type': 'str'}, + 'ip_address': {'key': 'ipAddress', 'type': 'str'}, + } + + def __init__( + self, + *, + ip_address: Optional[str] = None, + **kwargs + ): + super(KubernetesIpConfiguration, self).__init__(**kwargs) + self.port = None + self.ip_address = ip_address + + +class KubernetesRole(Role): + """Kubernetes role, Currently it's in Private Preview. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: The path ID that uniquely identifies the object. + :vartype id: str + :ivar name: The object name. + :vartype name: str + :ivar type: The hierarchical type of the object. + :vartype type: str + :param kind: Required. Role type.Constant filled by server. Possible values include: "IOT", + "ASA", "Functions", "Cognitive", "MEC", "CloudEdgeManagement", "Kubernetes". + :type kind: str or ~data_box_edge_management_client.models.RoleTypes + :ivar system_data: Role configured on ASE resource. + :vartype system_data: ~data_box_edge_management_client.models.SystemData + :param host_platform: Host OS supported by the Kubernetes role. Possible values include: + "Windows", "Linux". + :type host_platform: str or ~data_box_edge_management_client.models.PlatformType + :ivar provisioning_state: State of Kubernetes deployment. Possible values include: "Invalid", + "Creating", "Created", "Updating", "Reconfiguring", "Failed", "Deleting". + :vartype provisioning_state: str or ~data_box_edge_management_client.models.KubernetesState + :ivar host_platform_type: Platform where the runtime is hosted. Possible values include: + "KubernetesCluster", "LinuxVM". + :vartype host_platform_type: str or ~data_box_edge_management_client.models.HostPlatformType + :param kubernetes_cluster_info: Kubernetes cluster configuration. + :type kubernetes_cluster_info: ~data_box_edge_management_client.models.KubernetesClusterInfo + :param kubernetes_role_resources: Kubernetes role resources. + :type kubernetes_role_resources: + ~data_box_edge_management_client.models.KubernetesRoleResources + :param role_status: Role status. Possible values include: "Enabled", "Disabled". + :type role_status: str or ~data_box_edge_management_client.models.RoleStatus + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'kind': {'required': True}, + 'system_data': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + 'host_platform_type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'host_platform': {'key': 'properties.hostPlatform', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'host_platform_type': {'key': 'properties.hostPlatformType', 'type': 'str'}, + 'kubernetes_cluster_info': {'key': 'properties.kubernetesClusterInfo', 'type': 'KubernetesClusterInfo'}, + 'kubernetes_role_resources': {'key': 'properties.kubernetesRoleResources', 'type': 'KubernetesRoleResources'}, + 'role_status': {'key': 'properties.roleStatus', 'type': 'str'}, + } + + def __init__( + self, + *, + host_platform: Optional[Union[str, "PlatformType"]] = None, + kubernetes_cluster_info: Optional["KubernetesClusterInfo"] = None, + kubernetes_role_resources: Optional["KubernetesRoleResources"] = None, + role_status: Optional[Union[str, "RoleStatus"]] = None, + **kwargs + ): + super(KubernetesRole, self).__init__(**kwargs) + self.kind = 'Kubernetes' # type: str + self.host_platform = host_platform + self.provisioning_state = None + self.host_platform_type = None + self.kubernetes_cluster_info = kubernetes_cluster_info + self.kubernetes_role_resources = kubernetes_role_resources + self.role_status = role_status + + +class KubernetesRoleCompute(msrest.serialization.Model): + """Kubernetes role compute resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :param vm_profile: Required. VM profile. + :type vm_profile: str + :ivar memory_in_bytes: Memory in bytes. + :vartype memory_in_bytes: long + :ivar processor_count: Processor count. + :vartype processor_count: int + """ + + _validation = { + 'vm_profile': {'required': True}, + 'memory_in_bytes': {'readonly': True}, + 'processor_count': {'readonly': True}, + } + + _attribute_map = { + 'vm_profile': {'key': 'vmProfile', 'type': 'str'}, + 'memory_in_bytes': {'key': 'memoryInBytes', 'type': 'long'}, + 'processor_count': {'key': 'processorCount', 'type': 'int'}, + } + + def __init__( + self, + *, + vm_profile: str, + **kwargs + ): + super(KubernetesRoleCompute, self).__init__(**kwargs) + self.vm_profile = vm_profile + self.memory_in_bytes = None + self.processor_count = None + + +class KubernetesRoleNetwork(msrest.serialization.Model): + """Kubernetes role network resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar cni_config: Cni configuration. + :vartype cni_config: ~data_box_edge_management_client.models.CniConfig + :ivar load_balancer_config: Load balancer configuration. + :vartype load_balancer_config: ~data_box_edge_management_client.models.LoadBalancerConfig + """ + + _validation = { + 'cni_config': {'readonly': True}, + 'load_balancer_config': {'readonly': True}, + } + + _attribute_map = { + 'cni_config': {'key': 'cniConfig', 'type': 'CniConfig'}, + 'load_balancer_config': {'key': 'loadBalancerConfig', 'type': 'LoadBalancerConfig'}, + } + + def __init__( + self, + **kwargs + ): + super(KubernetesRoleNetwork, self).__init__(**kwargs) + self.cni_config = None + self.load_balancer_config = None + + +class KubernetesRoleResources(msrest.serialization.Model): + """Kubernetes role resources. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :param storage: Kubernetes role storage resource. + :type storage: ~data_box_edge_management_client.models.KubernetesRoleStorage + :param compute: Required. Kubernetes role compute resource. + :type compute: ~data_box_edge_management_client.models.KubernetesRoleCompute + :ivar network: Kubernetes role network resource. + :vartype network: ~data_box_edge_management_client.models.KubernetesRoleNetwork + """ + + _validation = { + 'compute': {'required': True}, + 'network': {'readonly': True}, + } + + _attribute_map = { + 'storage': {'key': 'storage', 'type': 'KubernetesRoleStorage'}, + 'compute': {'key': 'compute', 'type': 'KubernetesRoleCompute'}, + 'network': {'key': 'network', 'type': 'KubernetesRoleNetwork'}, + } + + def __init__( + self, + *, + compute: "KubernetesRoleCompute", + storage: Optional["KubernetesRoleStorage"] = None, + **kwargs + ): + super(KubernetesRoleResources, self).__init__(**kwargs) + self.storage = storage + self.compute = compute + self.network = None + + +class KubernetesRoleStorage(msrest.serialization.Model): + """Kubernetes role storage resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar storage_classes: Kubernetes storage class info. + :vartype storage_classes: + list[~data_box_edge_management_client.models.KubernetesRoleStorageClassInfo] + :param endpoints: Mount points of shares in role(s). + :type endpoints: list[~data_box_edge_management_client.models.MountPointMap] + """ + + _validation = { + 'storage_classes': {'readonly': True}, + } + + _attribute_map = { + 'storage_classes': {'key': 'storageClasses', 'type': '[KubernetesRoleStorageClassInfo]'}, + 'endpoints': {'key': 'endpoints', 'type': '[MountPointMap]'}, + } + + def __init__( + self, + *, + endpoints: Optional[List["MountPointMap"]] = None, + **kwargs + ): + super(KubernetesRoleStorage, self).__init__(**kwargs) + self.storage_classes = None + self.endpoints = endpoints + + +class KubernetesRoleStorageClassInfo(msrest.serialization.Model): + """Kubernetes storage class info. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar name: Storage class name. + :vartype name: str + :ivar type: Storage class type. + :vartype type: str + :ivar posix_compliant: If provisioned storage is posix compliant. Possible values include: + "Invalid", "Enabled", "Disabled". + :vartype posix_compliant: str or ~data_box_edge_management_client.models.PosixComplianceStatus + """ + + _validation = { + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'posix_compliant': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'posix_compliant': {'key': 'posixCompliant', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(KubernetesRoleStorageClassInfo, self).__init__(**kwargs) + self.name = None + self.type = None + self.posix_compliant = None + + +class LoadBalancerConfig(msrest.serialization.Model): + """Load balancer configuration. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar type: Load balancer type. + :vartype type: str + :ivar version: Load balancer version. + :vartype version: str + """ + + _validation = { + 'type': {'readonly': True}, + 'version': {'readonly': True}, + } + + _attribute_map = { + 'type': {'key': 'type', 'type': 'str'}, + 'version': {'key': 'version', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(LoadBalancerConfig, self).__init__(**kwargs) + self.type = None + self.version = None + + +class MecRole(Role): + """MEC role. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: The path ID that uniquely identifies the object. + :vartype id: str + :ivar name: The object name. + :vartype name: str + :ivar type: The hierarchical type of the object. + :vartype type: str + :param kind: Required. Role type.Constant filled by server. Possible values include: "IOT", + "ASA", "Functions", "Cognitive", "MEC", "CloudEdgeManagement", "Kubernetes". + :type kind: str or ~data_box_edge_management_client.models.RoleTypes + :ivar system_data: Role configured on ASE resource. + :vartype system_data: ~data_box_edge_management_client.models.SystemData + :param connection_string: Activation key of the MEC. + :type connection_string: ~data_box_edge_management_client.models.AsymmetricEncryptedSecret + :param controller_endpoint: Controller Endpoint. + :type controller_endpoint: str + :param resource_unique_id: Unique Id of the Resource. + :type resource_unique_id: str + :param role_status: Role status. Possible values include: "Enabled", "Disabled". + :type role_status: str or ~data_box_edge_management_client.models.RoleStatus + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'kind': {'required': True}, + 'system_data': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'connection_string': {'key': 'properties.connectionString', 'type': 'AsymmetricEncryptedSecret'}, + 'controller_endpoint': {'key': 'properties.controllerEndpoint', 'type': 'str'}, + 'resource_unique_id': {'key': 'properties.resourceUniqueId', 'type': 'str'}, + 'role_status': {'key': 'properties.roleStatus', 'type': 'str'}, + } + + def __init__( + self, + *, + connection_string: Optional["AsymmetricEncryptedSecret"] = None, + controller_endpoint: Optional[str] = None, + resource_unique_id: Optional[str] = None, + role_status: Optional[Union[str, "RoleStatus"]] = None, + **kwargs + ): + super(MecRole, self).__init__(**kwargs) + self.kind = 'MEC' # type: str + self.connection_string = connection_string + self.controller_endpoint = controller_endpoint + self.resource_unique_id = resource_unique_id + self.role_status = role_status + + +class MetricConfiguration(msrest.serialization.Model): + """Metric configuration. + + All required parameters must be populated in order to send to Azure. + + :param resource_id: Required. The Resource ID on which the metrics should be pushed. + :type resource_id: str + :param mdm_account: The MDM account to which the counters should be pushed. + :type mdm_account: str + :param metric_name_space: The MDM namespace to which the counters should be pushed. This is + required if MDMAccount is specified. + :type metric_name_space: str + :param counter_sets: Required. Host name for the IoT hub associated to the device. + :type counter_sets: list[~data_box_edge_management_client.models.MetricCounterSet] + """ + + _validation = { + 'resource_id': {'required': True}, + 'counter_sets': {'required': True}, + } + + _attribute_map = { + 'resource_id': {'key': 'resourceId', 'type': 'str'}, + 'mdm_account': {'key': 'mdmAccount', 'type': 'str'}, + 'metric_name_space': {'key': 'metricNameSpace', 'type': 'str'}, + 'counter_sets': {'key': 'counterSets', 'type': '[MetricCounterSet]'}, + } + + def __init__( + self, + *, + resource_id: str, + counter_sets: List["MetricCounterSet"], + mdm_account: Optional[str] = None, + metric_name_space: Optional[str] = None, + **kwargs + ): + super(MetricConfiguration, self).__init__(**kwargs) + self.resource_id = resource_id + self.mdm_account = mdm_account + self.metric_name_space = metric_name_space + self.counter_sets = counter_sets + + +class MetricCounter(msrest.serialization.Model): + """The metric counter. + + All required parameters must be populated in order to send to Azure. + + :param name: Required. The counter name. + :type name: str + :param instance: The instance from which counter should be collected. + :type instance: str + :param dimension_filter: The dimension filter. + :type dimension_filter: list[~data_box_edge_management_client.models.MetricDimension] + :param additional_dimensions: The additional dimensions to be added to metric. + :type additional_dimensions: list[~data_box_edge_management_client.models.MetricDimension] + """ + + _validation = { + 'name': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'instance': {'key': 'instance', 'type': 'str'}, + 'dimension_filter': {'key': 'dimensionFilter', 'type': '[MetricDimension]'}, + 'additional_dimensions': {'key': 'additionalDimensions', 'type': '[MetricDimension]'}, + } + + def __init__( + self, + *, + name: str, + instance: Optional[str] = None, + dimension_filter: Optional[List["MetricDimension"]] = None, + additional_dimensions: Optional[List["MetricDimension"]] = None, + **kwargs + ): + super(MetricCounter, self).__init__(**kwargs) + self.name = name + self.instance = instance + self.dimension_filter = dimension_filter + self.additional_dimensions = additional_dimensions + + +class MetricCounterSet(msrest.serialization.Model): + """The metric counter set. + + All required parameters must be populated in order to send to Azure. + + :param counters: Required. The counters that should be collected in this set. + :type counters: list[~data_box_edge_management_client.models.MetricCounter] + """ + + _validation = { + 'counters': {'required': True}, + } + + _attribute_map = { + 'counters': {'key': 'counters', 'type': '[MetricCounter]'}, + } + + def __init__( + self, + *, + counters: List["MetricCounter"], + **kwargs + ): + super(MetricCounterSet, self).__init__(**kwargs) + self.counters = counters + + +class MetricDimension(msrest.serialization.Model): + """The metric dimension. + + All required parameters must be populated in order to send to Azure. + + :param source_type: Required. The dimension type. + :type source_type: str + :param source_name: Required. The dimension value. + :type source_name: str + """ + + _validation = { + 'source_type': {'required': True}, + 'source_name': {'required': True}, + } + + _attribute_map = { + 'source_type': {'key': 'sourceType', 'type': 'str'}, + 'source_name': {'key': 'sourceName', 'type': 'str'}, + } + + def __init__( + self, + *, + source_type: str, + source_name: str, + **kwargs + ): + super(MetricDimension, self).__init__(**kwargs) + self.source_type = source_type + self.source_name = source_name + + +class MetricDimensionV1(msrest.serialization.Model): + """Metric Dimension v1. + + :param name: Name of the metrics dimension. + :type name: str + :param display_name: Display name of the metrics dimension. + :type display_name: str + :param to_be_exported_for_shoebox: To be exported to shoe box. + :type to_be_exported_for_shoebox: bool + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'display_name': {'key': 'displayName', 'type': 'str'}, + 'to_be_exported_for_shoebox': {'key': 'toBeExportedForShoebox', 'type': 'bool'}, + } + + def __init__( + self, + *, + name: Optional[str] = None, + display_name: Optional[str] = None, + to_be_exported_for_shoebox: Optional[bool] = None, + **kwargs + ): + super(MetricDimensionV1, self).__init__(**kwargs) + self.name = name + self.display_name = display_name + self.to_be_exported_for_shoebox = to_be_exported_for_shoebox + + +class MetricSpecificationV1(msrest.serialization.Model): + """Metric specification version 1. + + :param name: Name of the metric. + :type name: str + :param display_name: Display name of the metric. + :type display_name: str + :param display_description: Description of the metric to be displayed. + :type display_description: str + :param unit: Metric units. Possible values include: "NotSpecified", "Percent", "Count", + "Seconds", "Milliseconds", "Bytes", "BytesPerSecond", "CountPerSecond". + :type unit: str or ~data_box_edge_management_client.models.MetricUnit + :param aggregation_type: Metric aggregation type. Possible values include: "NotSpecified", + "None", "Average", "Minimum", "Maximum", "Total", "Count". + :type aggregation_type: str or ~data_box_edge_management_client.models.MetricAggregationType + :param dimensions: Metric dimensions, other than default dimension which is resource. + :type dimensions: list[~data_box_edge_management_client.models.MetricDimensionV1] + :param fill_gap_with_zero: Set true to fill the gaps with zero. + :type fill_gap_with_zero: bool + :param category: Metric category. Possible values include: "Capacity", "Transaction". + :type category: str or ~data_box_edge_management_client.models.MetricCategory + :param resource_id_dimension_name_override: Resource name override. + :type resource_id_dimension_name_override: str + :param supported_time_grain_types: Support granularity of metrics. + :type supported_time_grain_types: list[str or + ~data_box_edge_management_client.models.TimeGrain] + :param supported_aggregation_types: Support metric aggregation type. + :type supported_aggregation_types: list[str or + ~data_box_edge_management_client.models.MetricAggregationType] + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'display_name': {'key': 'displayName', 'type': 'str'}, + 'display_description': {'key': 'displayDescription', 'type': 'str'}, + 'unit': {'key': 'unit', 'type': 'str'}, + 'aggregation_type': {'key': 'aggregationType', 'type': 'str'}, + 'dimensions': {'key': 'dimensions', 'type': '[MetricDimensionV1]'}, + 'fill_gap_with_zero': {'key': 'fillGapWithZero', 'type': 'bool'}, + 'category': {'key': 'category', 'type': 'str'}, + 'resource_id_dimension_name_override': {'key': 'resourceIdDimensionNameOverride', 'type': 'str'}, + 'supported_time_grain_types': {'key': 'supportedTimeGrainTypes', 'type': '[str]'}, + 'supported_aggregation_types': {'key': 'supportedAggregationTypes', 'type': '[str]'}, + } + + def __init__( + self, + *, + name: Optional[str] = None, + display_name: Optional[str] = None, + display_description: Optional[str] = None, + unit: Optional[Union[str, "MetricUnit"]] = None, + aggregation_type: Optional[Union[str, "MetricAggregationType"]] = None, + dimensions: Optional[List["MetricDimensionV1"]] = None, + fill_gap_with_zero: Optional[bool] = None, + category: Optional[Union[str, "MetricCategory"]] = None, + resource_id_dimension_name_override: Optional[str] = None, + supported_time_grain_types: Optional[List[Union[str, "TimeGrain"]]] = None, + supported_aggregation_types: Optional[List[Union[str, "MetricAggregationType"]]] = None, + **kwargs + ): + super(MetricSpecificationV1, self).__init__(**kwargs) + self.name = name + self.display_name = display_name + self.display_description = display_description + self.unit = unit + self.aggregation_type = aggregation_type + self.dimensions = dimensions + self.fill_gap_with_zero = fill_gap_with_zero + self.category = category + self.resource_id_dimension_name_override = resource_id_dimension_name_override + self.supported_time_grain_types = supported_time_grain_types + self.supported_aggregation_types = supported_aggregation_types + + +class MonitoringMetricConfiguration(ArmBaseModel): + """The metric setting details for the role. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: The path ID that uniquely identifies the object. + :vartype id: str + :ivar name: The object name. + :vartype name: str + :ivar type: The hierarchical type of the object. + :vartype type: str + :ivar system_data: MonitoringConfiguration on ASE device. + :vartype system_data: ~data_box_edge_management_client.models.SystemData + :param metric_configurations: Required. The metrics configuration details. + :type metric_configurations: list[~data_box_edge_management_client.models.MetricConfiguration] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'system_data': {'readonly': True}, + 'metric_configurations': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'metric_configurations': {'key': 'properties.metricConfigurations', 'type': '[MetricConfiguration]'}, + } + + def __init__( + self, + *, + metric_configurations: List["MetricConfiguration"], + **kwargs + ): + super(MonitoringMetricConfiguration, self).__init__(**kwargs) + self.system_data = None + self.metric_configurations = metric_configurations + + +class MonitoringMetricConfigurationList(msrest.serialization.Model): + """Collection of metric configurations. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar value: The list of metric configurations. + :vartype value: list[~data_box_edge_management_client.models.MonitoringMetricConfiguration] + :ivar next_link: Link to the next set of results. + :vartype next_link: str + """ + + _validation = { + 'value': {'readonly': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[MonitoringMetricConfiguration]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(MonitoringMetricConfigurationList, self).__init__(**kwargs) + self.value = None + self.next_link = None + + +class MountPointMap(msrest.serialization.Model): + """The share mount point. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :param share_id: Required. ID of the share mounted to the role VM. + :type share_id: str + :ivar role_id: ID of the role to which share is mounted. + :vartype role_id: str + :ivar mount_point: Mount point for the share. + :vartype mount_point: str + :ivar mount_type: Mounting type. Possible values include: "Volume", "HostPath". + :vartype mount_type: str or ~data_box_edge_management_client.models.MountType + :ivar role_type: Role type. Possible values include: "IOT", "ASA", "Functions", "Cognitive", + "MEC", "CloudEdgeManagement", "Kubernetes". + :vartype role_type: str or ~data_box_edge_management_client.models.RoleTypes + """ + + _validation = { + 'share_id': {'required': True}, + 'role_id': {'readonly': True}, + 'mount_point': {'readonly': True}, + 'mount_type': {'readonly': True}, + 'role_type': {'readonly': True}, + } + + _attribute_map = { + 'share_id': {'key': 'shareId', 'type': 'str'}, + 'role_id': {'key': 'roleId', 'type': 'str'}, + 'mount_point': {'key': 'mountPoint', 'type': 'str'}, + 'mount_type': {'key': 'mountType', 'type': 'str'}, + 'role_type': {'key': 'roleType', 'type': 'str'}, + } + + def __init__( + self, + *, + share_id: str, + **kwargs + ): + super(MountPointMap, self).__init__(**kwargs) + self.share_id = share_id + self.role_id = None + self.mount_point = None + self.mount_type = None + self.role_type = None + + +class NetworkAdapter(msrest.serialization.Model): + """Represents the networkAdapter on a device. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar adapter_id: Instance ID of network adapter. + :vartype adapter_id: str + :ivar adapter_position: Hardware position of network adapter. + :vartype adapter_position: ~data_box_edge_management_client.models.NetworkAdapterPosition + :ivar index: Logical index of the adapter. + :vartype index: int + :ivar node_id: Node ID of the network adapter. + :vartype node_id: str + :ivar network_adapter_name: Network adapter name. + :vartype network_adapter_name: str + :ivar label: Hardware label for the adapter. + :vartype label: str + :ivar mac_address: MAC address. + :vartype mac_address: str + :ivar link_speed: Link speed. + :vartype link_speed: long + :ivar status: Value indicating whether this adapter is valid. Possible values include: + "Inactive", "Active". + :vartype status: str or ~data_box_edge_management_client.models.NetworkAdapterStatus + :param rdma_status: Value indicating whether this adapter is RDMA capable. Possible values + include: "Incapable", "Capable". + :type rdma_status: str or ~data_box_edge_management_client.models.NetworkAdapterRdmaStatus + :param dhcp_status: Value indicating whether this adapter has DHCP enabled. Possible values + include: "Disabled", "Enabled". + :type dhcp_status: str or ~data_box_edge_management_client.models.NetworkAdapterDhcpStatus + :ivar ipv4_configuration: The IPv4 configuration of the network adapter. + :vartype ipv4_configuration: ~data_box_edge_management_client.models.Ipv4Config + :ivar ipv6_configuration: The IPv6 configuration of the network adapter. + :vartype ipv6_configuration: ~data_box_edge_management_client.models.Ipv6Config + :ivar ipv6_link_local_address: The IPv6 local address. + :vartype ipv6_link_local_address: str + :ivar dns_servers: The list of DNS Servers of the device. + :vartype dns_servers: list[str] + """ + + _validation = { + 'adapter_id': {'readonly': True}, + 'adapter_position': {'readonly': True}, + 'index': {'readonly': True}, + 'node_id': {'readonly': True}, + 'network_adapter_name': {'readonly': True}, + 'label': {'readonly': True}, + 'mac_address': {'readonly': True}, + 'link_speed': {'readonly': True}, + 'status': {'readonly': True}, + 'ipv4_configuration': {'readonly': True}, + 'ipv6_configuration': {'readonly': True}, + 'ipv6_link_local_address': {'readonly': True}, + 'dns_servers': {'readonly': True}, + } + + _attribute_map = { + 'adapter_id': {'key': 'adapterId', 'type': 'str'}, + 'adapter_position': {'key': 'adapterPosition', 'type': 'NetworkAdapterPosition'}, + 'index': {'key': 'index', 'type': 'int'}, + 'node_id': {'key': 'nodeId', 'type': 'str'}, + 'network_adapter_name': {'key': 'networkAdapterName', 'type': 'str'}, + 'label': {'key': 'label', 'type': 'str'}, + 'mac_address': {'key': 'macAddress', 'type': 'str'}, + 'link_speed': {'key': 'linkSpeed', 'type': 'long'}, + 'status': {'key': 'status', 'type': 'str'}, + 'rdma_status': {'key': 'rdmaStatus', 'type': 'str'}, + 'dhcp_status': {'key': 'dhcpStatus', 'type': 'str'}, + 'ipv4_configuration': {'key': 'ipv4Configuration', 'type': 'Ipv4Config'}, + 'ipv6_configuration': {'key': 'ipv6Configuration', 'type': 'Ipv6Config'}, + 'ipv6_link_local_address': {'key': 'ipv6LinkLocalAddress', 'type': 'str'}, + 'dns_servers': {'key': 'dnsServers', 'type': '[str]'}, + } + + def __init__( + self, + *, + rdma_status: Optional[Union[str, "NetworkAdapterRdmaStatus"]] = None, + dhcp_status: Optional[Union[str, "NetworkAdapterDhcpStatus"]] = None, + **kwargs + ): + super(NetworkAdapter, self).__init__(**kwargs) + self.adapter_id = None + self.adapter_position = None + self.index = None + self.node_id = None + self.network_adapter_name = None + self.label = None + self.mac_address = None + self.link_speed = None + self.status = None + self.rdma_status = rdma_status + self.dhcp_status = dhcp_status + self.ipv4_configuration = None + self.ipv6_configuration = None + self.ipv6_link_local_address = None + self.dns_servers = None + + +class NetworkAdapterPosition(msrest.serialization.Model): + """The network adapter position. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar network_group: The network group. Possible values include: "None", "NonRDMA", "RDMA". + :vartype network_group: str or ~data_box_edge_management_client.models.NetworkGroup + :ivar port: The port. + :vartype port: int + """ + + _validation = { + 'network_group': {'readonly': True}, + 'port': {'readonly': True}, + } + + _attribute_map = { + 'network_group': {'key': 'networkGroup', 'type': 'str'}, + 'port': {'key': 'port', 'type': 'int'}, + } + + def __init__( + self, + **kwargs + ): + super(NetworkAdapterPosition, self).__init__(**kwargs) + self.network_group = None + self.port = None + + +class NetworkSettings(ArmBaseModel): + """The network settings of a device. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: The path ID that uniquely identifies the object. + :vartype id: str + :ivar name: The object name. + :vartype name: str + :ivar type: The hierarchical type of the object. + :vartype type: str + :ivar system_data: NetworkSettings on ASE device. + :vartype system_data: ~data_box_edge_management_client.models.SystemData + :ivar network_adapters: The network adapter list on the device. + :vartype network_adapters: list[~data_box_edge_management_client.models.NetworkAdapter] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'system_data': {'readonly': True}, + 'network_adapters': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'network_adapters': {'key': 'properties.networkAdapters', 'type': '[NetworkAdapter]'}, + } + + def __init__( + self, + **kwargs + ): + super(NetworkSettings, self).__init__(**kwargs) + self.system_data = None + self.network_adapters = None + + +class Node(ArmBaseModel): + """Represents a single node in a Data box Edge/Gateway device +Gateway devices, standalone Edge devices and a single node cluster Edge device will all have 1 node +Multi-node Edge devices will have more than 1 nodes. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: The path ID that uniquely identifies the object. + :vartype id: str + :ivar name: The object name. + :vartype name: str + :ivar type: The hierarchical type of the object. + :vartype type: str + :ivar node_status: The current status of the individual node. Possible values include: + "Unknown", "Up", "Down", "Rebooting", "ShuttingDown". + :vartype node_status: str or ~data_box_edge_management_client.models.NodeStatus + :ivar node_chassis_serial_number: Serial number of the Chassis. + :vartype node_chassis_serial_number: str + :ivar node_serial_number: Serial number of the individual node. + :vartype node_serial_number: str + :ivar node_display_name: Display Name of the individual node. + :vartype node_display_name: str + :ivar node_friendly_software_version: Friendly software version name that is currently + installed on the node. + :vartype node_friendly_software_version: str + :ivar node_hcs_version: HCS version that is currently installed on the node. + :vartype node_hcs_version: str + :ivar node_instance_id: Guid instance id of the node. + :vartype node_instance_id: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'node_status': {'readonly': True}, + 'node_chassis_serial_number': {'readonly': True}, + 'node_serial_number': {'readonly': True}, + 'node_display_name': {'readonly': True}, + 'node_friendly_software_version': {'readonly': True}, + 'node_hcs_version': {'readonly': True}, + 'node_instance_id': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'node_status': {'key': 'properties.nodeStatus', 'type': 'str'}, + 'node_chassis_serial_number': {'key': 'properties.nodeChassisSerialNumber', 'type': 'str'}, + 'node_serial_number': {'key': 'properties.nodeSerialNumber', 'type': 'str'}, + 'node_display_name': {'key': 'properties.nodeDisplayName', 'type': 'str'}, + 'node_friendly_software_version': {'key': 'properties.nodeFriendlySoftwareVersion', 'type': 'str'}, + 'node_hcs_version': {'key': 'properties.nodeHcsVersion', 'type': 'str'}, + 'node_instance_id': {'key': 'properties.nodeInstanceId', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(Node, self).__init__(**kwargs) + self.node_status = None + self.node_chassis_serial_number = None + self.node_serial_number = None + self.node_display_name = None + self.node_friendly_software_version = None + self.node_hcs_version = None + self.node_instance_id = None + + +class NodeInfo(msrest.serialization.Model): + """Kubernetes node info. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar name: Node name. + :vartype name: str + :ivar type: Node type - Master/Worker. Possible values include: "Invalid", "Master", "Worker". + :vartype type: str or ~data_box_edge_management_client.models.KubernetesNodeType + :param ip_configuration: IP Configuration of the Kubernetes node. + :type ip_configuration: list[~data_box_edge_management_client.models.KubernetesIpConfiguration] + """ + + _validation = { + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'ip_configuration': {'key': 'ipConfiguration', 'type': '[KubernetesIpConfiguration]'}, + } + + def __init__( + self, + *, + ip_configuration: Optional[List["KubernetesIpConfiguration"]] = None, + **kwargs + ): + super(NodeInfo, self).__init__(**kwargs) + self.name = None + self.type = None + self.ip_configuration = ip_configuration + + +class NodeList(msrest.serialization.Model): + """Collection of Nodes. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar value: The list of Nodes. + :vartype value: list[~data_box_edge_management_client.models.Node] + :ivar next_link: Link to the next set of results. + :vartype next_link: str + """ + + _validation = { + 'value': {'readonly': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[Node]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(NodeList, self).__init__(**kwargs) + self.value = None + self.next_link = None + + +class Operation(msrest.serialization.Model): + """Operations. + + :param name: Name of the operation. + :type name: str + :param is_data_action: Is data action. + :type is_data_action: bool + :param display: Properties displayed for the operation. + :type display: ~data_box_edge_management_client.models.OperationDisplay + :param origin: Origin of the operation. + :type origin: str + :param service_specification: Service specification. + :type service_specification: ~data_box_edge_management_client.models.ServiceSpecification + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'is_data_action': {'key': 'isDataAction', 'type': 'bool'}, + 'display': {'key': 'display', 'type': 'OperationDisplay'}, + 'origin': {'key': 'origin', 'type': 'str'}, + 'service_specification': {'key': 'properties.serviceSpecification', 'type': 'ServiceSpecification'}, + } + + def __init__( + self, + *, + name: Optional[str] = None, + is_data_action: Optional[bool] = None, + display: Optional["OperationDisplay"] = None, + origin: Optional[str] = None, + service_specification: Optional["ServiceSpecification"] = None, + **kwargs + ): + super(Operation, self).__init__(**kwargs) + self.name = name + self.is_data_action = is_data_action + self.display = display + self.origin = origin + self.service_specification = service_specification + + +class OperationDisplay(msrest.serialization.Model): + """Operation display properties. + + :param provider: Provider name. + :type provider: str + :param resource: The type of resource in which the operation is performed. + :type resource: str + :param operation: Operation to be performed on the resource. + :type operation: str + :param description: Description of the operation to be performed. + :type description: str + """ + + _attribute_map = { + 'provider': {'key': 'provider', 'type': 'str'}, + 'resource': {'key': 'resource', 'type': 'str'}, + 'operation': {'key': 'operation', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + } + + def __init__( + self, + *, + provider: Optional[str] = None, + resource: Optional[str] = None, + operation: Optional[str] = None, + description: Optional[str] = None, + **kwargs + ): + super(OperationDisplay, self).__init__(**kwargs) + self.provider = provider + self.resource = resource + self.operation = operation + self.description = description + + +class OperationsList(msrest.serialization.Model): + """The list of operations used for the discovery of available provider operations. + + All required parameters must be populated in order to send to Azure. + + :param value: Required. The value. + :type value: list[~data_box_edge_management_client.models.Operation] + :param next_link: Link to the next set of results. + :type next_link: str + """ + + _validation = { + 'value': {'required': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[Operation]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + value: List["Operation"], + next_link: Optional[str] = None, + **kwargs + ): + super(OperationsList, self).__init__(**kwargs) + self.value = value + self.next_link = next_link + + +class Order(ArmBaseModel): + """The order details. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: The path ID that uniquely identifies the object. + :vartype id: str + :ivar name: The object name. + :vartype name: str + :ivar type: The hierarchical type of the object. + :vartype type: str + :ivar system_data: Order configured on ASE resource. + :vartype system_data: ~data_box_edge_management_client.models.SystemData + :param contact_information: The contact details. + :type contact_information: ~data_box_edge_management_client.models.ContactDetails + :param shipping_address: The shipping address. + :type shipping_address: ~data_box_edge_management_client.models.Address + :ivar current_status: Current status of the order. + :vartype current_status: ~data_box_edge_management_client.models.OrderStatus + :ivar order_history: List of status changes in the order. + :vartype order_history: list[~data_box_edge_management_client.models.OrderStatus] + :ivar serial_number: Serial number of the device. + :vartype serial_number: str + :ivar delivery_tracking_info: Tracking information for the package delivered to the customer + whether it has an original or a replacement device. + :vartype delivery_tracking_info: list[~data_box_edge_management_client.models.TrackingInfo] + :ivar return_tracking_info: Tracking information for the package returned from the customer + whether it has an original or a replacement device. + :vartype return_tracking_info: list[~data_box_edge_management_client.models.TrackingInfo] + :param shipment_type: ShipmentType of the order. Possible values include: "NotApplicable", + "ShippedToCustomer", "SelfPickup". + :type shipment_type: str or ~data_box_edge_management_client.models.ShipmentType + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'system_data': {'readonly': True}, + 'current_status': {'readonly': True}, + 'order_history': {'readonly': True}, + 'serial_number': {'readonly': True}, + 'delivery_tracking_info': {'readonly': True}, + 'return_tracking_info': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'contact_information': {'key': 'properties.contactInformation', 'type': 'ContactDetails'}, + 'shipping_address': {'key': 'properties.shippingAddress', 'type': 'Address'}, + 'current_status': {'key': 'properties.currentStatus', 'type': 'OrderStatus'}, + 'order_history': {'key': 'properties.orderHistory', 'type': '[OrderStatus]'}, + 'serial_number': {'key': 'properties.serialNumber', 'type': 'str'}, + 'delivery_tracking_info': {'key': 'properties.deliveryTrackingInfo', 'type': '[TrackingInfo]'}, + 'return_tracking_info': {'key': 'properties.returnTrackingInfo', 'type': '[TrackingInfo]'}, + 'shipment_type': {'key': 'properties.shipmentType', 'type': 'str'}, + } + + def __init__( + self, + *, + contact_information: Optional["ContactDetails"] = None, + shipping_address: Optional["Address"] = None, + shipment_type: Optional[Union[str, "ShipmentType"]] = None, + **kwargs + ): + super(Order, self).__init__(**kwargs) + self.system_data = None + self.contact_information = contact_information + self.shipping_address = shipping_address + self.current_status = None + self.order_history = None + self.serial_number = None + self.delivery_tracking_info = None + self.return_tracking_info = None + self.shipment_type = shipment_type + + +class OrderList(msrest.serialization.Model): + """List of order entities. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar value: The list of orders. + :vartype value: list[~data_box_edge_management_client.models.Order] + :ivar next_link: Link to the next set of results. + :vartype next_link: str + """ + + _validation = { + 'value': {'readonly': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[Order]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(OrderList, self).__init__(**kwargs) + self.value = None + self.next_link = None + + +class OrderStatus(msrest.serialization.Model): + """Represents a single status change. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :param status: Required. Status of the order as per the allowed status types. Possible values + include: "Untracked", "AwaitingFulfillment", "AwaitingPreparation", "AwaitingShipment", + "Shipped", "Arriving", "Delivered", "ReplacementRequested", "LostDevice", "Declined", + "ReturnInitiated", "AwaitingReturnShipment", "ShippedBack", "CollectedAtMicrosoft", + "AwaitingPickup", "PickupCompleted", "AwaitingDrop". + :type status: str or ~data_box_edge_management_client.models.OrderState + :ivar update_date_time: Time of status update. + :vartype update_date_time: ~datetime.datetime + :param comments: Comments related to this status change. + :type comments: str + :ivar tracking_information: Tracking information related to the state in the ordering flow. + :vartype tracking_information: ~data_box_edge_management_client.models.TrackingInfo + :ivar additional_order_details: Dictionary to hold generic information which is not stored + by the already existing properties. + :vartype additional_order_details: dict[str, str] + """ + + _validation = { + 'status': {'required': True}, + 'update_date_time': {'readonly': True}, + 'tracking_information': {'readonly': True}, + 'additional_order_details': {'readonly': True}, + } + + _attribute_map = { + 'status': {'key': 'status', 'type': 'str'}, + 'update_date_time': {'key': 'updateDateTime', 'type': 'iso-8601'}, + 'comments': {'key': 'comments', 'type': 'str'}, + 'tracking_information': {'key': 'trackingInformation', 'type': 'TrackingInfo'}, + 'additional_order_details': {'key': 'additionalOrderDetails', 'type': '{str}'}, + } + + def __init__( + self, + *, + status: Union[str, "OrderState"], + comments: Optional[str] = None, + **kwargs + ): + super(OrderStatus, self).__init__(**kwargs) + self.status = status + self.update_date_time = None + self.comments = comments + self.tracking_information = None + self.additional_order_details = None + + +class PeriodicTimerEventTrigger(Trigger): + """Trigger details. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: The path ID that uniquely identifies the object. + :vartype id: str + :ivar name: The object name. + :vartype name: str + :ivar type: The hierarchical type of the object. + :vartype type: str + :ivar system_data: Trigger in DataBoxEdge Resource. + :vartype system_data: ~data_box_edge_management_client.models.SystemData + :param kind: Required. Trigger Kind.Constant filled by server. Possible values include: + "FileEvent", "PeriodicTimerEvent". + :type kind: str or ~data_box_edge_management_client.models.TriggerEventType + :param source_info: Required. Periodic timer details. + :type source_info: ~data_box_edge_management_client.models.PeriodicTimerSourceInfo + :param sink_info: Required. Role Sink information. + :type sink_info: ~data_box_edge_management_client.models.RoleSinkInfo + :param custom_context_tag: A custom context tag typically used to correlate the trigger against + its usage. For example, if a periodic timer trigger is intended for certain specific IoT + modules in the device, the tag can be the name or the image URL of the module. + :type custom_context_tag: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'system_data': {'readonly': True}, + 'kind': {'required': True}, + 'source_info': {'required': True}, + 'sink_info': {'required': True}, + 'custom_context_tag': {'max_length': 192, 'min_length': 0}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'source_info': {'key': 'properties.sourceInfo', 'type': 'PeriodicTimerSourceInfo'}, + 'sink_info': {'key': 'properties.sinkInfo', 'type': 'RoleSinkInfo'}, + 'custom_context_tag': {'key': 'properties.customContextTag', 'type': 'str'}, + } + + def __init__( + self, + *, + source_info: "PeriodicTimerSourceInfo", + sink_info: "RoleSinkInfo", + custom_context_tag: Optional[str] = None, + **kwargs + ): + super(PeriodicTimerEventTrigger, self).__init__(**kwargs) + self.kind = 'PeriodicTimerEvent' # type: str + self.source_info = source_info + self.sink_info = sink_info + self.custom_context_tag = custom_context_tag + + +class PeriodicTimerSourceInfo(msrest.serialization.Model): + """Periodic timer event source. + + All required parameters must be populated in order to send to Azure. + + :param start_time: Required. The time of the day that results in a valid trigger. Schedule is + computed with reference to the time specified upto seconds. If timezone is not specified the + time will considered to be in device timezone. The value will always be returned as UTC time. + :type start_time: ~datetime.datetime + :param schedule: Required. Periodic frequency at which timer event needs to be raised. Supports + daily, hourly, minutes, and seconds. + :type schedule: str + :param topic: Topic where periodic events are published to IoT device. + :type topic: str + """ + + _validation = { + 'start_time': {'required': True}, + 'schedule': {'required': True}, + } + + _attribute_map = { + 'start_time': {'key': 'startTime', 'type': 'iso-8601'}, + 'schedule': {'key': 'schedule', 'type': 'str'}, + 'topic': {'key': 'topic', 'type': 'str'}, + } + + def __init__( + self, + *, + start_time: datetime.datetime, + schedule: str, + topic: Optional[str] = None, + **kwargs + ): + super(PeriodicTimerSourceInfo, self).__init__(**kwargs) + self.start_time = start_time + self.schedule = schedule + self.topic = topic + + +class RefreshDetails(msrest.serialization.Model): + """Fields for tracking refresh job on the share or container. + + :param in_progress_refresh_job_id: If a refresh job is currently in progress on this share or + container, this field indicates the ARM resource ID of that job. The field is empty if no job + is in progress. + :type in_progress_refresh_job_id: str + :param last_completed_refresh_job_time_in_utc: Indicates the completed time for the last + refresh job on this particular share or container, if any.This could be a failed job or a + successful job. + :type last_completed_refresh_job_time_in_utc: ~datetime.datetime + :param error_manifest_file: Indicates the relative path of the error xml for the last refresh + job on this particular share or container, if any. This could be a failed job or a successful + job. + :type error_manifest_file: str + :param last_job: Indicates the id of the last refresh job on this particular share or + container,if any. This could be a failed job or a successful job. + :type last_job: str + """ + + _attribute_map = { + 'in_progress_refresh_job_id': {'key': 'inProgressRefreshJobId', 'type': 'str'}, + 'last_completed_refresh_job_time_in_utc': {'key': 'lastCompletedRefreshJobTimeInUTC', 'type': 'iso-8601'}, + 'error_manifest_file': {'key': 'errorManifestFile', 'type': 'str'}, + 'last_job': {'key': 'lastJob', 'type': 'str'}, + } + + def __init__( + self, + *, + in_progress_refresh_job_id: Optional[str] = None, + last_completed_refresh_job_time_in_utc: Optional[datetime.datetime] = None, + error_manifest_file: Optional[str] = None, + last_job: Optional[str] = None, + **kwargs + ): + super(RefreshDetails, self).__init__(**kwargs) + self.in_progress_refresh_job_id = in_progress_refresh_job_id + self.last_completed_refresh_job_time_in_utc = last_completed_refresh_job_time_in_utc + self.error_manifest_file = error_manifest_file + self.last_job = last_job + + +class RemoteSupportSettings(msrest.serialization.Model): + """RemoteApplicationType for which remote support settings is being modified. + + :param remote_application_type: Remote application type. Possible values include: "Powershell", + "WAC", "LocalUI", "AllApplications". + :type remote_application_type: str or + ~data_box_edge_management_client.models.RemoteApplicationType + :param access_level: Access level allowed for this remote application type. Possible values + include: "None", "ReadOnly", "ReadWrite", "FullAccess". + :type access_level: str or ~data_box_edge_management_client.models.AccessLevel + :param expiration_time_stamp_in_utc: Expiration time stamp. + :type expiration_time_stamp_in_utc: ~datetime.datetime + """ + + _attribute_map = { + 'remote_application_type': {'key': 'remoteApplicationType', 'type': 'str'}, + 'access_level': {'key': 'accessLevel', 'type': 'str'}, + 'expiration_time_stamp_in_utc': {'key': 'expirationTimeStampInUTC', 'type': 'iso-8601'}, + } + + def __init__( + self, + *, + remote_application_type: Optional[Union[str, "RemoteApplicationType"]] = None, + access_level: Optional[Union[str, "AccessLevel"]] = None, + expiration_time_stamp_in_utc: Optional[datetime.datetime] = None, + **kwargs + ): + super(RemoteSupportSettings, self).__init__(**kwargs) + self.remote_application_type = remote_application_type + self.access_level = access_level + self.expiration_time_stamp_in_utc = expiration_time_stamp_in_utc + + +class ResourceIdentity(msrest.serialization.Model): + """Msi identity details of the resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param type: Identity type. Possible values include: "None", "SystemAssigned", "UserAssigned". + :type type: str or ~data_box_edge_management_client.models.MsiIdentityType + :ivar principal_id: Service Principal Id backing the Msi. + :vartype principal_id: str + :ivar tenant_id: Home Tenant Id. + :vartype tenant_id: str + """ + + _validation = { + 'principal_id': {'readonly': True}, + 'tenant_id': {'readonly': True}, + } + + _attribute_map = { + 'type': {'key': 'type', 'type': 'str'}, + 'principal_id': {'key': 'principalId', 'type': 'str'}, + 'tenant_id': {'key': 'tenantId', 'type': 'str'}, + } + + def __init__( + self, + *, + type: Optional[Union[str, "MsiIdentityType"]] = None, + **kwargs + ): + super(ResourceIdentity, self).__init__(**kwargs) + self.type = type + self.principal_id = None + self.tenant_id = None + + +class ResourceMoveDetails(msrest.serialization.Model): + """Fields for tracking resource move. + + :param operation_in_progress: Denotes whether move operation is in progress. Possible values + include: "None", "ResourceMoveInProgress", "ResourceMoveFailed". + :type operation_in_progress: str or ~data_box_edge_management_client.models.ResourceMoveStatus + :param operation_in_progress_lock_timeout_in_utc: Denotes the timeout of the operation to + finish. + :type operation_in_progress_lock_timeout_in_utc: ~datetime.datetime + """ + + _attribute_map = { + 'operation_in_progress': {'key': 'operationInProgress', 'type': 'str'}, + 'operation_in_progress_lock_timeout_in_utc': {'key': 'operationInProgressLockTimeoutInUTC', 'type': 'iso-8601'}, + } + + def __init__( + self, + *, + operation_in_progress: Optional[Union[str, "ResourceMoveStatus"]] = None, + operation_in_progress_lock_timeout_in_utc: Optional[datetime.datetime] = None, + **kwargs + ): + super(ResourceMoveDetails, self).__init__(**kwargs) + self.operation_in_progress = operation_in_progress + self.operation_in_progress_lock_timeout_in_utc = operation_in_progress_lock_timeout_in_utc + + +class ResourceTypeSku(msrest.serialization.Model): + """Resource type Sku object. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar resource_type: The resource type. + :vartype resource_type: str + :ivar skus: The skus. + :vartype skus: list[~data_box_edge_management_client.models.SkuInformation] + """ + + _validation = { + 'resource_type': {'readonly': True}, + 'skus': {'readonly': True}, + } + + _attribute_map = { + 'resource_type': {'key': 'resourceType', 'type': 'str'}, + 'skus': {'key': 'skus', 'type': '[SkuInformation]'}, + } + + def __init__( + self, + **kwargs + ): + super(ResourceTypeSku, self).__init__(**kwargs) + self.resource_type = None + self.skus = None + + +class RoleList(msrest.serialization.Model): + """Collection of all the roles on the Data Box Edge device. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar value: The Value. + :vartype value: list[~data_box_edge_management_client.models.Role] + :ivar next_link: Link to the next set of results. + :vartype next_link: str + """ + + _validation = { + 'value': {'readonly': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[Role]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(RoleList, self).__init__(**kwargs) + self.value = None + self.next_link = None + + +class RoleSinkInfo(msrest.serialization.Model): + """Compute role against which events will be raised. + + All required parameters must be populated in order to send to Azure. + + :param role_id: Required. Compute role ID. + :type role_id: str + """ + + _validation = { + 'role_id': {'required': True}, + } + + _attribute_map = { + 'role_id': {'key': 'roleId', 'type': 'str'}, + } + + def __init__( + self, + *, + role_id: str, + **kwargs + ): + super(RoleSinkInfo, self).__init__(**kwargs) + self.role_id = role_id + + +class Secret(msrest.serialization.Model): + """Holds device secret either as a KeyVault reference or as an encrypted value. + + :param encrypted_secret: Encrypted (using device public key) secret value. + :type encrypted_secret: ~data_box_edge_management_client.models.AsymmetricEncryptedSecret + :param key_vault_id: Id of the Key-Vault where secret is stored (ex: + secrets/AuthClientSecret/82ef4346187a4033a10d629cde07d740). + :type key_vault_id: str + """ + + _attribute_map = { + 'encrypted_secret': {'key': 'encryptedSecret', 'type': 'AsymmetricEncryptedSecret'}, + 'key_vault_id': {'key': 'keyVaultId', 'type': 'str'}, + } + + def __init__( + self, + *, + encrypted_secret: Optional["AsymmetricEncryptedSecret"] = None, + key_vault_id: Optional[str] = None, + **kwargs + ): + super(Secret, self).__init__(**kwargs) + self.encrypted_secret = encrypted_secret + self.key_vault_id = key_vault_id + + +class SecuritySettings(ArmBaseModel): + """The security settings of a device. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: The path ID that uniquely identifies the object. + :vartype id: str + :ivar name: The object name. + :vartype name: str + :ivar type: The hierarchical type of the object. + :vartype type: str + :param device_admin_password: Required. Device administrator password as an encrypted string + (encrypted using RSA PKCS #1) is used to sign into the local web UI of the device. The Actual + password should have at least 8 characters that are a combination of uppercase, lowercase, + numeric, and special characters. + :type device_admin_password: ~data_box_edge_management_client.models.AsymmetricEncryptedSecret + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'device_admin_password': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'device_admin_password': {'key': 'properties.deviceAdminPassword', 'type': 'AsymmetricEncryptedSecret'}, + } + + def __init__( + self, + *, + device_admin_password: "AsymmetricEncryptedSecret", + **kwargs + ): + super(SecuritySettings, self).__init__(**kwargs) + self.device_admin_password = device_admin_password + + +class ServiceSpecification(msrest.serialization.Model): + """Service specification. + + :param metric_specifications: Metric specification as defined by shoebox. + :type metric_specifications: + list[~data_box_edge_management_client.models.MetricSpecificationV1] + """ + + _attribute_map = { + 'metric_specifications': {'key': 'metricSpecifications', 'type': '[MetricSpecificationV1]'}, + } + + def __init__( + self, + *, + metric_specifications: Optional[List["MetricSpecificationV1"]] = None, + **kwargs + ): + super(ServiceSpecification, self).__init__(**kwargs) + self.metric_specifications = metric_specifications + + +class Share(ArmBaseModel): + """Represents a share on the Data Box Edge/Gateway device. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: The path ID that uniquely identifies the object. + :vartype id: str + :ivar name: The object name. + :vartype name: str + :ivar type: The hierarchical type of the object. + :vartype type: str + :ivar system_data: Share on ASE device. + :vartype system_data: ~data_box_edge_management_client.models.SystemData + :param description: Description for the share. + :type description: str + :param share_status: Required. Current status of the share. Possible values include: "Offline", + "Unknown", "OK", "Updating", "NeedsAttention". + :type share_status: str or ~data_box_edge_management_client.models.ShareStatus + :param monitoring_status: Required. Current monitoring status of the share. Possible values + include: "Enabled", "Disabled". + :type monitoring_status: str or ~data_box_edge_management_client.models.MonitoringStatus + :param azure_container_info: Azure container mapping for the share. + :type azure_container_info: ~data_box_edge_management_client.models.AzureContainerInfo + :param access_protocol: Required. Access protocol to be used by the share. Possible values + include: "SMB", "NFS". + :type access_protocol: str or ~data_box_edge_management_client.models.ShareAccessProtocol + :param user_access_rights: Mapping of users and corresponding access rights on the share + (required for SMB protocol). + :type user_access_rights: list[~data_box_edge_management_client.models.UserAccessRight] + :param client_access_rights: List of IP addresses and corresponding access rights on the + share(required for NFS protocol). + :type client_access_rights: list[~data_box_edge_management_client.models.ClientAccessRight] + :param refresh_details: Details of the refresh job on this share. + :type refresh_details: ~data_box_edge_management_client.models.RefreshDetails + :ivar share_mappings: Share mount point to the role. + :vartype share_mappings: list[~data_box_edge_management_client.models.MountPointMap] + :param data_policy: Data policy of the share. Possible values include: "Cloud", "Local". + :type data_policy: str or ~data_box_edge_management_client.models.DataPolicy + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'system_data': {'readonly': True}, + 'share_status': {'required': True}, + 'monitoring_status': {'required': True}, + 'access_protocol': {'required': True}, + 'share_mappings': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + 'share_status': {'key': 'properties.shareStatus', 'type': 'str'}, + 'monitoring_status': {'key': 'properties.monitoringStatus', 'type': 'str'}, + 'azure_container_info': {'key': 'properties.azureContainerInfo', 'type': 'AzureContainerInfo'}, + 'access_protocol': {'key': 'properties.accessProtocol', 'type': 'str'}, + 'user_access_rights': {'key': 'properties.userAccessRights', 'type': '[UserAccessRight]'}, + 'client_access_rights': {'key': 'properties.clientAccessRights', 'type': '[ClientAccessRight]'}, + 'refresh_details': {'key': 'properties.refreshDetails', 'type': 'RefreshDetails'}, + 'share_mappings': {'key': 'properties.shareMappings', 'type': '[MountPointMap]'}, + 'data_policy': {'key': 'properties.dataPolicy', 'type': 'str'}, + } + + def __init__( + self, + *, + share_status: Union[str, "ShareStatus"], + monitoring_status: Union[str, "MonitoringStatus"], + access_protocol: Union[str, "ShareAccessProtocol"], + description: Optional[str] = None, + azure_container_info: Optional["AzureContainerInfo"] = None, + user_access_rights: Optional[List["UserAccessRight"]] = None, + client_access_rights: Optional[List["ClientAccessRight"]] = None, + refresh_details: Optional["RefreshDetails"] = None, + data_policy: Optional[Union[str, "DataPolicy"]] = None, + **kwargs + ): + super(Share, self).__init__(**kwargs) + self.system_data = None + self.description = description + self.share_status = share_status + self.monitoring_status = monitoring_status + self.azure_container_info = azure_container_info + self.access_protocol = access_protocol + self.user_access_rights = user_access_rights + self.client_access_rights = client_access_rights + self.refresh_details = refresh_details + self.share_mappings = None + self.data_policy = data_policy + + +class ShareAccessRight(msrest.serialization.Model): + """Specifies the mapping between this particular user and the type of access he has on shares on this device. + + All required parameters must be populated in order to send to Azure. + + :param share_id: Required. The share ID. + :type share_id: str + :param access_type: Required. Type of access to be allowed on the share for this user. Possible + values include: "Change", "Read", "Custom". + :type access_type: str or ~data_box_edge_management_client.models.ShareAccessType + """ + + _validation = { + 'share_id': {'required': True}, + 'access_type': {'required': True}, + } + + _attribute_map = { + 'share_id': {'key': 'shareId', 'type': 'str'}, + 'access_type': {'key': 'accessType', 'type': 'str'}, + } + + def __init__( + self, + *, + share_id: str, + access_type: Union[str, "ShareAccessType"], + **kwargs + ): + super(ShareAccessRight, self).__init__(**kwargs) + self.share_id = share_id + self.access_type = access_type + + +class ShareList(msrest.serialization.Model): + """Collection of all the shares on the Data Box Edge/Gateway device. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar value: The list of shares. + :vartype value: list[~data_box_edge_management_client.models.Share] + :ivar next_link: Link to the next set of results. + :vartype next_link: str + """ + + _validation = { + 'value': {'readonly': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[Share]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ShareList, self).__init__(**kwargs) + self.value = None + self.next_link = None + + +class Sku(msrest.serialization.Model): + """The SKU type. + + :param name: SKU name. Possible values include: "Gateway", "Edge", "TEA_1Node", + "TEA_1Node_UPS", "TEA_1Node_Heater", "TEA_1Node_UPS_Heater", "TEA_4Node_Heater", + "TEA_4Node_UPS_Heater", "TMA", "TDC", "TCA_Small", "GPU", "TCA_Large", "EdgeP_Base", + "EdgeP_High", "EdgePR_Base", "EdgePR_Base_UPS", "EP2_64_1VPU_W", "EP2_128_1T4_Mx1_W", + "EP2_256_2T4_W", "EdgeMR_Mini", "RCA_Small", "RCA_Large", "RDC", "Management". + :type name: str or ~data_box_edge_management_client.models.SkuName + :param tier: The SKU tier. This is based on the SKU name. Possible values include: "Standard". + :type tier: str or ~data_box_edge_management_client.models.SkuTier + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'tier': {'key': 'tier', 'type': 'str'}, + } + + def __init__( + self, + *, + name: Optional[Union[str, "SkuName"]] = None, + tier: Optional[Union[str, "SkuTier"]] = None, + **kwargs + ): + super(Sku, self).__init__(**kwargs) + self.name = name + self.tier = tier + + +class SkuCapability(msrest.serialization.Model): + """The metadata to describe the capability. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar name: An invariant to describe the feature. + :vartype name: str + :ivar value: An invariant if the feature is measured by quantity. + :vartype value: str + """ + + _validation = { + 'name': {'readonly': True}, + 'value': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'value': {'key': 'value', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(SkuCapability, self).__init__(**kwargs) + self.name = None + self.value = None + + +class SkuCost(msrest.serialization.Model): + """The metadata for retrieving price info. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar meter_id: Used for querying price from commerce. + :vartype meter_id: str + :ivar quantity: The cost quantity. + :vartype quantity: long + :ivar extended_unit: The extended unit. + :vartype extended_unit: str + """ + + _validation = { + 'meter_id': {'readonly': True}, + 'quantity': {'readonly': True}, + 'extended_unit': {'readonly': True}, + } + + _attribute_map = { + 'meter_id': {'key': 'meterId', 'type': 'str'}, + 'quantity': {'key': 'quantity', 'type': 'long'}, + 'extended_unit': {'key': 'extendedUnit', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(SkuCost, self).__init__(**kwargs) + self.meter_id = None + self.quantity = None + self.extended_unit = None + + +class SkuInformation(msrest.serialization.Model): + """Sku information. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar name: The sku name. + :vartype name: str + :ivar tier: The sku tier. + :vartype tier: str + :ivar kind: The sku kind. + :vartype kind: str + :ivar family: The Sku family. + :vartype family: str + :ivar costs: The pricing info of the Sku. + :vartype costs: list[~data_box_edge_management_client.models.SkuCost] + :ivar locations: The locations where Sku is available. + :vartype locations: list[str] + :ivar location_info: The locations where Sku is available with zones and sites info. + :vartype location_info: list[~data_box_edge_management_client.models.SkuLocationInfo] + :ivar required_quota_ids: The required quotaIds for the sku to be available. + :vartype required_quota_ids: list[str] + :ivar required_features: The required features for the sku to be available. + :vartype required_features: list[str] + """ + + _validation = { + 'name': {'readonly': True}, + 'tier': {'readonly': True}, + 'kind': {'readonly': True}, + 'family': {'readonly': True}, + 'costs': {'readonly': True}, + 'locations': {'readonly': True}, + 'location_info': {'readonly': True}, + 'required_quota_ids': {'readonly': True}, + 'required_features': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'tier': {'key': 'tier', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'family': {'key': 'family', 'type': 'str'}, + 'costs': {'key': 'costs', 'type': '[SkuCost]'}, + 'locations': {'key': 'locations', 'type': '[str]'}, + 'location_info': {'key': 'locationInfo', 'type': '[SkuLocationInfo]'}, + 'required_quota_ids': {'key': 'requiredQuotaIds', 'type': '[str]'}, + 'required_features': {'key': 'requiredFeatures', 'type': '[str]'}, + } + + def __init__( + self, + **kwargs + ): + super(SkuInformation, self).__init__(**kwargs) + self.name = None + self.tier = None + self.kind = None + self.family = None + self.costs = None + self.locations = None + self.location_info = None + self.required_quota_ids = None + self.required_features = None + + +class SkuInformationList(msrest.serialization.Model): + """List of SKU Information objects. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar value: List of ResourceTypeSku objects. + :vartype value: list[~data_box_edge_management_client.models.ResourceTypeSku] + :ivar next_link: Links to the next set of results. + :vartype next_link: str + """ + + _validation = { + 'value': {'readonly': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[ResourceTypeSku]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(SkuInformationList, self).__init__(**kwargs) + self.value = None + self.next_link = None + + +class SkuLocationInfo(msrest.serialization.Model): + """The location info. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar location: The location. + :vartype location: str + :ivar zones: The zones. + :vartype zones: list[str] + :ivar sites: The sites. + :vartype sites: list[str] + """ + + _validation = { + 'location': {'readonly': True}, + 'zones': {'readonly': True}, + 'sites': {'readonly': True}, + } + + _attribute_map = { + 'location': {'key': 'location', 'type': 'str'}, + 'zones': {'key': 'zones', 'type': '[str]'}, + 'sites': {'key': 'sites', 'type': '[str]'}, + } + + def __init__( + self, + **kwargs + ): + super(SkuLocationInfo, self).__init__(**kwargs) + self.location = None + self.zones = None + self.sites = None + + +class StorageAccount(ArmBaseModel): + """Represents a Storage Account on the Data Box Edge/Gateway device. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: The path ID that uniquely identifies the object. + :vartype id: str + :ivar name: The object name. + :vartype name: str + :ivar type: The hierarchical type of the object. + :vartype type: str + :ivar system_data: StorageAccount object on ASE device. + :vartype system_data: ~data_box_edge_management_client.models.SystemData + :param description: Description for the storage Account. + :type description: str + :param storage_account_status: Current status of the storage account. Possible values include: + "OK", "Offline", "Unknown", "Updating", "NeedsAttention". + :type storage_account_status: str or + ~data_box_edge_management_client.models.StorageAccountStatus + :param data_policy: Required. Data policy of the storage Account. Possible values include: + "Cloud", "Local". + :type data_policy: str or ~data_box_edge_management_client.models.DataPolicy + :param storage_account_credential_id: Storage Account Credential Id. + :type storage_account_credential_id: str + :ivar blob_endpoint: BlobEndpoint of Storage Account. + :vartype blob_endpoint: str + :ivar container_count: The Container Count. Present only for Storage Accounts with DataPolicy + set to Cloud. + :vartype container_count: int + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'system_data': {'readonly': True}, + 'data_policy': {'required': True}, + 'blob_endpoint': {'readonly': True}, + 'container_count': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + 'storage_account_status': {'key': 'properties.storageAccountStatus', 'type': 'str'}, + 'data_policy': {'key': 'properties.dataPolicy', 'type': 'str'}, + 'storage_account_credential_id': {'key': 'properties.storageAccountCredentialId', 'type': 'str'}, + 'blob_endpoint': {'key': 'properties.blobEndpoint', 'type': 'str'}, + 'container_count': {'key': 'properties.containerCount', 'type': 'int'}, + } + + def __init__( + self, + *, + data_policy: Union[str, "DataPolicy"], + description: Optional[str] = None, + storage_account_status: Optional[Union[str, "StorageAccountStatus"]] = None, + storage_account_credential_id: Optional[str] = None, + **kwargs + ): + super(StorageAccount, self).__init__(**kwargs) + self.system_data = None + self.description = description + self.storage_account_status = storage_account_status + self.data_policy = data_policy + self.storage_account_credential_id = storage_account_credential_id + self.blob_endpoint = None + self.container_count = None + + +class StorageAccountCredential(ArmBaseModel): + """The storage account credential. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: The path ID that uniquely identifies the object. + :vartype id: str + :ivar name: The object name. + :vartype name: str + :ivar type: The hierarchical type of the object. + :vartype type: str + :ivar system_data: StorageAccountCredential object. + :vartype system_data: ~data_box_edge_management_client.models.SystemData + :param alias: Required. Alias for the storage account. + :type alias: str + :param user_name: Username for the storage account. + :type user_name: str + :param account_key: Encrypted storage key. + :type account_key: ~data_box_edge_management_client.models.AsymmetricEncryptedSecret + :param connection_string: Connection string for the storage account. Use this string if + username and account key are not specified. + :type connection_string: str + :param ssl_status: Required. Signifies whether SSL needs to be enabled or not. Possible values + include: "Enabled", "Disabled". + :type ssl_status: str or ~data_box_edge_management_client.models.SslStatus + :param blob_domain_name: Blob end point for private clouds. + :type blob_domain_name: str + :param account_type: Required. Type of storage accessed on the storage account. Possible values + include: "GeneralPurposeStorage", "BlobStorage". + :type account_type: str or ~data_box_edge_management_client.models.AccountType + :param storage_account_id: Id of the storage account. + :type storage_account_id: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'system_data': {'readonly': True}, + 'alias': {'required': True}, + 'ssl_status': {'required': True}, + 'account_type': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'alias': {'key': 'properties.alias', 'type': 'str'}, + 'user_name': {'key': 'properties.userName', 'type': 'str'}, + 'account_key': {'key': 'properties.accountKey', 'type': 'AsymmetricEncryptedSecret'}, + 'connection_string': {'key': 'properties.connectionString', 'type': 'str'}, + 'ssl_status': {'key': 'properties.sslStatus', 'type': 'str'}, + 'blob_domain_name': {'key': 'properties.blobDomainName', 'type': 'str'}, + 'account_type': {'key': 'properties.accountType', 'type': 'str'}, + 'storage_account_id': {'key': 'properties.storageAccountId', 'type': 'str'}, + } + + def __init__( + self, + *, + alias: str, + ssl_status: Union[str, "SslStatus"], + account_type: Union[str, "AccountType"], + user_name: Optional[str] = None, + account_key: Optional["AsymmetricEncryptedSecret"] = None, + connection_string: Optional[str] = None, + blob_domain_name: Optional[str] = None, + storage_account_id: Optional[str] = None, + **kwargs + ): + super(StorageAccountCredential, self).__init__(**kwargs) + self.system_data = None + self.alias = alias + self.user_name = user_name + self.account_key = account_key + self.connection_string = connection_string + self.ssl_status = ssl_status + self.blob_domain_name = blob_domain_name + self.account_type = account_type + self.storage_account_id = storage_account_id + + +class StorageAccountCredentialList(msrest.serialization.Model): + """The collection of storage account credentials. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar value: The value. + :vartype value: list[~data_box_edge_management_client.models.StorageAccountCredential] + :ivar next_link: Link to the next set of results. + :vartype next_link: str + """ + + _validation = { + 'value': {'readonly': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[StorageAccountCredential]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(StorageAccountCredentialList, self).__init__(**kwargs) + self.value = None + self.next_link = None + + +class StorageAccountList(msrest.serialization.Model): + """Collection of all the Storage Accounts on the Data Box Edge/Gateway device. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar value: The list of storageAccounts. + :vartype value: list[~data_box_edge_management_client.models.StorageAccount] + :ivar next_link: Link to the next set of results. + :vartype next_link: str + """ + + _validation = { + 'value': {'readonly': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[StorageAccount]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(StorageAccountList, self).__init__(**kwargs) + self.value = None + self.next_link = None + + +class SubscriptionRegisteredFeatures(msrest.serialization.Model): + """SubscriptionRegisteredFeatures. + + :param name: + :type name: str + :param state: + :type state: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'state': {'key': 'state', 'type': 'str'}, + } + + def __init__( + self, + *, + name: Optional[str] = None, + state: Optional[str] = None, + **kwargs + ): + super(SubscriptionRegisteredFeatures, self).__init__(**kwargs) + self.name = name + self.state = state + + +class SymmetricKey(msrest.serialization.Model): + """Symmetric key for authentication. + + :param connection_string: Connection string based on the symmetric key. + :type connection_string: ~data_box_edge_management_client.models.AsymmetricEncryptedSecret + """ + + _attribute_map = { + 'connection_string': {'key': 'connectionString', 'type': 'AsymmetricEncryptedSecret'}, + } + + def __init__( + self, + *, + connection_string: Optional["AsymmetricEncryptedSecret"] = None, + **kwargs + ): + super(SymmetricKey, self).__init__(**kwargs) + self.connection_string = connection_string + + +class SystemData(msrest.serialization.Model): + """Metadata pertaining to creation and last modification of the resource. + + :param created_by: The identity that created the resource. + :type created_by: str + :param created_by_type: The type of identity that created the resource. Possible values + include: "User", "Application", "ManagedIdentity", "Key". + :type created_by_type: str or ~data_box_edge_management_client.models.CreatedByType + :param created_at: The timestamp of resource creation (UTC). + :type created_at: ~datetime.datetime + :param last_modified_by: The identity that last modified the resource. + :type last_modified_by: str + :param last_modified_by_type: The type of identity that last modified the resource. Possible + values include: "User", "Application", "ManagedIdentity", "Key". + :type last_modified_by_type: str or ~data_box_edge_management_client.models.CreatedByType + :param last_modified_at: The type of identity that last modified the resource. + :type last_modified_at: ~datetime.datetime + """ + + _attribute_map = { + 'created_by': {'key': 'createdBy', 'type': 'str'}, + 'created_by_type': {'key': 'createdByType', 'type': 'str'}, + 'created_at': {'key': 'createdAt', 'type': 'iso-8601'}, + 'last_modified_by': {'key': 'lastModifiedBy', 'type': 'str'}, + 'last_modified_by_type': {'key': 'lastModifiedByType', 'type': 'str'}, + 'last_modified_at': {'key': 'lastModifiedAt', 'type': 'iso-8601'}, + } + + def __init__( + self, + *, + created_by: Optional[str] = None, + created_by_type: Optional[Union[str, "CreatedByType"]] = None, + created_at: Optional[datetime.datetime] = None, + last_modified_by: Optional[str] = None, + last_modified_by_type: Optional[Union[str, "CreatedByType"]] = None, + last_modified_at: Optional[datetime.datetime] = None, + **kwargs + ): + super(SystemData, self).__init__(**kwargs) + self.created_by = created_by + self.created_by_type = created_by_type + self.created_at = created_at + self.last_modified_by = last_modified_by + self.last_modified_by_type = last_modified_by_type + self.last_modified_at = last_modified_at + + +class TrackingInfo(msrest.serialization.Model): + """Tracking courier information. + + :param serial_number: Serial number of the device being tracked. + :type serial_number: str + :param carrier_name: Name of the carrier used in the delivery. + :type carrier_name: str + :param tracking_id: Tracking ID of the shipment. + :type tracking_id: str + :param tracking_url: Tracking URL of the shipment. + :type tracking_url: str + """ + + _attribute_map = { + 'serial_number': {'key': 'serialNumber', 'type': 'str'}, + 'carrier_name': {'key': 'carrierName', 'type': 'str'}, + 'tracking_id': {'key': 'trackingId', 'type': 'str'}, + 'tracking_url': {'key': 'trackingUrl', 'type': 'str'}, + } + + def __init__( + self, + *, + serial_number: Optional[str] = None, + carrier_name: Optional[str] = None, + tracking_id: Optional[str] = None, + tracking_url: Optional[str] = None, + **kwargs + ): + super(TrackingInfo, self).__init__(**kwargs) + self.serial_number = serial_number + self.carrier_name = carrier_name + self.tracking_id = tracking_id + self.tracking_url = tracking_url + + +class TriggerList(msrest.serialization.Model): + """Collection of all trigger on the data box edge device. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar value: The list of triggers. + :vartype value: list[~data_box_edge_management_client.models.Trigger] + :ivar next_link: Link to the next set of results. + :vartype next_link: str + """ + + _validation = { + 'value': {'readonly': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[Trigger]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(TriggerList, self).__init__(**kwargs) + self.value = None + self.next_link = None + + +class TriggerSupportPackageRequest(ArmBaseModel): + """The request object for trigger support package. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: The path ID that uniquely identifies the object. + :vartype id: str + :ivar name: The object name. + :vartype name: str + :ivar type: The hierarchical type of the object. + :vartype type: str + :param minimum_time_stamp: MinimumTimeStamp from where logs need to be collected. + :type minimum_time_stamp: ~datetime.datetime + :param maximum_time_stamp: MaximumTimeStamp until where logs need to be collected. + :type maximum_time_stamp: ~datetime.datetime + :param include: Type of files, which need to be included in the logs + This will contain the type of logs (Default/DefaultWithDumps/None/All/DefaultWithArchived) + or a comma separated list of log types that are required. + :type include: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'minimum_time_stamp': {'key': 'properties.minimumTimeStamp', 'type': 'iso-8601'}, + 'maximum_time_stamp': {'key': 'properties.maximumTimeStamp', 'type': 'iso-8601'}, + 'include': {'key': 'properties.include', 'type': 'str'}, + } + + def __init__( + self, + *, + minimum_time_stamp: Optional[datetime.datetime] = None, + maximum_time_stamp: Optional[datetime.datetime] = None, + include: Optional[str] = None, + **kwargs + ): + super(TriggerSupportPackageRequest, self).__init__(**kwargs) + self.minimum_time_stamp = minimum_time_stamp + self.maximum_time_stamp = maximum_time_stamp + self.include = include + + +class UpdateDetails(msrest.serialization.Model): + """Update Specific attributes. + + :param update_title: Title of the Update. + :type update_title: str + :param update_size: Size of the update(In Bytes). + :type update_size: float + :param update_type: Type of the Update. Possible values include: "Software", "Kubernetes", + "Firmware". + :type update_type: str or ~data_box_edge_management_client.models.UpdateType + :param target_version: Target Version number. + :type target_version: str + :param friendly_version_number: Friendly Version Number. + :type friendly_version_number: str + :param estimated_install_time_in_mins: Estimated Install Time for the update. + :type estimated_install_time_in_mins: int + :param reboot_behavior: Indicates if updates are available and at least one of the updates + needs a reboot. Possible values include: "NeverReboots", "RequiresReboot", "RequestReboot". + :type reboot_behavior: str or ~data_box_edge_management_client.models.InstallRebootBehavior + :param installation_impact: Impact of Installing an updateType. Possible values include: + "None", "DeviceRebooted", "KubernetesWorkloadsDown". + :type installation_impact: str or ~data_box_edge_management_client.models.InstallationImpact + :param status: Status of the update. Possible values include: "DownloadPending", + "DownloadStarted", "DownloadCompleted", "InstallStarted", "InstallCompleted". + :type status: str or ~data_box_edge_management_client.models.UpdateStatus + """ + + _attribute_map = { + 'update_title': {'key': 'updateTitle', 'type': 'str'}, + 'update_size': {'key': 'updateSize', 'type': 'float'}, + 'update_type': {'key': 'updateType', 'type': 'str'}, + 'target_version': {'key': 'targetVersion', 'type': 'str'}, + 'friendly_version_number': {'key': 'friendlyVersionNumber', 'type': 'str'}, + 'estimated_install_time_in_mins': {'key': 'estimatedInstallTimeInMins', 'type': 'int'}, + 'reboot_behavior': {'key': 'rebootBehavior', 'type': 'str'}, + 'installation_impact': {'key': 'installationImpact', 'type': 'str'}, + 'status': {'key': 'status', 'type': 'str'}, + } + + def __init__( + self, + *, + update_title: Optional[str] = None, + update_size: Optional[float] = None, + update_type: Optional[Union[str, "UpdateType"]] = None, + target_version: Optional[str] = None, + friendly_version_number: Optional[str] = None, + estimated_install_time_in_mins: Optional[int] = None, + reboot_behavior: Optional[Union[str, "InstallRebootBehavior"]] = None, + installation_impact: Optional[Union[str, "InstallationImpact"]] = None, + status: Optional[Union[str, "UpdateStatus"]] = None, + **kwargs + ): + super(UpdateDetails, self).__init__(**kwargs) + self.update_title = update_title + self.update_size = update_size + self.update_type = update_type + self.target_version = target_version + self.friendly_version_number = friendly_version_number + self.estimated_install_time_in_mins = estimated_install_time_in_mins + self.reboot_behavior = reboot_behavior + self.installation_impact = installation_impact + self.status = status + + +class UpdateDownloadProgress(msrest.serialization.Model): + """Details about the download progress of update. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar download_phase: The download phase. Possible values include: "Unknown", "Initializing", + "Downloading", "Verifying". + :vartype download_phase: str or ~data_box_edge_management_client.models.DownloadPhase + :ivar percent_complete: Percentage of completion. + :vartype percent_complete: int + :ivar total_bytes_to_download: Total bytes to download. + :vartype total_bytes_to_download: float + :ivar total_bytes_downloaded: Total bytes downloaded. + :vartype total_bytes_downloaded: float + :ivar number_of_updates_to_download: Number of updates to download. + :vartype number_of_updates_to_download: int + :ivar number_of_updates_downloaded: Number of updates downloaded. + :vartype number_of_updates_downloaded: int + """ + + _validation = { + 'download_phase': {'readonly': True}, + 'percent_complete': {'readonly': True}, + 'total_bytes_to_download': {'readonly': True}, + 'total_bytes_downloaded': {'readonly': True}, + 'number_of_updates_to_download': {'readonly': True}, + 'number_of_updates_downloaded': {'readonly': True}, + } + + _attribute_map = { + 'download_phase': {'key': 'downloadPhase', 'type': 'str'}, + 'percent_complete': {'key': 'percentComplete', 'type': 'int'}, + 'total_bytes_to_download': {'key': 'totalBytesToDownload', 'type': 'float'}, + 'total_bytes_downloaded': {'key': 'totalBytesDownloaded', 'type': 'float'}, + 'number_of_updates_to_download': {'key': 'numberOfUpdatesToDownload', 'type': 'int'}, + 'number_of_updates_downloaded': {'key': 'numberOfUpdatesDownloaded', 'type': 'int'}, + } + + def __init__( + self, + **kwargs + ): + super(UpdateDownloadProgress, self).__init__(**kwargs) + self.download_phase = None + self.percent_complete = None + self.total_bytes_to_download = None + self.total_bytes_downloaded = None + self.number_of_updates_to_download = None + self.number_of_updates_downloaded = None + + +class UpdateInstallProgress(msrest.serialization.Model): + """Progress details during installation of updates. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar percent_complete: Percentage completed. + :vartype percent_complete: int + :ivar number_of_updates_to_install: Number of updates to install. + :vartype number_of_updates_to_install: int + :ivar number_of_updates_installed: Number of updates installed. + :vartype number_of_updates_installed: int + """ + + _validation = { + 'percent_complete': {'readonly': True}, + 'number_of_updates_to_install': {'readonly': True}, + 'number_of_updates_installed': {'readonly': True}, + } + + _attribute_map = { + 'percent_complete': {'key': 'percentComplete', 'type': 'int'}, + 'number_of_updates_to_install': {'key': 'numberOfUpdatesToInstall', 'type': 'int'}, + 'number_of_updates_installed': {'key': 'numberOfUpdatesInstalled', 'type': 'int'}, + } + + def __init__( + self, + **kwargs + ): + super(UpdateInstallProgress, self).__init__(**kwargs) + self.percent_complete = None + self.number_of_updates_to_install = None + self.number_of_updates_installed = None + + +class UpdateSummary(ArmBaseModel): + """Details about ongoing updates and availability of updates on the device. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: The path ID that uniquely identifies the object. + :vartype id: str + :ivar name: The object name. + :vartype name: str + :ivar type: The hierarchical type of the object. + :vartype type: str + :ivar system_data: UpdateSummary Result. + :vartype system_data: ~data_box_edge_management_client.models.SystemData + :param device_version_number: The current version of the device in format: 1.2.17312.13.",. + :type device_version_number: str + :param friendly_device_version_name: The current version of the device in text format. + :type friendly_device_version_name: str + :param device_last_scanned_date_time: The last time when a scan was done on the device. + :type device_last_scanned_date_time: ~datetime.datetime + :param last_completed_scan_job_date_time: The time when the last scan job was completed + (success/cancelled/failed) on the appliance. + :type last_completed_scan_job_date_time: ~datetime.datetime + :param last_successful_scan_job_time: Time when the last scan job is successfully completed. + :type last_successful_scan_job_time: ~datetime.datetime + :ivar last_completed_download_job_date_time: The time when the last Download job was completed + (success/cancelled/failed) on the appliance. + :vartype last_completed_download_job_date_time: ~datetime.datetime + :ivar last_completed_download_job_id: JobId of the last ran download job.(Can be + success/cancelled/failed). + :vartype last_completed_download_job_id: str + :ivar last_download_job_status: JobStatus of the last ran download job. Possible values + include: "Invalid", "Running", "Succeeded", "Failed", "Canceled", "Paused", "Scheduled". + :vartype last_download_job_status: str or ~data_box_edge_management_client.models.JobStatus + :param last_successful_install_job_date_time: The time when the Last Install job was completed + successfully on the appliance. + :type last_successful_install_job_date_time: ~datetime.datetime + :ivar last_completed_install_job_date_time: The time when the last Install job was completed + (success/cancelled/failed) on the appliance. + :vartype last_completed_install_job_date_time: ~datetime.datetime + :ivar last_completed_install_job_id: JobId of the last ran install job.(Can be + success/cancelled/failed). + :vartype last_completed_install_job_id: str + :ivar last_install_job_status: JobStatus of the last ran install job. Possible values include: + "Invalid", "Running", "Succeeded", "Failed", "Canceled", "Paused", "Scheduled". + :vartype last_install_job_status: str or ~data_box_edge_management_client.models.JobStatus + :ivar total_number_of_updates_available: The number of updates available for the current device + version as per the last device scan. + :vartype total_number_of_updates_available: int + :ivar total_number_of_updates_pending_download: The total number of items pending download. + :vartype total_number_of_updates_pending_download: int + :ivar total_number_of_updates_pending_install: The total number of items pending install. + :vartype total_number_of_updates_pending_install: int + :ivar reboot_behavior: Indicates if updates are available and at least one of the updates needs + a reboot. Possible values include: "NeverReboots", "RequiresReboot", "RequestReboot". + :vartype reboot_behavior: str or ~data_box_edge_management_client.models.InstallRebootBehavior + :ivar ongoing_update_operation: The current update operation. Possible values include: "None", + "Scan", "Download", "Install". + :vartype ongoing_update_operation: str or + ~data_box_edge_management_client.models.UpdateOperation + :ivar in_progress_download_job_id: The job ID of the download job in progress. + :vartype in_progress_download_job_id: str + :ivar in_progress_install_job_id: The job ID of the install job in progress. + :vartype in_progress_install_job_id: str + :ivar in_progress_download_job_started_date_time: The time when the currently running download + (if any) started. + :vartype in_progress_download_job_started_date_time: ~datetime.datetime + :ivar in_progress_install_job_started_date_time: The time when the currently running install + (if any) started. + :vartype in_progress_install_job_started_date_time: ~datetime.datetime + :ivar update_titles: The list of updates available for install. + :vartype update_titles: list[str] + :ivar updates: The list of updates available for install. + :vartype updates: list[~data_box_edge_management_client.models.UpdateDetails] + :ivar total_update_size_in_bytes: The total size of updates available for download in bytes. + :vartype total_update_size_in_bytes: float + :ivar total_time_in_minutes: The total time in Minutes. + :vartype total_time_in_minutes: int + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'system_data': {'readonly': True}, + 'last_completed_download_job_date_time': {'readonly': True}, + 'last_completed_download_job_id': {'readonly': True}, + 'last_download_job_status': {'readonly': True}, + 'last_completed_install_job_date_time': {'readonly': True}, + 'last_completed_install_job_id': {'readonly': True}, + 'last_install_job_status': {'readonly': True}, + 'total_number_of_updates_available': {'readonly': True}, + 'total_number_of_updates_pending_download': {'readonly': True}, + 'total_number_of_updates_pending_install': {'readonly': True}, + 'reboot_behavior': {'readonly': True}, + 'ongoing_update_operation': {'readonly': True}, + 'in_progress_download_job_id': {'readonly': True}, + 'in_progress_install_job_id': {'readonly': True}, + 'in_progress_download_job_started_date_time': {'readonly': True}, + 'in_progress_install_job_started_date_time': {'readonly': True}, + 'update_titles': {'readonly': True}, + 'updates': {'readonly': True}, + 'total_update_size_in_bytes': {'readonly': True}, + 'total_time_in_minutes': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'device_version_number': {'key': 'properties.deviceVersionNumber', 'type': 'str'}, + 'friendly_device_version_name': {'key': 'properties.friendlyDeviceVersionName', 'type': 'str'}, + 'device_last_scanned_date_time': {'key': 'properties.deviceLastScannedDateTime', 'type': 'iso-8601'}, + 'last_completed_scan_job_date_time': {'key': 'properties.lastCompletedScanJobDateTime', 'type': 'iso-8601'}, + 'last_successful_scan_job_time': {'key': 'properties.lastSuccessfulScanJobTime', 'type': 'iso-8601'}, + 'last_completed_download_job_date_time': {'key': 'properties.lastCompletedDownloadJobDateTime', 'type': 'iso-8601'}, + 'last_completed_download_job_id': {'key': 'properties.lastCompletedDownloadJobId', 'type': 'str'}, + 'last_download_job_status': {'key': 'properties.lastDownloadJobStatus', 'type': 'str'}, + 'last_successful_install_job_date_time': {'key': 'properties.lastSuccessfulInstallJobDateTime', 'type': 'iso-8601'}, + 'last_completed_install_job_date_time': {'key': 'properties.lastCompletedInstallJobDateTime', 'type': 'iso-8601'}, + 'last_completed_install_job_id': {'key': 'properties.lastCompletedInstallJobId', 'type': 'str'}, + 'last_install_job_status': {'key': 'properties.lastInstallJobStatus', 'type': 'str'}, + 'total_number_of_updates_available': {'key': 'properties.totalNumberOfUpdatesAvailable', 'type': 'int'}, + 'total_number_of_updates_pending_download': {'key': 'properties.totalNumberOfUpdatesPendingDownload', 'type': 'int'}, + 'total_number_of_updates_pending_install': {'key': 'properties.totalNumberOfUpdatesPendingInstall', 'type': 'int'}, + 'reboot_behavior': {'key': 'properties.rebootBehavior', 'type': 'str'}, + 'ongoing_update_operation': {'key': 'properties.ongoingUpdateOperation', 'type': 'str'}, + 'in_progress_download_job_id': {'key': 'properties.inProgressDownloadJobId', 'type': 'str'}, + 'in_progress_install_job_id': {'key': 'properties.inProgressInstallJobId', 'type': 'str'}, + 'in_progress_download_job_started_date_time': {'key': 'properties.inProgressDownloadJobStartedDateTime', 'type': 'iso-8601'}, + 'in_progress_install_job_started_date_time': {'key': 'properties.inProgressInstallJobStartedDateTime', 'type': 'iso-8601'}, + 'update_titles': {'key': 'properties.updateTitles', 'type': '[str]'}, + 'updates': {'key': 'properties.updates', 'type': '[UpdateDetails]'}, + 'total_update_size_in_bytes': {'key': 'properties.totalUpdateSizeInBytes', 'type': 'float'}, + 'total_time_in_minutes': {'key': 'properties.totalTimeInMinutes', 'type': 'int'}, + } + + def __init__( + self, + *, + device_version_number: Optional[str] = None, + friendly_device_version_name: Optional[str] = None, + device_last_scanned_date_time: Optional[datetime.datetime] = None, + last_completed_scan_job_date_time: Optional[datetime.datetime] = None, + last_successful_scan_job_time: Optional[datetime.datetime] = None, + last_successful_install_job_date_time: Optional[datetime.datetime] = None, + **kwargs + ): + super(UpdateSummary, self).__init__(**kwargs) + self.system_data = None + self.device_version_number = device_version_number + self.friendly_device_version_name = friendly_device_version_name + self.device_last_scanned_date_time = device_last_scanned_date_time + self.last_completed_scan_job_date_time = last_completed_scan_job_date_time + self.last_successful_scan_job_time = last_successful_scan_job_time + self.last_completed_download_job_date_time = None + self.last_completed_download_job_id = None + self.last_download_job_status = None + self.last_successful_install_job_date_time = last_successful_install_job_date_time + self.last_completed_install_job_date_time = None + self.last_completed_install_job_id = None + self.last_install_job_status = None + self.total_number_of_updates_available = None + self.total_number_of_updates_pending_download = None + self.total_number_of_updates_pending_install = None + self.reboot_behavior = None + self.ongoing_update_operation = None + self.in_progress_download_job_id = None + self.in_progress_install_job_id = None + self.in_progress_download_job_started_date_time = None + self.in_progress_install_job_started_date_time = None + self.update_titles = None + self.updates = None + self.total_update_size_in_bytes = None + self.total_time_in_minutes = None + + +class UploadCertificateRequest(msrest.serialization.Model): + """The upload certificate request. + + All required parameters must be populated in order to send to Azure. + + :param authentication_type: The authentication type. Possible values include: "Invalid", + "AzureActiveDirectory". + :type authentication_type: str or ~data_box_edge_management_client.models.AuthenticationType + :param certificate: Required. The base64 encoded certificate raw data. + :type certificate: str + """ + + _validation = { + 'certificate': {'required': True}, + } + + _attribute_map = { + 'authentication_type': {'key': 'properties.authenticationType', 'type': 'str'}, + 'certificate': {'key': 'properties.certificate', 'type': 'str'}, + } + + def __init__( + self, + *, + certificate: str, + authentication_type: Optional[Union[str, "AuthenticationType"]] = None, + **kwargs + ): + super(UploadCertificateRequest, self).__init__(**kwargs) + self.authentication_type = authentication_type + self.certificate = certificate + + +class UploadCertificateResponse(msrest.serialization.Model): + """The upload registration certificate response. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param auth_type: Specifies authentication type. Possible values include: "Invalid", + "AzureActiveDirectory". + :type auth_type: str or ~data_box_edge_management_client.models.AuthenticationType + :ivar resource_id: The resource ID of the Data Box Edge/Gateway device. + :vartype resource_id: str + :ivar aad_authority: Azure Active Directory tenant authority. + :vartype aad_authority: str + :ivar aad_tenant_id: Azure Active Directory tenant ID. + :vartype aad_tenant_id: str + :ivar service_principal_client_id: Azure Active Directory service principal client ID. + :vartype service_principal_client_id: str + :ivar service_principal_object_id: Azure Active Directory service principal object ID. + :vartype service_principal_object_id: str + :ivar azure_management_endpoint_audience: The azure management endpoint audience. + :vartype azure_management_endpoint_audience: str + :ivar aad_audience: Identifier of the target resource that is the recipient of the requested + token. + :vartype aad_audience: str + """ + + _validation = { + 'resource_id': {'readonly': True}, + 'aad_authority': {'readonly': True}, + 'aad_tenant_id': {'readonly': True}, + 'service_principal_client_id': {'readonly': True}, + 'service_principal_object_id': {'readonly': True}, + 'azure_management_endpoint_audience': {'readonly': True}, + 'aad_audience': {'readonly': True}, + } + + _attribute_map = { + 'auth_type': {'key': 'authType', 'type': 'str'}, + 'resource_id': {'key': 'resourceId', 'type': 'str'}, + 'aad_authority': {'key': 'aadAuthority', 'type': 'str'}, + 'aad_tenant_id': {'key': 'aadTenantId', 'type': 'str'}, + 'service_principal_client_id': {'key': 'servicePrincipalClientId', 'type': 'str'}, + 'service_principal_object_id': {'key': 'servicePrincipalObjectId', 'type': 'str'}, + 'azure_management_endpoint_audience': {'key': 'azureManagementEndpointAudience', 'type': 'str'}, + 'aad_audience': {'key': 'aadAudience', 'type': 'str'}, + } + + def __init__( + self, + *, + auth_type: Optional[Union[str, "AuthenticationType"]] = None, + **kwargs + ): + super(UploadCertificateResponse, self).__init__(**kwargs) + self.auth_type = auth_type + self.resource_id = None + self.aad_authority = None + self.aad_tenant_id = None + self.service_principal_client_id = None + self.service_principal_object_id = None + self.azure_management_endpoint_audience = None + self.aad_audience = None + + +class User(ArmBaseModel): + """Represents a user who has access to one or more shares on the Data Box Edge/Gateway device. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: The path ID that uniquely identifies the object. + :vartype id: str + :ivar name: The object name. + :vartype name: str + :ivar type: The hierarchical type of the object. + :vartype type: str + :ivar system_data: User in DataBoxEdge Resource. + :vartype system_data: ~data_box_edge_management_client.models.SystemData + :param encrypted_password: The password details. + :type encrypted_password: ~data_box_edge_management_client.models.AsymmetricEncryptedSecret + :ivar share_access_rights: List of shares that the user has rights on. This field should not be + specified during user creation. + :vartype share_access_rights: list[~data_box_edge_management_client.models.ShareAccessRight] + :param user_type: Required. Type of the user. Possible values include: "Share", + "LocalManagement", "ARM". + :type user_type: str or ~data_box_edge_management_client.models.UserType + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'system_data': {'readonly': True}, + 'share_access_rights': {'readonly': True}, + 'user_type': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'encrypted_password': {'key': 'properties.encryptedPassword', 'type': 'AsymmetricEncryptedSecret'}, + 'share_access_rights': {'key': 'properties.shareAccessRights', 'type': '[ShareAccessRight]'}, + 'user_type': {'key': 'properties.userType', 'type': 'str'}, + } + + def __init__( + self, + *, + user_type: Union[str, "UserType"], + encrypted_password: Optional["AsymmetricEncryptedSecret"] = None, + **kwargs + ): + super(User, self).__init__(**kwargs) + self.system_data = None + self.encrypted_password = encrypted_password + self.share_access_rights = None + self.user_type = user_type + + +class UserAccessRight(msrest.serialization.Model): + """The mapping between a particular user and the access type on the SMB share. + + All required parameters must be populated in order to send to Azure. + + :param user_id: Required. User ID (already existing in the device). + :type user_id: str + :param access_type: Required. Type of access to be allowed for the user. Possible values + include: "Change", "Read", "Custom". + :type access_type: str or ~data_box_edge_management_client.models.ShareAccessType + """ + + _validation = { + 'user_id': {'required': True}, + 'access_type': {'required': True}, + } + + _attribute_map = { + 'user_id': {'key': 'userId', 'type': 'str'}, + 'access_type': {'key': 'accessType', 'type': 'str'}, + } + + def __init__( + self, + *, + user_id: str, + access_type: Union[str, "ShareAccessType"], + **kwargs + ): + super(UserAccessRight, self).__init__(**kwargs) + self.user_id = user_id + self.access_type = access_type + + +class UserList(msrest.serialization.Model): + """Collection of users. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar value: The list of users. + :vartype value: list[~data_box_edge_management_client.models.User] + :ivar next_link: Link to the next set of results. + :vartype next_link: str + """ + + _validation = { + 'value': {'readonly': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[User]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(UserList, self).__init__(**kwargs) + self.value = None + self.next_link = None diff --git a/src/databoxedge/azext_databoxedge/vendored_sdks/databoxedge/operations/__init__.py b/src/databoxedge/azext_databoxedge/vendored_sdks/databoxedge/operations/__init__.py new file mode 100644 index 00000000000..fc7347b19d1 --- /dev/null +++ b/src/databoxedge/azext_databoxedge/vendored_sdks/databoxedge/operations/__init__.py @@ -0,0 +1,51 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from ._operations import Operations +from ._available_skus_operations import AvailableSkusOperations +from ._devices_operations import DevicesOperations +from ._alerts_operations import AlertsOperations +from ._bandwidth_schedules_operations import BandwidthSchedulesOperations +from ._diagnostic_settings_operations import DiagnosticSettingsOperations +from ._jobs_operations import JobsOperations +from ._nodes_operations import NodesOperations +from ._operations_status_operations import OperationsStatusOperations +from ._orders_operations import OrdersOperations +from ._roles_operations import RolesOperations +from ._addons_operations import AddonsOperations +from ._monitoring_config_operations import MonitoringConfigOperations +from ._shares_operations import SharesOperations +from ._storage_account_credentials_operations import StorageAccountCredentialsOperations +from ._storage_accounts_operations import StorageAccountsOperations +from ._containers_operations import ContainersOperations +from ._triggers_operations import TriggersOperations +from ._support_packages_operations import SupportPackagesOperations +from ._users_operations import UsersOperations + +__all__ = [ + 'Operations', + 'AvailableSkusOperations', + 'DevicesOperations', + 'AlertsOperations', + 'BandwidthSchedulesOperations', + 'DiagnosticSettingsOperations', + 'JobsOperations', + 'NodesOperations', + 'OperationsStatusOperations', + 'OrdersOperations', + 'RolesOperations', + 'AddonsOperations', + 'MonitoringConfigOperations', + 'SharesOperations', + 'StorageAccountCredentialsOperations', + 'StorageAccountsOperations', + 'ContainersOperations', + 'TriggersOperations', + 'SupportPackagesOperations', + 'UsersOperations', +] diff --git a/src/databoxedge/azext_databoxedge/vendored_sdks/databoxedge/operations/_addons_operations.py b/src/databoxedge/azext_databoxedge/vendored_sdks/databoxedge/operations/_addons_operations.py new file mode 100644 index 00000000000..d4676194f1f --- /dev/null +++ b/src/databoxedge/azext_databoxedge/vendored_sdks/databoxedge/operations/_addons_operations.py @@ -0,0 +1,460 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.core.polling import LROPoller, NoPolling, PollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.arm_polling import ARMPolling + +from .. import models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class AddonsOperations(object): + """AddonsOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~data_box_edge_management_client.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list_by_role( + self, + device_name, # type: str + role_name, # type: str + resource_group_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["models.AddonList"] + """Lists all the addons configured in the role. + + :param device_name: The device name. + :type device_name: str + :param role_name: The role name. + :type role_name: str + :param resource_group_name: The resource group name. + :type resource_group_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either AddonList or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~data_box_edge_management_client.models.AddonList] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.AddonList"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_by_role.metadata['url'] # type: ignore + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'roleName': self._serialize.url("role_name", role_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('AddonList', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_by_role.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/roles/{roleName}/addons'} # type: ignore + + def get( + self, + device_name, # type: str + role_name, # type: str + addon_name, # type: str + resource_group_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "models.Addon" + """Gets a specific addon by name. + + :param device_name: The device name. + :type device_name: str + :param role_name: The role name. + :type role_name: str + :param addon_name: The addon name. + :type addon_name: str + :param resource_group_name: The resource group name. + :type resource_group_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: Addon, or the result of cls(response) + :rtype: ~data_box_edge_management_client.models.Addon + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.Addon"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'roleName': self._serialize.url("role_name", role_name, 'str'), + 'addonName': self._serialize.url("addon_name", addon_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('Addon', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/roles/{roleName}/addons/{addonName}'} # type: ignore + + def _create_or_update_initial( + self, + device_name, # type: str + role_name, # type: str + addon_name, # type: str + resource_group_name, # type: str + addon, # type: "models.Addon" + **kwargs # type: Any + ): + # type: (...) -> Optional["models.Addon"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.Addon"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._create_or_update_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'roleName': self._serialize.url("role_name", role_name, 'str'), + 'addonName': self._serialize.url("addon_name", addon_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(addon, 'Addon') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('Addon', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/roles/{roleName}/addons/{addonName}'} # type: ignore + + def begin_create_or_update( + self, + device_name, # type: str + role_name, # type: str + addon_name, # type: str + resource_group_name, # type: str + addon, # type: "models.Addon" + **kwargs # type: Any + ): + # type: (...) -> LROPoller["models.Addon"] + """Create or update a addon. + + :param device_name: The device name. + :type device_name: str + :param role_name: The role name. + :type role_name: str + :param addon_name: The addon name. + :type addon_name: str + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param addon: The addon properties. + :type addon: ~data_box_edge_management_client.models.Addon + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either Addon or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~data_box_edge_management_client.models.Addon] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["models.Addon"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._create_or_update_initial( + device_name=device_name, + role_name=role_name, + addon_name=addon_name, + resource_group_name=resource_group_name, + addon=addon, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('Addon', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'roleName': self._serialize.url("role_name", role_name, 'str'), + 'addonName': self._serialize.url("addon_name", addon_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/roles/{roleName}/addons/{addonName}'} # type: ignore + + def _delete_initial( + self, + device_name, # type: str + role_name, # type: str + addon_name, # type: str + resource_group_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self._delete_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'roleName': self._serialize.url("role_name", role_name, 'str'), + 'addonName': self._serialize.url("addon_name", addon_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/roles/{roleName}/addons/{addonName}'} # type: ignore + + def begin_delete( + self, + device_name, # type: str + role_name, # type: str + addon_name, # type: str + resource_group_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> LROPoller[None] + """Deletes the addon on the device. + + :param device_name: The device name. + :type device_name: str + :param role_name: The role name. + :type role_name: str + :param addon_name: The addon name. + :type addon_name: str + :param resource_group_name: The resource group name. + :type resource_group_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._delete_initial( + device_name=device_name, + role_name=role_name, + addon_name=addon_name, + resource_group_name=resource_group_name, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'roleName': self._serialize.url("role_name", role_name, 'str'), + 'addonName': self._serialize.url("addon_name", addon_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/roles/{roleName}/addons/{addonName}'} # type: ignore diff --git a/src/databoxedge/azext_databoxedge/vendored_sdks/databoxedge/operations/_alerts_operations.py b/src/databoxedge/azext_databoxedge/vendored_sdks/databoxedge/operations/_alerts_operations.py new file mode 100644 index 00000000000..8fa6f8efd5e --- /dev/null +++ b/src/databoxedge/azext_databoxedge/vendored_sdks/databoxedge/operations/_alerts_operations.py @@ -0,0 +1,186 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.mgmt.core.exceptions import ARMErrorFormat + +from .. import models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class AlertsOperations(object): + """AlertsOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~data_box_edge_management_client.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list_by_data_box_edge_device( + self, + device_name, # type: str + resource_group_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["models.AlertList"] + """Gets all the alerts for a Data Box Edge/Data Box Gateway device. + + :param device_name: The device name. + :type device_name: str + :param resource_group_name: The resource group name. + :type resource_group_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either AlertList or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~data_box_edge_management_client.models.AlertList] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.AlertList"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_by_data_box_edge_device.metadata['url'] # type: ignore + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('AlertList', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_by_data_box_edge_device.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/alerts'} # type: ignore + + def get( + self, + device_name, # type: str + name, # type: str + resource_group_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "models.Alert" + """Gets an alert by name. + + Gets an alert by name. + + :param device_name: The device name. + :type device_name: str + :param name: The alert name. + :type name: str + :param resource_group_name: The resource group name. + :type resource_group_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: Alert, or the result of cls(response) + :rtype: ~data_box_edge_management_client.models.Alert + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.Alert"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('Alert', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/alerts/{name}'} # type: ignore diff --git a/src/databoxedge/azext_databoxedge/vendored_sdks/databoxedge/operations/_available_skus_operations.py b/src/databoxedge/azext_databoxedge/vendored_sdks/databoxedge/operations/_available_skus_operations.py new file mode 100644 index 00000000000..60537eeab12 --- /dev/null +++ b/src/databoxedge/azext_databoxedge/vendored_sdks/databoxedge/operations/_available_skus_operations.py @@ -0,0 +1,115 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.mgmt.core.exceptions import ARMErrorFormat + +from .. import models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class AvailableSkusOperations(object): + """AvailableSkusOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~data_box_edge_management_client.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list( + self, + **kwargs # type: Any + ): + # type: (...) -> Iterable["models.DataBoxEdgeSkuList"] + """List all the available Skus and information related to them. + + List all the available Skus and information related to them. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either DataBoxEdgeSkuList or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~data_box_edge_management_client.models.DataBoxEdgeSkuList] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.DataBoxEdgeSkuList"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('DataBoxEdgeSkuList', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.DataBoxEdge/availableSkus'} # type: ignore diff --git a/src/databoxedge/azext_databoxedge/vendored_sdks/databoxedge/operations/_bandwidth_schedules_operations.py b/src/databoxedge/azext_databoxedge/vendored_sdks/databoxedge/operations/_bandwidth_schedules_operations.py new file mode 100644 index 00000000000..4c1dd3d0ea2 --- /dev/null +++ b/src/databoxedge/azext_databoxedge/vendored_sdks/databoxedge/operations/_bandwidth_schedules_operations.py @@ -0,0 +1,438 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.core.polling import LROPoller, NoPolling, PollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.arm_polling import ARMPolling + +from .. import models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class BandwidthSchedulesOperations(object): + """BandwidthSchedulesOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~data_box_edge_management_client.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list_by_data_box_edge_device( + self, + device_name, # type: str + resource_group_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["models.BandwidthSchedulesList"] + """Gets all the bandwidth schedules for a Data Box Edge/Data Box Gateway device. + + :param device_name: The device name. + :type device_name: str + :param resource_group_name: The resource group name. + :type resource_group_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either BandwidthSchedulesList or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~data_box_edge_management_client.models.BandwidthSchedulesList] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.BandwidthSchedulesList"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_by_data_box_edge_device.metadata['url'] # type: ignore + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('BandwidthSchedulesList', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_by_data_box_edge_device.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/bandwidthSchedules'} # type: ignore + + def get( + self, + device_name, # type: str + name, # type: str + resource_group_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "models.BandwidthSchedule" + """Gets the properties of the specified bandwidth schedule. + + :param device_name: The device name. + :type device_name: str + :param name: The bandwidth schedule name. + :type name: str + :param resource_group_name: The resource group name. + :type resource_group_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: BandwidthSchedule, or the result of cls(response) + :rtype: ~data_box_edge_management_client.models.BandwidthSchedule + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.BandwidthSchedule"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('BandwidthSchedule', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/bandwidthSchedules/{name}'} # type: ignore + + def _create_or_update_initial( + self, + device_name, # type: str + name, # type: str + resource_group_name, # type: str + parameters, # type: "models.BandwidthSchedule" + **kwargs # type: Any + ): + # type: (...) -> Optional["models.BandwidthSchedule"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.BandwidthSchedule"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._create_or_update_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, 'BandwidthSchedule') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('BandwidthSchedule', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/bandwidthSchedules/{name}'} # type: ignore + + def begin_create_or_update( + self, + device_name, # type: str + name, # type: str + resource_group_name, # type: str + parameters, # type: "models.BandwidthSchedule" + **kwargs # type: Any + ): + # type: (...) -> LROPoller["models.BandwidthSchedule"] + """Creates or updates a bandwidth schedule. + + :param device_name: The device name. + :type device_name: str + :param name: The bandwidth schedule name which needs to be added/updated. + :type name: str + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param parameters: The bandwidth schedule to be added or updated. + :type parameters: ~data_box_edge_management_client.models.BandwidthSchedule + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either BandwidthSchedule or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~data_box_edge_management_client.models.BandwidthSchedule] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["models.BandwidthSchedule"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._create_or_update_initial( + device_name=device_name, + name=name, + resource_group_name=resource_group_name, + parameters=parameters, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('BandwidthSchedule', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/bandwidthSchedules/{name}'} # type: ignore + + def _delete_initial( + self, + device_name, # type: str + name, # type: str + resource_group_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self._delete_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/bandwidthSchedules/{name}'} # type: ignore + + def begin_delete( + self, + device_name, # type: str + name, # type: str + resource_group_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> LROPoller[None] + """Deletes the specified bandwidth schedule. + + :param device_name: The device name. + :type device_name: str + :param name: The bandwidth schedule name. + :type name: str + :param resource_group_name: The resource group name. + :type resource_group_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._delete_initial( + device_name=device_name, + name=name, + resource_group_name=resource_group_name, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/bandwidthSchedules/{name}'} # type: ignore diff --git a/src/databoxedge/azext_databoxedge/vendored_sdks/databoxedge/operations/_containers_operations.py b/src/databoxedge/azext_databoxedge/vendored_sdks/databoxedge/operations/_containers_operations.py new file mode 100644 index 00000000000..b8215933cd7 --- /dev/null +++ b/src/databoxedge/azext_databoxedge/vendored_sdks/databoxedge/operations/_containers_operations.py @@ -0,0 +1,592 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.core.polling import LROPoller, NoPolling, PollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.arm_polling import ARMPolling + +from .. import models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class ContainersOperations(object): + """ContainersOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~data_box_edge_management_client.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list_by_storage_account( + self, + device_name, # type: str + storage_account_name, # type: str + resource_group_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["models.ContainerList"] + """Lists all the containers of a storage Account in a Data Box Edge/Data Box Gateway device. + + Lists all the containers of a storage Account in a Data Box Edge/Data Box Gateway device. + + :param device_name: The device name. + :type device_name: str + :param storage_account_name: The storage Account name. + :type storage_account_name: str + :param resource_group_name: The resource group name. + :type resource_group_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either ContainerList or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~data_box_edge_management_client.models.ContainerList] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.ContainerList"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_by_storage_account.metadata['url'] # type: ignore + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'storageAccountName': self._serialize.url("storage_account_name", storage_account_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('ContainerList', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_by_storage_account.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/storageAccounts/{storageAccountName}/containers'} # type: ignore + + def get( + self, + device_name, # type: str + storage_account_name, # type: str + container_name, # type: str + resource_group_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "models.Container" + """Gets a container by name. + + Gets a container by name. + + :param device_name: The device name. + :type device_name: str + :param storage_account_name: The Storage Account Name. + :type storage_account_name: str + :param container_name: The container Name. + :type container_name: str + :param resource_group_name: The resource group name. + :type resource_group_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: Container, or the result of cls(response) + :rtype: ~data_box_edge_management_client.models.Container + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.Container"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'storageAccountName': self._serialize.url("storage_account_name", storage_account_name, 'str'), + 'containerName': self._serialize.url("container_name", container_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('Container', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/storageAccounts/{storageAccountName}/containers/{containerName}'} # type: ignore + + def _create_or_update_initial( + self, + device_name, # type: str + storage_account_name, # type: str + container_name, # type: str + resource_group_name, # type: str + container, # type: "models.Container" + **kwargs # type: Any + ): + # type: (...) -> Optional["models.Container"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.Container"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._create_or_update_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'storageAccountName': self._serialize.url("storage_account_name", storage_account_name, 'str'), + 'containerName': self._serialize.url("container_name", container_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(container, 'Container') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('Container', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/storageAccounts/{storageAccountName}/containers/{containerName}'} # type: ignore + + def begin_create_or_update( + self, + device_name, # type: str + storage_account_name, # type: str + container_name, # type: str + resource_group_name, # type: str + container, # type: "models.Container" + **kwargs # type: Any + ): + # type: (...) -> LROPoller["models.Container"] + """Creates a new container or updates an existing container on the device. + + Creates a new container or updates an existing container on the device. + + :param device_name: The device name. + :type device_name: str + :param storage_account_name: The Storage Account Name. + :type storage_account_name: str + :param container_name: The container name. + :type container_name: str + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param container: The container properties. + :type container: ~data_box_edge_management_client.models.Container + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either Container or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~data_box_edge_management_client.models.Container] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["models.Container"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._create_or_update_initial( + device_name=device_name, + storage_account_name=storage_account_name, + container_name=container_name, + resource_group_name=resource_group_name, + container=container, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('Container', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'storageAccountName': self._serialize.url("storage_account_name", storage_account_name, 'str'), + 'containerName': self._serialize.url("container_name", container_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/storageAccounts/{storageAccountName}/containers/{containerName}'} # type: ignore + + def _delete_initial( + self, + device_name, # type: str + storage_account_name, # type: str + container_name, # type: str + resource_group_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self._delete_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'storageAccountName': self._serialize.url("storage_account_name", storage_account_name, 'str'), + 'containerName': self._serialize.url("container_name", container_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/storageAccounts/{storageAccountName}/containers/{containerName}'} # type: ignore + + def begin_delete( + self, + device_name, # type: str + storage_account_name, # type: str + container_name, # type: str + resource_group_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> LROPoller[None] + """Deletes the container on the Data Box Edge/Data Box Gateway device. + + :param device_name: The device name. + :type device_name: str + :param storage_account_name: The Storage Account Name. + :type storage_account_name: str + :param container_name: The container name. + :type container_name: str + :param resource_group_name: The resource group name. + :type resource_group_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._delete_initial( + device_name=device_name, + storage_account_name=storage_account_name, + container_name=container_name, + resource_group_name=resource_group_name, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'storageAccountName': self._serialize.url("storage_account_name", storage_account_name, 'str'), + 'containerName': self._serialize.url("container_name", container_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/storageAccounts/{storageAccountName}/containers/{containerName}'} # type: ignore + + def _refresh_initial( + self, + device_name, # type: str + storage_account_name, # type: str + container_name, # type: str + resource_group_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self._refresh_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'storageAccountName': self._serialize.url("storage_account_name", storage_account_name, 'str'), + 'containerName': self._serialize.url("container_name", container_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _refresh_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/storageAccounts/{storageAccountName}/containers/{containerName}/refresh'} # type: ignore + + def begin_refresh( + self, + device_name, # type: str + storage_account_name, # type: str + container_name, # type: str + resource_group_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> LROPoller[None] + """Refreshes the container metadata with the data from the cloud. + + Refreshes the container metadata with the data from the cloud. + + :param device_name: The device name. + :type device_name: str + :param storage_account_name: The Storage Account Name. + :type storage_account_name: str + :param container_name: The container name. + :type container_name: str + :param resource_group_name: The resource group name. + :type resource_group_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._refresh_initial( + device_name=device_name, + storage_account_name=storage_account_name, + container_name=container_name, + resource_group_name=resource_group_name, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'storageAccountName': self._serialize.url("storage_account_name", storage_account_name, 'str'), + 'containerName': self._serialize.url("container_name", container_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_refresh.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/storageAccounts/{storageAccountName}/containers/{containerName}/refresh'} # type: ignore diff --git a/src/databoxedge/azext_databoxedge/vendored_sdks/databoxedge/operations/_devices_operations.py b/src/databoxedge/azext_databoxedge/vendored_sdks/databoxedge/operations/_devices_operations.py new file mode 100644 index 00000000000..1dbc69d0a38 --- /dev/null +++ b/src/databoxedge/azext_databoxedge/vendored_sdks/databoxedge/operations/_devices_operations.py @@ -0,0 +1,1330 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.core.polling import LROPoller, NoPolling, PollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.arm_polling import ARMPolling + +from .. import models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class DevicesOperations(object): + """DevicesOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~data_box_edge_management_client.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list_by_subscription( + self, + expand=None, # type: Optional[str] + **kwargs # type: Any + ): + # type: (...) -> Iterable["models.DataBoxEdgeDeviceList"] + """Gets all the Data Box Edge/Data Box Gateway devices in a subscription. + + :param expand: Specify $expand=details to populate additional fields related to the resource or + Specify $skipToken=:code:`` to populate the next page in the list. + :type expand: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either DataBoxEdgeDeviceList or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~data_box_edge_management_client.models.DataBoxEdgeDeviceList] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.DataBoxEdgeDeviceList"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_by_subscription.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + if expand is not None: + query_parameters['$expand'] = self._serialize.query("expand", expand, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('DataBoxEdgeDeviceList', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_by_subscription.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices'} # type: ignore + + def list_by_resource_group( + self, + resource_group_name, # type: str + expand=None, # type: Optional[str] + **kwargs # type: Any + ): + # type: (...) -> Iterable["models.DataBoxEdgeDeviceList"] + """Gets all the Data Box Edge/Data Box Gateway devices in a resource group. + + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param expand: Specify $expand=details to populate additional fields related to the resource or + Specify $skipToken=:code:`` to populate the next page in the list. + :type expand: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either DataBoxEdgeDeviceList or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~data_box_edge_management_client.models.DataBoxEdgeDeviceList] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.DataBoxEdgeDeviceList"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_by_resource_group.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + if expand is not None: + query_parameters['$expand'] = self._serialize.query("expand", expand, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('DataBoxEdgeDeviceList', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices'} # type: ignore + + def get( + self, + device_name, # type: str + resource_group_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "models.DataBoxEdgeDevice" + """Gets the properties of the Data Box Edge/Data Box Gateway device. + + :param device_name: The device name. + :type device_name: str + :param resource_group_name: The resource group name. + :type resource_group_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: DataBoxEdgeDevice, or the result of cls(response) + :rtype: ~data_box_edge_management_client.models.DataBoxEdgeDevice + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.DataBoxEdgeDevice"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('DataBoxEdgeDevice', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}'} # type: ignore + + def create_or_update( + self, + device_name, # type: str + resource_group_name, # type: str + data_box_edge_device, # type: "models.DataBoxEdgeDevice" + **kwargs # type: Any + ): + # type: (...) -> "models.DataBoxEdgeDevice" + """Creates or updates a Data Box Edge/Data Box Gateway resource. + + :param device_name: The device name. + :type device_name: str + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param data_box_edge_device: The resource object. + :type data_box_edge_device: ~data_box_edge_management_client.models.DataBoxEdgeDevice + :keyword callable cls: A custom type or function that will be passed the direct response + :return: DataBoxEdgeDevice, or the result of cls(response) + :rtype: ~data_box_edge_management_client.models.DataBoxEdgeDevice + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.DataBoxEdgeDevice"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.create_or_update.metadata['url'] # type: ignore + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(data_box_edge_device, 'DataBoxEdgeDevice') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('DataBoxEdgeDevice', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}'} # type: ignore + + def _delete_initial( + self, + device_name, # type: str + resource_group_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self._delete_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}'} # type: ignore + + def begin_delete( + self, + device_name, # type: str + resource_group_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> LROPoller[None] + """Deletes the Data Box Edge/Data Box Gateway device. + + :param device_name: The device name. + :type device_name: str + :param resource_group_name: The resource group name. + :type resource_group_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._delete_initial( + device_name=device_name, + resource_group_name=resource_group_name, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}'} # type: ignore + + def update( + self, + device_name, # type: str + resource_group_name, # type: str + parameters, # type: "models.DataBoxEdgeDevicePatch" + **kwargs # type: Any + ): + # type: (...) -> "models.DataBoxEdgeDevice" + """Modifies a Data Box Edge/Data Box Gateway resource. + + :param device_name: The device name. + :type device_name: str + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param parameters: The resource parameters. + :type parameters: ~data_box_edge_management_client.models.DataBoxEdgeDevicePatch + :keyword callable cls: A custom type or function that will be passed the direct response + :return: DataBoxEdgeDevice, or the result of cls(response) + :rtype: ~data_box_edge_management_client.models.DataBoxEdgeDevice + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.DataBoxEdgeDevice"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update.metadata['url'] # type: ignore + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, 'DataBoxEdgeDevicePatch') + body_content_kwargs['content'] = body_content + request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('DataBoxEdgeDevice', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}'} # type: ignore + + def _download_updates_initial( + self, + device_name, # type: str + resource_group_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self._download_updates_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _download_updates_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/downloadUpdates'} # type: ignore + + def begin_download_updates( + self, + device_name, # type: str + resource_group_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> LROPoller[None] + """Downloads the updates on a Data Box Edge/Data Box Gateway device. + + Downloads the updates on a Data Box Edge/Data Box Gateway device. + + :param device_name: The device name. + :type device_name: str + :param resource_group_name: The resource group name. + :type resource_group_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._download_updates_initial( + device_name=device_name, + resource_group_name=resource_group_name, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_download_updates.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/downloadUpdates'} # type: ignore + + def generate_certificate( + self, + device_name, # type: str + resource_group_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "models.GenerateCertResponse" + """Generates certificate for activation key. + + :param device_name: The device name. + :type device_name: str + :param resource_group_name: The resource group name. + :type resource_group_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: GenerateCertResponse, or the result of cls(response) + :rtype: ~data_box_edge_management_client.models.GenerateCertResponse + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.GenerateCertResponse"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.generate_certificate.metadata['url'] # type: ignore + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('GenerateCertResponse', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + generate_certificate.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/generateCertificate'} # type: ignore + + def get_extended_information( + self, + device_name, # type: str + resource_group_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "models.DataBoxEdgeDeviceExtendedInfo" + """Gets additional information for the specified Azure Stack Edge/Data Box Gateway device. + + :param device_name: The device name. + :type device_name: str + :param resource_group_name: The resource group name. + :type resource_group_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: DataBoxEdgeDeviceExtendedInfo, or the result of cls(response) + :rtype: ~data_box_edge_management_client.models.DataBoxEdgeDeviceExtendedInfo + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.DataBoxEdgeDeviceExtendedInfo"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.get_extended_information.metadata['url'] # type: ignore + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('DataBoxEdgeDeviceExtendedInfo', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_extended_information.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/getExtendedInformation'} # type: ignore + + def _install_updates_initial( + self, + device_name, # type: str + resource_group_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self._install_updates_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _install_updates_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/installUpdates'} # type: ignore + + def begin_install_updates( + self, + device_name, # type: str + resource_group_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> LROPoller[None] + """Installs the updates on the Data Box Edge/Data Box Gateway device. + + Installs the updates on the Data Box Edge/Data Box Gateway device. + + :param device_name: The device name. + :type device_name: str + :param resource_group_name: The resource group name. + :type resource_group_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._install_updates_initial( + device_name=device_name, + resource_group_name=resource_group_name, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_install_updates.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/installUpdates'} # type: ignore + + def get_network_settings( + self, + device_name, # type: str + resource_group_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "models.NetworkSettings" + """Gets the network settings of the specified Data Box Edge/Data Box Gateway device. + + :param device_name: The device name. + :type device_name: str + :param resource_group_name: The resource group name. + :type resource_group_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: NetworkSettings, or the result of cls(response) + :rtype: ~data_box_edge_management_client.models.NetworkSettings + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkSettings"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.get_network_settings.metadata['url'] # type: ignore + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('NetworkSettings', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_network_settings.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/networkSettings/default'} # type: ignore + + def _scan_for_updates_initial( + self, + device_name, # type: str + resource_group_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self._scan_for_updates_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _scan_for_updates_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/scanForUpdates'} # type: ignore + + def begin_scan_for_updates( + self, + device_name, # type: str + resource_group_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> LROPoller[None] + """Scans for updates on a Data Box Edge/Data Box Gateway device. + + Scans for updates on a Data Box Edge/Data Box Gateway device. + + :param device_name: The device name. + :type device_name: str + :param resource_group_name: The resource group name. + :type resource_group_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._scan_for_updates_initial( + device_name=device_name, + resource_group_name=resource_group_name, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_scan_for_updates.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/scanForUpdates'} # type: ignore + + def _create_or_update_security_settings_initial( + self, + device_name, # type: str + resource_group_name, # type: str + security_settings, # type: "models.SecuritySettings" + **kwargs # type: Any + ): + # type: (...) -> None + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._create_or_update_security_settings_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(security_settings, 'SecuritySettings') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _create_or_update_security_settings_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/securitySettings/default/update'} # type: ignore + + def begin_create_or_update_security_settings( + self, + device_name, # type: str + resource_group_name, # type: str + security_settings, # type: "models.SecuritySettings" + **kwargs # type: Any + ): + # type: (...) -> LROPoller[None] + """Updates the security settings on a Data Box Edge/Data Box Gateway device. + + :param device_name: The device name. + :type device_name: str + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param security_settings: The security settings. + :type security_settings: ~data_box_edge_management_client.models.SecuritySettings + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._create_or_update_security_settings_initial( + device_name=device_name, + resource_group_name=resource_group_name, + security_settings=security_settings, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create_or_update_security_settings.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/securitySettings/default/update'} # type: ignore + + def update_extended_information( + self, + device_name, # type: str + resource_group_name, # type: str + parameters, # type: "models.DataBoxEdgeDeviceExtendedInfoPatch" + **kwargs # type: Any + ): + # type: (...) -> "models.DataBoxEdgeDeviceExtendedInfo" + """Gets additional information for the specified Data Box Edge/Data Box Gateway device. + + :param device_name: The device name. + :type device_name: str + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param parameters: The patch object. + :type parameters: ~data_box_edge_management_client.models.DataBoxEdgeDeviceExtendedInfoPatch + :keyword callable cls: A custom type or function that will be passed the direct response + :return: DataBoxEdgeDeviceExtendedInfo, or the result of cls(response) + :rtype: ~data_box_edge_management_client.models.DataBoxEdgeDeviceExtendedInfo + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.DataBoxEdgeDeviceExtendedInfo"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update_extended_information.metadata['url'] # type: ignore + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, 'DataBoxEdgeDeviceExtendedInfoPatch') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('DataBoxEdgeDeviceExtendedInfo', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update_extended_information.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/updateExtendedInformation'} # type: ignore + + def get_update_summary( + self, + device_name, # type: str + resource_group_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "models.UpdateSummary" + """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. + + 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. + + :param device_name: The device name. + :type device_name: str + :param resource_group_name: The resource group name. + :type resource_group_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: UpdateSummary, or the result of cls(response) + :rtype: ~data_box_edge_management_client.models.UpdateSummary + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.UpdateSummary"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.get_update_summary.metadata['url'] # type: ignore + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('UpdateSummary', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_update_summary.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/updateSummary/default'} # type: ignore + + def upload_certificate( + self, + device_name, # type: str + resource_group_name, # type: str + parameters, # type: "models.UploadCertificateRequest" + **kwargs # type: Any + ): + # type: (...) -> "models.UploadCertificateResponse" + """Uploads registration certificate for the device. + + :param device_name: The device name. + :type device_name: str + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param parameters: The upload certificate request. + :type parameters: ~data_box_edge_management_client.models.UploadCertificateRequest + :keyword callable cls: A custom type or function that will be passed the direct response + :return: UploadCertificateResponse, or the result of cls(response) + :rtype: ~data_box_edge_management_client.models.UploadCertificateResponse + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.UploadCertificateResponse"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.upload_certificate.metadata['url'] # type: ignore + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, 'UploadCertificateRequest') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('UploadCertificateResponse', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + upload_certificate.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/uploadCertificate'} # type: ignore diff --git a/src/databoxedge/azext_databoxedge/vendored_sdks/databoxedge/operations/_diagnostic_settings_operations.py b/src/databoxedge/azext_databoxedge/vendored_sdks/databoxedge/operations/_diagnostic_settings_operations.py new file mode 100644 index 00000000000..8a08e71ab3c --- /dev/null +++ b/src/databoxedge/azext_databoxedge/vendored_sdks/databoxedge/operations/_diagnostic_settings_operations.py @@ -0,0 +1,407 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.core.polling import LROPoller, NoPolling, PollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.arm_polling import ARMPolling + +from .. import models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Optional, TypeVar, Union + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class DiagnosticSettingsOperations(object): + """DiagnosticSettingsOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~data_box_edge_management_client.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def get_diagnostic_proactive_log_collection_settings( + self, + device_name, # type: str + resource_group_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "models.DiagnosticProactiveLogCollectionSettings" + """Gets the proactive log collection settings of the specified Data Box Edge/Data Box Gateway + device. + + :param device_name: The device name. + :type device_name: str + :param resource_group_name: The resource group name. + :type resource_group_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: DiagnosticProactiveLogCollectionSettings, or the result of cls(response) + :rtype: ~data_box_edge_management_client.models.DiagnosticProactiveLogCollectionSettings + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.DiagnosticProactiveLogCollectionSettings"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.get_diagnostic_proactive_log_collection_settings.metadata['url'] # type: ignore + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('DiagnosticProactiveLogCollectionSettings', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_diagnostic_proactive_log_collection_settings.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/diagnosticProactiveLogCollectionSettings/default'} # type: ignore + + def _update_diagnostic_proactive_log_collection_settings_initial( + self, + device_name, # type: str + resource_group_name, # type: str + proactive_log_collection_settings, # type: "models.DiagnosticProactiveLogCollectionSettings" + **kwargs # type: Any + ): + # type: (...) -> None + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._update_diagnostic_proactive_log_collection_settings_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(proactive_log_collection_settings, 'DiagnosticProactiveLogCollectionSettings') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _update_diagnostic_proactive_log_collection_settings_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/diagnosticProactiveLogCollectionSettings/default'} # type: ignore + + def begin_update_diagnostic_proactive_log_collection_settings( + self, + device_name, # type: str + resource_group_name, # type: str + proactive_log_collection_settings, # type: "models.DiagnosticProactiveLogCollectionSettings" + **kwargs # type: Any + ): + # type: (...) -> LROPoller[None] + """Updates the proactive log collection settings on a Data Box Edge/Data Box Gateway device. + + :param device_name: The device name. + :type device_name: str + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param proactive_log_collection_settings: The proactive log collection settings. + :type proactive_log_collection_settings: ~data_box_edge_management_client.models.DiagnosticProactiveLogCollectionSettings + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._update_diagnostic_proactive_log_collection_settings_initial( + device_name=device_name, + resource_group_name=resource_group_name, + proactive_log_collection_settings=proactive_log_collection_settings, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_update_diagnostic_proactive_log_collection_settings.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/diagnosticProactiveLogCollectionSettings/default'} # type: ignore + + def get_diagnostic_remote_support_settings( + self, + device_name, # type: str + resource_group_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "models.DiagnosticRemoteSupportSettings" + """Gets the diagnostic remote support settings of the specified Data Box Edge/Data Box Gateway + device. + + :param device_name: The device name. + :type device_name: str + :param resource_group_name: The resource group name. + :type resource_group_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: DiagnosticRemoteSupportSettings, or the result of cls(response) + :rtype: ~data_box_edge_management_client.models.DiagnosticRemoteSupportSettings + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.DiagnosticRemoteSupportSettings"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.get_diagnostic_remote_support_settings.metadata['url'] # type: ignore + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('DiagnosticRemoteSupportSettings', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_diagnostic_remote_support_settings.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/diagnosticRemoteSupportSettings/default'} # type: ignore + + def _update_diagnostic_remote_support_settings_initial( + self, + device_name, # type: str + resource_group_name, # type: str + diagnostic_remote_support_settings, # type: "models.DiagnosticRemoteSupportSettings" + **kwargs # type: Any + ): + # type: (...) -> None + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._update_diagnostic_remote_support_settings_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(diagnostic_remote_support_settings, 'DiagnosticRemoteSupportSettings') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _update_diagnostic_remote_support_settings_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/diagnosticRemoteSupportSettings/default'} # type: ignore + + def begin_update_diagnostic_remote_support_settings( + self, + device_name, # type: str + resource_group_name, # type: str + diagnostic_remote_support_settings, # type: "models.DiagnosticRemoteSupportSettings" + **kwargs # type: Any + ): + # type: (...) -> LROPoller[None] + """Updates the diagnostic remote support settings on a Data Box Edge/Data Box Gateway device. + + :param device_name: The device name. + :type device_name: str + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param diagnostic_remote_support_settings: The diagnostic remote support settings. + :type diagnostic_remote_support_settings: ~data_box_edge_management_client.models.DiagnosticRemoteSupportSettings + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._update_diagnostic_remote_support_settings_initial( + device_name=device_name, + resource_group_name=resource_group_name, + diagnostic_remote_support_settings=diagnostic_remote_support_settings, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_update_diagnostic_remote_support_settings.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/diagnosticRemoteSupportSettings/default'} # type: ignore diff --git a/src/databoxedge/azext_databoxedge/vendored_sdks/databoxedge/operations/_jobs_operations.py b/src/databoxedge/azext_databoxedge/vendored_sdks/databoxedge/operations/_jobs_operations.py new file mode 100644 index 00000000000..494d7ad96e5 --- /dev/null +++ b/src/databoxedge/azext_databoxedge/vendored_sdks/databoxedge/operations/_jobs_operations.py @@ -0,0 +1,110 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.mgmt.core.exceptions import ARMErrorFormat + +from .. import models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Optional, TypeVar + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class JobsOperations(object): + """JobsOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~data_box_edge_management_client.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def get( + self, + device_name, # type: str + name, # type: str + resource_group_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "models.Job" + """Gets the details of a specified job on a Data Box Edge/Data Box Gateway device. + + Gets the details of a specified job on a Data Box Edge/Data Box Gateway device. + + :param device_name: The device name. + :type device_name: str + :param name: The job name. + :type name: str + :param resource_group_name: The resource group name. + :type resource_group_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: Job, or the result of cls(response) + :rtype: ~data_box_edge_management_client.models.Job + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.Job"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('Job', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/jobs/{name}'} # type: ignore diff --git a/src/databoxedge/azext_databoxedge/vendored_sdks/databoxedge/operations/_monitoring_config_operations.py b/src/databoxedge/azext_databoxedge/vendored_sdks/databoxedge/operations/_monitoring_config_operations.py new file mode 100644 index 00000000000..fdcdfabda18 --- /dev/null +++ b/src/databoxedge/azext_databoxedge/vendored_sdks/databoxedge/operations/_monitoring_config_operations.py @@ -0,0 +1,450 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.core.polling import LROPoller, NoPolling, PollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.arm_polling import ARMPolling + +from .. import models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class MonitoringConfigOperations(object): + """MonitoringConfigOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~data_box_edge_management_client.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list( + self, + device_name, # type: str + role_name, # type: str + resource_group_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["models.MonitoringMetricConfigurationList"] + """Lists metric configurations in a role. + + Lists metric configurations in a role. + + :param device_name: The device name. + :type device_name: str + :param role_name: The role name. + :type role_name: str + :param resource_group_name: The resource group name. + :type resource_group_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either MonitoringMetricConfigurationList or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~data_box_edge_management_client.models.MonitoringMetricConfigurationList] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.MonitoringMetricConfigurationList"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list.metadata['url'] # type: ignore + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'roleName': self._serialize.url("role_name", role_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('MonitoringMetricConfigurationList', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/roles/{roleName}/monitoringConfig'} # type: ignore + + def get( + self, + device_name, # type: str + role_name, # type: str + resource_group_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "models.MonitoringMetricConfiguration" + """Gets a metric configuration of a role. + + Gets a metric configuration of a role. + + :param device_name: The device name. + :type device_name: str + :param role_name: The role name. + :type role_name: str + :param resource_group_name: The resource group name. + :type resource_group_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: MonitoringMetricConfiguration, or the result of cls(response) + :rtype: ~data_box_edge_management_client.models.MonitoringMetricConfiguration + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.MonitoringMetricConfiguration"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'roleName': self._serialize.url("role_name", role_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('MonitoringMetricConfiguration', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/roles/{roleName}/monitoringConfig/default'} # type: ignore + + def _create_or_update_initial( + self, + device_name, # type: str + role_name, # type: str + resource_group_name, # type: str + monitoring_metric_configuration, # type: "models.MonitoringMetricConfiguration" + **kwargs # type: Any + ): + # type: (...) -> Optional["models.MonitoringMetricConfiguration"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.MonitoringMetricConfiguration"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._create_or_update_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'roleName': self._serialize.url("role_name", role_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(monitoring_metric_configuration, 'MonitoringMetricConfiguration') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('MonitoringMetricConfiguration', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/roles/{roleName}/monitoringConfig/default'} # type: ignore + + def begin_create_or_update( + self, + device_name, # type: str + role_name, # type: str + resource_group_name, # type: str + monitoring_metric_configuration, # type: "models.MonitoringMetricConfiguration" + **kwargs # type: Any + ): + # type: (...) -> LROPoller["models.MonitoringMetricConfiguration"] + """Creates a new metric configuration or updates an existing one for a role. + + Creates a new metric configuration or updates an existing one for a role. + + :param device_name: The device name. + :type device_name: str + :param role_name: The role name. + :type role_name: str + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param monitoring_metric_configuration: The metric configuration. + :type monitoring_metric_configuration: ~data_box_edge_management_client.models.MonitoringMetricConfiguration + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either MonitoringMetricConfiguration or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~data_box_edge_management_client.models.MonitoringMetricConfiguration] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["models.MonitoringMetricConfiguration"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._create_or_update_initial( + device_name=device_name, + role_name=role_name, + resource_group_name=resource_group_name, + monitoring_metric_configuration=monitoring_metric_configuration, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('MonitoringMetricConfiguration', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'roleName': self._serialize.url("role_name", role_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/roles/{roleName}/monitoringConfig/default'} # type: ignore + + def _delete_initial( + self, + device_name, # type: str + role_name, # type: str + resource_group_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self._delete_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'roleName': self._serialize.url("role_name", role_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/roles/{roleName}/monitoringConfig/default'} # type: ignore + + def begin_delete( + self, + device_name, # type: str + role_name, # type: str + resource_group_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> LROPoller[None] + """deletes a new metric configuration for a role. + + deletes a new metric configuration for a role. + + :param device_name: The device name. + :type device_name: str + :param role_name: The role name. + :type role_name: str + :param resource_group_name: The resource group name. + :type resource_group_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._delete_initial( + device_name=device_name, + role_name=role_name, + resource_group_name=resource_group_name, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'roleName': self._serialize.url("role_name", role_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/roles/{roleName}/monitoringConfig/default'} # type: ignore diff --git a/src/databoxedge/azext_databoxedge/vendored_sdks/databoxedge/operations/_nodes_operations.py b/src/databoxedge/azext_databoxedge/vendored_sdks/databoxedge/operations/_nodes_operations.py new file mode 100644 index 00000000000..f2b42ee3a81 --- /dev/null +++ b/src/databoxedge/azext_databoxedge/vendored_sdks/databoxedge/operations/_nodes_operations.py @@ -0,0 +1,121 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.mgmt.core.exceptions import ARMErrorFormat + +from .. import models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class NodesOperations(object): + """NodesOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~data_box_edge_management_client.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list_by_data_box_edge_device( + self, + device_name, # type: str + resource_group_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["models.NodeList"] + """Gets all the nodes currently configured under this Data Box Edge device. + + :param device_name: The device name. + :type device_name: str + :param resource_group_name: The resource group name. + :type resource_group_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either NodeList or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~data_box_edge_management_client.models.NodeList] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.NodeList"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_by_data_box_edge_device.metadata['url'] # type: ignore + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('NodeList', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_by_data_box_edge_device.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/nodes'} # type: ignore diff --git a/src/databoxedge/azext_databoxedge/vendored_sdks/databoxedge/operations/_operations.py b/src/databoxedge/azext_databoxedge/vendored_sdks/databoxedge/operations/_operations.py new file mode 100644 index 00000000000..3a96a365e9d --- /dev/null +++ b/src/databoxedge/azext_databoxedge/vendored_sdks/databoxedge/operations/_operations.py @@ -0,0 +1,111 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.mgmt.core.exceptions import ARMErrorFormat + +from .. import models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class Operations(object): + """Operations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~data_box_edge_management_client.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list( + self, + **kwargs # type: Any + ): + # type: (...) -> Iterable["models.OperationsList"] + """List all the supported operations. + + List all the supported operations. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either OperationsList or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~data_box_edge_management_client.models.OperationsList] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.OperationsList"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list.metadata['url'] # type: ignore + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('OperationsList', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/providers/Microsoft.DataBoxEdge/operations'} # type: ignore diff --git a/src/databoxedge/azext_databoxedge/vendored_sdks/databoxedge/operations/_operations_status_operations.py b/src/databoxedge/azext_databoxedge/vendored_sdks/databoxedge/operations/_operations_status_operations.py new file mode 100644 index 00000000000..42bff4ff1fe --- /dev/null +++ b/src/databoxedge/azext_databoxedge/vendored_sdks/databoxedge/operations/_operations_status_operations.py @@ -0,0 +1,110 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.mgmt.core.exceptions import ARMErrorFormat + +from .. import models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Optional, TypeVar + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class OperationsStatusOperations(object): + """OperationsStatusOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~data_box_edge_management_client.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def get( + self, + device_name, # type: str + name, # type: str + resource_group_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "models.Job" + """Gets the details of a specified job on a Data Box Edge/Data Box Gateway device. + + Gets the details of a specified job on a Data Box Edge/Data Box Gateway device. + + :param device_name: The device name. + :type device_name: str + :param name: The job name. + :type name: str + :param resource_group_name: The resource group name. + :type resource_group_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: Job, or the result of cls(response) + :rtype: ~data_box_edge_management_client.models.Job + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.Job"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('Job', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/operationsStatus/{name}'} # type: ignore diff --git a/src/databoxedge/azext_databoxedge/vendored_sdks/databoxedge/operations/_orders_operations.py b/src/databoxedge/azext_databoxedge/vendored_sdks/databoxedge/operations/_orders_operations.py new file mode 100644 index 00000000000..b14a023340c --- /dev/null +++ b/src/databoxedge/azext_databoxedge/vendored_sdks/databoxedge/operations/_orders_operations.py @@ -0,0 +1,489 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.core.polling import LROPoller, NoPolling, PollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.arm_polling import ARMPolling + +from .. import models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class OrdersOperations(object): + """OrdersOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~data_box_edge_management_client.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list_by_data_box_edge_device( + self, + device_name, # type: str + resource_group_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["models.OrderList"] + """Lists all the orders related to a Data Box Edge/Data Box Gateway device. + + Lists all the orders related to a Data Box Edge/Data Box Gateway device. + + :param device_name: The device name. + :type device_name: str + :param resource_group_name: The resource group name. + :type resource_group_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either OrderList or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~data_box_edge_management_client.models.OrderList] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.OrderList"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_by_data_box_edge_device.metadata['url'] # type: ignore + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('OrderList', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_by_data_box_edge_device.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/orders'} # type: ignore + + def get( + self, + device_name, # type: str + resource_group_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "models.Order" + """Gets a specific order by name. + + Gets a specific order by name. + + :param device_name: The device name. + :type device_name: str + :param resource_group_name: The resource group name. + :type resource_group_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: Order, or the result of cls(response) + :rtype: ~data_box_edge_management_client.models.Order + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.Order"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('Order', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/orders/default'} # type: ignore + + def _create_or_update_initial( + self, + device_name, # type: str + resource_group_name, # type: str + order, # type: "models.Order" + **kwargs # type: Any + ): + # type: (...) -> Optional["models.Order"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.Order"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._create_or_update_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(order, 'Order') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('Order', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/orders/default'} # type: ignore + + def begin_create_or_update( + self, + device_name, # type: str + resource_group_name, # type: str + order, # type: "models.Order" + **kwargs # type: Any + ): + # type: (...) -> LROPoller["models.Order"] + """Creates or updates an order. + + Creates or updates an order. + + :param device_name: The order details of a device. + :type device_name: str + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param order: The order to be created or updated. + :type order: ~data_box_edge_management_client.models.Order + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either Order or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~data_box_edge_management_client.models.Order] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["models.Order"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._create_or_update_initial( + device_name=device_name, + resource_group_name=resource_group_name, + order=order, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('Order', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/orders/default'} # type: ignore + + def _delete_initial( + self, + device_name, # type: str + resource_group_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self._delete_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/orders/default'} # type: ignore + + def begin_delete( + self, + device_name, # type: str + resource_group_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> LROPoller[None] + """Deletes the order related to the device. + + Deletes the order related to the device. + + :param device_name: The device name. + :type device_name: str + :param resource_group_name: The resource group name. + :type resource_group_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._delete_initial( + device_name=device_name, + resource_group_name=resource_group_name, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/orders/default'} # type: ignore + + def list_dc_access_code( + self, + device_name, # type: str + resource_group_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "models.DcAccessCode" + """Gets the DCAccess Code. + + Gets the DCAccess Code. + + :param device_name: The device name. + :type device_name: str + :param resource_group_name: The resource group name. + :type resource_group_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: DcAccessCode, or the result of cls(response) + :rtype: ~data_box_edge_management_client.models.DcAccessCode + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.DcAccessCode"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.list_dc_access_code.metadata['url'] # type: ignore + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('DcAccessCode', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + list_dc_access_code.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/orders/default/listDCAccessCode'} # type: ignore diff --git a/src/databoxedge/azext_databoxedge/vendored_sdks/databoxedge/operations/_roles_operations.py b/src/databoxedge/azext_databoxedge/vendored_sdks/databoxedge/operations/_roles_operations.py new file mode 100644 index 00000000000..9e9ab130797 --- /dev/null +++ b/src/databoxedge/azext_databoxedge/vendored_sdks/databoxedge/operations/_roles_operations.py @@ -0,0 +1,438 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.core.polling import LROPoller, NoPolling, PollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.arm_polling import ARMPolling + +from .. import models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class RolesOperations(object): + """RolesOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~data_box_edge_management_client.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list_by_data_box_edge_device( + self, + device_name, # type: str + resource_group_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["models.RoleList"] + """Lists all the roles configured in a Data Box Edge/Data Box Gateway device. + + :param device_name: The device name. + :type device_name: str + :param resource_group_name: The resource group name. + :type resource_group_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either RoleList or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~data_box_edge_management_client.models.RoleList] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.RoleList"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_by_data_box_edge_device.metadata['url'] # type: ignore + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('RoleList', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_by_data_box_edge_device.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/roles'} # type: ignore + + def get( + self, + device_name, # type: str + name, # type: str + resource_group_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "models.Role" + """Gets a specific role by name. + + :param device_name: The device name. + :type device_name: str + :param name: The role name. + :type name: str + :param resource_group_name: The resource group name. + :type resource_group_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: Role, or the result of cls(response) + :rtype: ~data_box_edge_management_client.models.Role + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.Role"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('Role', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/roles/{name}'} # type: ignore + + def _create_or_update_initial( + self, + device_name, # type: str + name, # type: str + resource_group_name, # type: str + role, # type: "models.Role" + **kwargs # type: Any + ): + # type: (...) -> Optional["models.Role"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.Role"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._create_or_update_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(role, 'Role') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('Role', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/roles/{name}'} # type: ignore + + def begin_create_or_update( + self, + device_name, # type: str + name, # type: str + resource_group_name, # type: str + role, # type: "models.Role" + **kwargs # type: Any + ): + # type: (...) -> LROPoller["models.Role"] + """Create or update a role. + + :param device_name: The device name. + :type device_name: str + :param name: The role name. + :type name: str + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param role: The role properties. + :type role: ~data_box_edge_management_client.models.Role + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either Role or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~data_box_edge_management_client.models.Role] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["models.Role"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._create_or_update_initial( + device_name=device_name, + name=name, + resource_group_name=resource_group_name, + role=role, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('Role', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/roles/{name}'} # type: ignore + + def _delete_initial( + self, + device_name, # type: str + name, # type: str + resource_group_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self._delete_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/roles/{name}'} # type: ignore + + def begin_delete( + self, + device_name, # type: str + name, # type: str + resource_group_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> LROPoller[None] + """Deletes the role on the device. + + :param device_name: The device name. + :type device_name: str + :param name: The role name. + :type name: str + :param resource_group_name: The resource group name. + :type resource_group_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._delete_initial( + device_name=device_name, + name=name, + resource_group_name=resource_group_name, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/roles/{name}'} # type: ignore diff --git a/src/databoxedge/azext_databoxedge/vendored_sdks/databoxedge/operations/_shares_operations.py b/src/databoxedge/azext_databoxedge/vendored_sdks/databoxedge/operations/_shares_operations.py new file mode 100644 index 00000000000..42adb07f01d --- /dev/null +++ b/src/databoxedge/azext_databoxedge/vendored_sdks/databoxedge/operations/_shares_operations.py @@ -0,0 +1,563 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.core.polling import LROPoller, NoPolling, PollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.arm_polling import ARMPolling + +from .. import models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class SharesOperations(object): + """SharesOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~data_box_edge_management_client.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list_by_data_box_edge_device( + self, + device_name, # type: str + resource_group_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["models.ShareList"] + """Lists all the shares in a Data Box Edge/Data Box Gateway device. + + Lists all the shares in a Data Box Edge/Data Box Gateway device. + + :param device_name: The device name. + :type device_name: str + :param resource_group_name: The resource group name. + :type resource_group_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either ShareList or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~data_box_edge_management_client.models.ShareList] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.ShareList"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_by_data_box_edge_device.metadata['url'] # type: ignore + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('ShareList', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_by_data_box_edge_device.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/shares'} # type: ignore + + def get( + self, + device_name, # type: str + name, # type: str + resource_group_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "models.Share" + """Gets a share by name. + + Gets a share by name. + + :param device_name: The device name. + :type device_name: str + :param name: The share name. + :type name: str + :param resource_group_name: The resource group name. + :type resource_group_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: Share, or the result of cls(response) + :rtype: ~data_box_edge_management_client.models.Share + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.Share"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('Share', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/shares/{name}'} # type: ignore + + def _create_or_update_initial( + self, + device_name, # type: str + name, # type: str + resource_group_name, # type: str + share, # type: "models.Share" + **kwargs # type: Any + ): + # type: (...) -> Optional["models.Share"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.Share"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._create_or_update_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(share, 'Share') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('Share', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/shares/{name}'} # type: ignore + + def begin_create_or_update( + self, + device_name, # type: str + name, # type: str + resource_group_name, # type: str + share, # type: "models.Share" + **kwargs # type: Any + ): + # type: (...) -> LROPoller["models.Share"] + """Creates a new share or updates an existing share on the device. + + Creates a new share or updates an existing share on the device. + + :param device_name: The device name. + :type device_name: str + :param name: The share name. + :type name: str + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param share: The share properties. + :type share: ~data_box_edge_management_client.models.Share + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either Share or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~data_box_edge_management_client.models.Share] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["models.Share"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._create_or_update_initial( + device_name=device_name, + name=name, + resource_group_name=resource_group_name, + share=share, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('Share', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/shares/{name}'} # type: ignore + + def _delete_initial( + self, + device_name, # type: str + name, # type: str + resource_group_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self._delete_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/shares/{name}'} # type: ignore + + def begin_delete( + self, + device_name, # type: str + name, # type: str + resource_group_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> LROPoller[None] + """Deletes the share on the Data Box Edge/Data Box Gateway device. + + :param device_name: The device name. + :type device_name: str + :param name: The share name. + :type name: str + :param resource_group_name: The resource group name. + :type resource_group_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._delete_initial( + device_name=device_name, + name=name, + resource_group_name=resource_group_name, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/shares/{name}'} # type: ignore + + def _refresh_initial( + self, + device_name, # type: str + name, # type: str + resource_group_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self._refresh_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _refresh_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/shares/{name}/refresh'} # type: ignore + + def begin_refresh( + self, + device_name, # type: str + name, # type: str + resource_group_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> LROPoller[None] + """Refreshes the share metadata with the data from the cloud. + + Refreshes the share metadata with the data from the cloud. + + :param device_name: The device name. + :type device_name: str + :param name: The share name. + :type name: str + :param resource_group_name: The resource group name. + :type resource_group_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._refresh_initial( + device_name=device_name, + name=name, + resource_group_name=resource_group_name, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_refresh.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/shares/{name}/refresh'} # type: ignore diff --git a/src/databoxedge/azext_databoxedge/vendored_sdks/databoxedge/operations/_storage_account_credentials_operations.py b/src/databoxedge/azext_databoxedge/vendored_sdks/databoxedge/operations/_storage_account_credentials_operations.py new file mode 100644 index 00000000000..cb8c310ec57 --- /dev/null +++ b/src/databoxedge/azext_databoxedge/vendored_sdks/databoxedge/operations/_storage_account_credentials_operations.py @@ -0,0 +1,440 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.core.polling import LROPoller, NoPolling, PollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.arm_polling import ARMPolling + +from .. import models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class StorageAccountCredentialsOperations(object): + """StorageAccountCredentialsOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~data_box_edge_management_client.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list_by_data_box_edge_device( + self, + device_name, # type: str + resource_group_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["models.StorageAccountCredentialList"] + """Gets all the storage account credentials in a Data Box Edge/Data Box Gateway device. + + Gets all the storage account credentials in a Data Box Edge/Data Box Gateway device. + + :param device_name: The device name. + :type device_name: str + :param resource_group_name: The resource group name. + :type resource_group_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either StorageAccountCredentialList or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~data_box_edge_management_client.models.StorageAccountCredentialList] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.StorageAccountCredentialList"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_by_data_box_edge_device.metadata['url'] # type: ignore + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('StorageAccountCredentialList', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_by_data_box_edge_device.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/storageAccountCredentials'} # type: ignore + + def get( + self, + device_name, # type: str + name, # type: str + resource_group_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "models.StorageAccountCredential" + """Gets the properties of the specified storage account credential. + + :param device_name: The device name. + :type device_name: str + :param name: The storage account credential name. + :type name: str + :param resource_group_name: The resource group name. + :type resource_group_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: StorageAccountCredential, or the result of cls(response) + :rtype: ~data_box_edge_management_client.models.StorageAccountCredential + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.StorageAccountCredential"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('StorageAccountCredential', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/storageAccountCredentials/{name}'} # type: ignore + + def _create_or_update_initial( + self, + device_name, # type: str + name, # type: str + resource_group_name, # type: str + storage_account_credential, # type: "models.StorageAccountCredential" + **kwargs # type: Any + ): + # type: (...) -> Optional["models.StorageAccountCredential"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.StorageAccountCredential"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._create_or_update_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(storage_account_credential, 'StorageAccountCredential') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('StorageAccountCredential', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/storageAccountCredentials/{name}'} # type: ignore + + def begin_create_or_update( + self, + device_name, # type: str + name, # type: str + resource_group_name, # type: str + storage_account_credential, # type: "models.StorageAccountCredential" + **kwargs # type: Any + ): + # type: (...) -> LROPoller["models.StorageAccountCredential"] + """Creates or updates the storage account credential. + + :param device_name: The device name. + :type device_name: str + :param name: The storage account credential name. + :type name: str + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param storage_account_credential: The storage account credential. + :type storage_account_credential: ~data_box_edge_management_client.models.StorageAccountCredential + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either StorageAccountCredential or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~data_box_edge_management_client.models.StorageAccountCredential] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["models.StorageAccountCredential"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._create_or_update_initial( + device_name=device_name, + name=name, + resource_group_name=resource_group_name, + storage_account_credential=storage_account_credential, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('StorageAccountCredential', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/storageAccountCredentials/{name}'} # type: ignore + + def _delete_initial( + self, + device_name, # type: str + name, # type: str + resource_group_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self._delete_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/storageAccountCredentials/{name}'} # type: ignore + + def begin_delete( + self, + device_name, # type: str + name, # type: str + resource_group_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> LROPoller[None] + """Deletes the storage account credential. + + :param device_name: The device name. + :type device_name: str + :param name: The storage account credential name. + :type name: str + :param resource_group_name: The resource group name. + :type resource_group_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._delete_initial( + device_name=device_name, + name=name, + resource_group_name=resource_group_name, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/storageAccountCredentials/{name}'} # type: ignore diff --git a/src/databoxedge/azext_databoxedge/vendored_sdks/databoxedge/operations/_storage_accounts_operations.py b/src/databoxedge/azext_databoxedge/vendored_sdks/databoxedge/operations/_storage_accounts_operations.py new file mode 100644 index 00000000000..6d824cf5c53 --- /dev/null +++ b/src/databoxedge/azext_databoxedge/vendored_sdks/databoxedge/operations/_storage_accounts_operations.py @@ -0,0 +1,444 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.core.polling import LROPoller, NoPolling, PollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.arm_polling import ARMPolling + +from .. import models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class StorageAccountsOperations(object): + """StorageAccountsOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~data_box_edge_management_client.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list_by_data_box_edge_device( + self, + device_name, # type: str + resource_group_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["models.StorageAccountList"] + """Lists all the StorageAccounts in a Data Box Edge/Data Box Gateway device. + + Lists all the StorageAccounts in a Data Box Edge/Data Box Gateway device. + + :param device_name: The device name. + :type device_name: str + :param resource_group_name: The resource group name. + :type resource_group_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either StorageAccountList or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~data_box_edge_management_client.models.StorageAccountList] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.StorageAccountList"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_by_data_box_edge_device.metadata['url'] # type: ignore + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('StorageAccountList', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_by_data_box_edge_device.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/storageAccounts'} # type: ignore + + def get( + self, + device_name, # type: str + storage_account_name, # type: str + resource_group_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "models.StorageAccount" + """Gets a StorageAccount by name. + + Gets a StorageAccount by name. + + :param device_name: The device name. + :type device_name: str + :param storage_account_name: The storage account name. + :type storage_account_name: str + :param resource_group_name: The resource group name. + :type resource_group_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: StorageAccount, or the result of cls(response) + :rtype: ~data_box_edge_management_client.models.StorageAccount + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.StorageAccount"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'storageAccountName': self._serialize.url("storage_account_name", storage_account_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('StorageAccount', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/storageAccounts/{storageAccountName}'} # type: ignore + + def _create_or_update_initial( + self, + device_name, # type: str + storage_account_name, # type: str + resource_group_name, # type: str + storage_account, # type: "models.StorageAccount" + **kwargs # type: Any + ): + # type: (...) -> Optional["models.StorageAccount"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.StorageAccount"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._create_or_update_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'storageAccountName': self._serialize.url("storage_account_name", storage_account_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(storage_account, 'StorageAccount') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('StorageAccount', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/storageAccounts/{storageAccountName}'} # type: ignore + + def begin_create_or_update( + self, + device_name, # type: str + storage_account_name, # type: str + resource_group_name, # type: str + storage_account, # type: "models.StorageAccount" + **kwargs # type: Any + ): + # type: (...) -> LROPoller["models.StorageAccount"] + """Creates a new StorageAccount or updates an existing StorageAccount on the device. + + Creates a new StorageAccount or updates an existing StorageAccount on the device. + + :param device_name: The device name. + :type device_name: str + :param storage_account_name: The StorageAccount name. + :type storage_account_name: str + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param storage_account: The StorageAccount properties. + :type storage_account: ~data_box_edge_management_client.models.StorageAccount + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either StorageAccount or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~data_box_edge_management_client.models.StorageAccount] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["models.StorageAccount"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._create_or_update_initial( + device_name=device_name, + storage_account_name=storage_account_name, + resource_group_name=resource_group_name, + storage_account=storage_account, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('StorageAccount', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'storageAccountName': self._serialize.url("storage_account_name", storage_account_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/storageAccounts/{storageAccountName}'} # type: ignore + + def _delete_initial( + self, + device_name, # type: str + storage_account_name, # type: str + resource_group_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self._delete_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'storageAccountName': self._serialize.url("storage_account_name", storage_account_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/storageAccounts/{storageAccountName}'} # type: ignore + + def begin_delete( + self, + device_name, # type: str + storage_account_name, # type: str + resource_group_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> LROPoller[None] + """Deletes the StorageAccount on the Data Box Edge/Data Box Gateway device. + + :param device_name: The device name. + :type device_name: str + :param storage_account_name: The StorageAccount name. + :type storage_account_name: str + :param resource_group_name: The resource group name. + :type resource_group_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._delete_initial( + device_name=device_name, + storage_account_name=storage_account_name, + resource_group_name=resource_group_name, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'storageAccountName': self._serialize.url("storage_account_name", storage_account_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/storageAccounts/{storageAccountName}'} # type: ignore diff --git a/src/databoxedge/azext_databoxedge/vendored_sdks/databoxedge/operations/_support_packages_operations.py b/src/databoxedge/azext_databoxedge/vendored_sdks/databoxedge/operations/_support_packages_operations.py new file mode 100644 index 00000000000..e4d8191f098 --- /dev/null +++ b/src/databoxedge/azext_databoxedge/vendored_sdks/databoxedge/operations/_support_packages_operations.py @@ -0,0 +1,169 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.core.polling import LROPoller, NoPolling, PollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.arm_polling import ARMPolling + +from .. import models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Optional, TypeVar, Union + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class SupportPackagesOperations(object): + """SupportPackagesOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~data_box_edge_management_client.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def _trigger_support_package_initial( + self, + device_name, # type: str + resource_group_name, # type: str + trigger_support_package_request, # type: "models.TriggerSupportPackageRequest" + **kwargs # type: Any + ): + # type: (...) -> None + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._trigger_support_package_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(trigger_support_package_request, 'TriggerSupportPackageRequest') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _trigger_support_package_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/triggerSupportPackage'} # type: ignore + + def begin_trigger_support_package( + self, + device_name, # type: str + resource_group_name, # type: str + trigger_support_package_request, # type: "models.TriggerSupportPackageRequest" + **kwargs # type: Any + ): + # type: (...) -> LROPoller[None] + """Triggers support package on the device. + + Triggers support package on the device. + + :param device_name: The device name. + :type device_name: str + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param trigger_support_package_request: The trigger support package request object. + :type trigger_support_package_request: ~data_box_edge_management_client.models.TriggerSupportPackageRequest + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._trigger_support_package_initial( + device_name=device_name, + resource_group_name=resource_group_name, + trigger_support_package_request=trigger_support_package_request, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_trigger_support_package.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/triggerSupportPackage'} # type: ignore diff --git a/src/databoxedge/azext_databoxedge/vendored_sdks/databoxedge/operations/_triggers_operations.py b/src/databoxedge/azext_databoxedge/vendored_sdks/databoxedge/operations/_triggers_operations.py new file mode 100644 index 00000000000..14de0b6b900 --- /dev/null +++ b/src/databoxedge/azext_databoxedge/vendored_sdks/databoxedge/operations/_triggers_operations.py @@ -0,0 +1,444 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.core.polling import LROPoller, NoPolling, PollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.arm_polling import ARMPolling + +from .. import models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class TriggersOperations(object): + """TriggersOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~data_box_edge_management_client.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list_by_data_box_edge_device( + self, + device_name, # type: str + resource_group_name, # type: str + filter=None, # type: Optional[str] + **kwargs # type: Any + ): + # type: (...) -> Iterable["models.TriggerList"] + """Lists all the triggers configured in the device. + + :param device_name: The device name. + :type device_name: str + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param filter: Specify $filter='CustomContextTag eq :code:``' to filter on custom context + tag property. + :type filter: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either TriggerList or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~data_box_edge_management_client.models.TriggerList] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.TriggerList"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_by_data_box_edge_device.metadata['url'] # type: ignore + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + if filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('TriggerList', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_by_data_box_edge_device.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/triggers'} # type: ignore + + def get( + self, + device_name, # type: str + name, # type: str + resource_group_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "models.Trigger" + """Get a specific trigger by name. + + :param device_name: The device name. + :type device_name: str + :param name: The trigger name. + :type name: str + :param resource_group_name: The resource group name. + :type resource_group_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: Trigger, or the result of cls(response) + :rtype: ~data_box_edge_management_client.models.Trigger + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.Trigger"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('Trigger', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/triggers/{name}'} # type: ignore + + def _create_or_update_initial( + self, + device_name, # type: str + name, # type: str + resource_group_name, # type: str + trigger, # type: "models.Trigger" + **kwargs # type: Any + ): + # type: (...) -> Optional["models.Trigger"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.Trigger"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._create_or_update_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(trigger, 'Trigger') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('Trigger', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/triggers/{name}'} # type: ignore + + def begin_create_or_update( + self, + device_name, # type: str + name, # type: str + resource_group_name, # type: str + trigger, # type: "models.Trigger" + **kwargs # type: Any + ): + # type: (...) -> LROPoller["models.Trigger"] + """Creates or updates a trigger. + + :param device_name: Creates or updates a trigger. + :type device_name: str + :param name: The trigger name. + :type name: str + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param trigger: The trigger. + :type trigger: ~data_box_edge_management_client.models.Trigger + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either Trigger or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~data_box_edge_management_client.models.Trigger] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["models.Trigger"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._create_or_update_initial( + device_name=device_name, + name=name, + resource_group_name=resource_group_name, + trigger=trigger, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('Trigger', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/triggers/{name}'} # type: ignore + + def _delete_initial( + self, + device_name, # type: str + name, # type: str + resource_group_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self._delete_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/triggers/{name}'} # type: ignore + + def begin_delete( + self, + device_name, # type: str + name, # type: str + resource_group_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> LROPoller[None] + """Deletes the trigger on the gateway device. + + :param device_name: The device name. + :type device_name: str + :param name: The trigger name. + :type name: str + :param resource_group_name: The resource group name. + :type resource_group_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._delete_initial( + device_name=device_name, + name=name, + resource_group_name=resource_group_name, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/triggers/{name}'} # type: ignore diff --git a/src/databoxedge/azext_databoxedge/vendored_sdks/databoxedge/operations/_users_operations.py b/src/databoxedge/azext_databoxedge/vendored_sdks/databoxedge/operations/_users_operations.py new file mode 100644 index 00000000000..433796cfe3a --- /dev/null +++ b/src/databoxedge/azext_databoxedge/vendored_sdks/databoxedge/operations/_users_operations.py @@ -0,0 +1,444 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.core.polling import LROPoller, NoPolling, PollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.arm_polling import ARMPolling + +from .. import models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class UsersOperations(object): + """UsersOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~data_box_edge_management_client.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list_by_data_box_edge_device( + self, + device_name, # type: str + resource_group_name, # type: str + filter=None, # type: Optional[str] + **kwargs # type: Any + ): + # type: (...) -> Iterable["models.UserList"] + """Gets all the users registered on a Data Box Edge/Data Box Gateway device. + + :param device_name: The device name. + :type device_name: str + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param filter: Specify $filter='Type eq :code:``' to filter on user type property. + :type filter: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either UserList or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~data_box_edge_management_client.models.UserList] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.UserList"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_by_data_box_edge_device.metadata['url'] # type: ignore + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + if filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('UserList', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_by_data_box_edge_device.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/users'} # type: ignore + + def get( + self, + device_name, # type: str + name, # type: str + resource_group_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "models.User" + """Gets the properties of the specified user. + + :param device_name: The device name. + :type device_name: str + :param name: The user name. + :type name: str + :param resource_group_name: The resource group name. + :type resource_group_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: User, or the result of cls(response) + :rtype: ~data_box_edge_management_client.models.User + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.User"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('User', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/users/{name}'} # type: ignore + + def _create_or_update_initial( + self, + device_name, # type: str + name, # type: str + resource_group_name, # type: str + user, # type: "models.User" + **kwargs # type: Any + ): + # type: (...) -> Optional["models.User"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.User"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._create_or_update_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(user, 'User') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('User', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/users/{name}'} # type: ignore + + def begin_create_or_update( + self, + device_name, # type: str + name, # type: str + resource_group_name, # type: str + user, # type: "models.User" + **kwargs # type: Any + ): + # type: (...) -> LROPoller["models.User"] + """Creates a new user or updates an existing user's information on a Data Box Edge/Data Box + Gateway device. + + :param device_name: The device name. + :type device_name: str + :param name: The user name. + :type name: str + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param user: The user details. + :type user: ~data_box_edge_management_client.models.User + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either User or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~data_box_edge_management_client.models.User] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["models.User"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._create_or_update_initial( + device_name=device_name, + name=name, + resource_group_name=resource_group_name, + user=user, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('User', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/users/{name}'} # type: ignore + + def _delete_initial( + self, + device_name, # type: str + name, # type: str + resource_group_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self._delete_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/users/{name}'} # type: ignore + + def begin_delete( + self, + device_name, # type: str + name, # type: str + resource_group_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> LROPoller[None] + """Deletes the user on a databox edge/gateway device. + + :param device_name: The device name. + :type device_name: str + :param name: The user name. + :type name: str + :param resource_group_name: The resource group name. + :type resource_group_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._delete_initial( + device_name=device_name, + name=name, + resource_group_name=resource_group_name, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/users/{name}'} # type: ignore diff --git a/src/databoxedge/azext_databoxedge/vendored_sdks/databoxedge/py.typed b/src/databoxedge/azext_databoxedge/vendored_sdks/databoxedge/py.typed new file mode 100644 index 00000000000..e5aff4f83af --- /dev/null +++ b/src/databoxedge/azext_databoxedge/vendored_sdks/databoxedge/py.typed @@ -0,0 +1 @@ +# Marker file for PEP 561. \ No newline at end of file diff --git a/src/databoxedge/report.md b/src/databoxedge/report.md new file mode 100644 index 00000000000..344ebcf9f9e --- /dev/null +++ b/src/databoxedge/report.md @@ -0,0 +1,1341 @@ +# 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 available-sku|AvailableSkus|[commands](#CommandsInAvailableSkus)| +|az databoxedge device|Devices|[commands](#CommandsInDevices)| +|az databoxedge alert|Alerts|[commands](#CommandsInAlerts)| +|az databoxedge bandwidth-schedule|BandwidthSchedules|[commands](#CommandsInBandwidthSchedules)| +|az databoxedge diagnostic-setting|DiagnosticSettings|[commands](#CommandsInDiagnosticSettings)| +|az databoxedge job|Jobs|[commands](#CommandsInJobs)| +|az databoxedge node|Nodes|[commands](#CommandsInNodes)| +|az databoxedge operation-status|OperationsStatus|[commands](#CommandsInOperationsStatus)| +|az databoxedge order|Orders|[commands](#CommandsInOrders)| +|az databoxedge role|Roles|[commands](#CommandsInRoles)| +|az databoxedge addon|Addons|[commands](#CommandsInAddons)| +|az databoxedge monitoring-config|MonitoringConfig|[commands](#CommandsInMonitoringConfig)| +|az databoxedge share|Shares|[commands](#CommandsInShares)| +|az databoxedge storage-account-credentials|StorageAccountCredentials|[commands](#CommandsInStorageAccountCredentials)| +|az databoxedge storage-account|StorageAccounts|[commands](#CommandsInStorageAccounts)| +|az databoxedge container|Containers|[commands](#CommandsInContainers)| +|az databoxedge trigger|Triggers|[commands](#CommandsInTriggers)| +|az databoxedge support-package|SupportPackages|[commands](#CommandsInSupportPackages)| +|az databoxedge user|Users|[commands](#CommandsInUsers)| + +## COMMANDS +### Commands in `az databoxedge addon` group +|CLI Command|Operation Swagger name|Parameters|Examples| +|---------|------------|--------|-----------| +|[az databoxedge addon list](#AddonsListByRole)|ListByRole|[Parameters](#ParametersAddonsListByRole)|[Example](#ExamplesAddonsListByRole)| +|[az databoxedge addon show](#AddonsGet)|Get|[Parameters](#ParametersAddonsGet)|[Example](#ExamplesAddonsGet)| +|[az databoxedge addon create](#AddonsCreateOrUpdate#Create)|CreateOrUpdate#Create|[Parameters](#ParametersAddonsCreateOrUpdate#Create)|[Example](#ExamplesAddonsCreateOrUpdate#Create)| +|[az databoxedge addon update](#AddonsCreateOrUpdate#Update)|CreateOrUpdate#Update|[Parameters](#ParametersAddonsCreateOrUpdate#Update)|Not Found| +|[az databoxedge addon delete](#AddonsDelete)|Delete|[Parameters](#ParametersAddonsDelete)|[Example](#ExamplesAddonsDelete)| + +### 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 available-sku` group +|CLI Command|Operation Swagger name|Parameters|Examples| +|---------|------------|--------|-----------| +|[az databoxedge available-sku list](#AvailableSkusList)|List|[Parameters](#ParametersAvailableSkusList)|[Example](#ExamplesAvailableSkusList)| + +### 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 container` group +|CLI Command|Operation Swagger name|Parameters|Examples| +|---------|------------|--------|-----------| +|[az databoxedge container list](#ContainersListByStorageAccount)|ListByStorageAccount|[Parameters](#ParametersContainersListByStorageAccount)|[Example](#ExamplesContainersListByStorageAccount)| +|[az databoxedge container show](#ContainersGet)|Get|[Parameters](#ParametersContainersGet)|[Example](#ExamplesContainersGet)| +|[az databoxedge container create](#ContainersCreateOrUpdate#Create)|CreateOrUpdate#Create|[Parameters](#ParametersContainersCreateOrUpdate#Create)|[Example](#ExamplesContainersCreateOrUpdate#Create)| +|[az databoxedge container update](#ContainersCreateOrUpdate#Update)|CreateOrUpdate#Update|[Parameters](#ParametersContainersCreateOrUpdate#Update)|Not Found| +|[az databoxedge container delete](#ContainersDelete)|Delete|[Parameters](#ParametersContainersDelete)|[Example](#ExamplesContainersDelete)| +|[az databoxedge container refresh](#ContainersRefresh)|Refresh|[Parameters](#ParametersContainersRefresh)|[Example](#ExamplesContainersRefresh)| + +### 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 create-or-update-security-setting](#DevicesCreateOrUpdateSecuritySettings)|CreateOrUpdateSecuritySettings|[Parameters](#ParametersDevicesCreateOrUpdateSecuritySettings)|[Example](#ExamplesDevicesCreateOrUpdateSecuritySettings)| +|[az databoxedge device download-update](#DevicesDownloadUpdates)|DownloadUpdates|[Parameters](#ParametersDevicesDownloadUpdates)|[Example](#ExamplesDevicesDownloadUpdates)| +|[az databoxedge device generate-certificate](#DevicesGenerateCertificate)|GenerateCertificate|[Parameters](#ParametersDevicesGenerateCertificate)|[Example](#ExamplesDevicesGenerateCertificate)| +|[az databoxedge device get-extended-information](#DevicesGetExtendedInformation)|GetExtendedInformation|[Parameters](#ParametersDevicesGetExtendedInformation)|[Example](#ExamplesDevicesGetExtendedInformation)| +|[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-network-setting](#DevicesGetNetworkSettings)|GetNetworkSettings|[Parameters](#ParametersDevicesGetNetworkSettings)|[Example](#ExamplesDevicesGetNetworkSettings)| +|[az databoxedge device show-update-summary](#DevicesGetUpdateSummary)|GetUpdateSummary|[Parameters](#ParametersDevicesGetUpdateSummary)|[Example](#ExamplesDevicesGetUpdateSummary)| +|[az databoxedge device update-extended-information](#DevicesUpdateExtendedInformation)|UpdateExtendedInformation|[Parameters](#ParametersDevicesUpdateExtendedInformation)|[Example](#ExamplesDevicesUpdateExtendedInformation)| +|[az databoxedge device upload-certificate](#DevicesUploadCertificate)|UploadCertificate|[Parameters](#ParametersDevicesUploadCertificate)|[Example](#ExamplesDevicesUploadCertificate)| + +### Commands in `az databoxedge diagnostic-setting` group +|CLI Command|Operation Swagger name|Parameters|Examples| +|---------|------------|--------|-----------| +|[az databoxedge diagnostic-setting show-diagnostic-proactive-log-collection-setting](#DiagnosticSettingsGetDiagnosticProactiveLogCollectionSettings)|GetDiagnosticProactiveLogCollectionSettings|[Parameters](#ParametersDiagnosticSettingsGetDiagnosticProactiveLogCollectionSettings)|[Example](#ExamplesDiagnosticSettingsGetDiagnosticProactiveLogCollectionSettings)| +|[az databoxedge diagnostic-setting show-diagnostic-remote-support-setting](#DiagnosticSettingsGetDiagnosticRemoteSupportSettings)|GetDiagnosticRemoteSupportSettings|[Parameters](#ParametersDiagnosticSettingsGetDiagnosticRemoteSupportSettings)|[Example](#ExamplesDiagnosticSettingsGetDiagnosticRemoteSupportSettings)| +|[az databoxedge diagnostic-setting update-diagnostic-proactive-log-collection-setting](#DiagnosticSettingsUpdateDiagnosticProactiveLogCollectionSettings)|UpdateDiagnosticProactiveLogCollectionSettings|[Parameters](#ParametersDiagnosticSettingsUpdateDiagnosticProactiveLogCollectionSettings)|[Example](#ExamplesDiagnosticSettingsUpdateDiagnosticProactiveLogCollectionSettings)| +|[az databoxedge diagnostic-setting update-diagnostic-remote-support-setting](#DiagnosticSettingsUpdateDiagnosticRemoteSupportSettings)|UpdateDiagnosticRemoteSupportSettings|[Parameters](#ParametersDiagnosticSettingsUpdateDiagnosticRemoteSupportSettings)|[Example](#ExamplesDiagnosticSettingsUpdateDiagnosticRemoteSupportSettings)| + +### Commands in `az databoxedge job` group +|CLI Command|Operation Swagger name|Parameters|Examples| +|---------|------------|--------|-----------| +|[az databoxedge job show](#JobsGet)|Get|[Parameters](#ParametersJobsGet)|[Example](#ExamplesJobsGet)| + +### Commands in `az databoxedge monitoring-config` group +|CLI Command|Operation Swagger name|Parameters|Examples| +|---------|------------|--------|-----------| +|[az databoxedge monitoring-config list](#MonitoringConfigList)|List|[Parameters](#ParametersMonitoringConfigList)|[Example](#ExamplesMonitoringConfigList)| +|[az databoxedge monitoring-config show](#MonitoringConfigGet)|Get|[Parameters](#ParametersMonitoringConfigGet)|[Example](#ExamplesMonitoringConfigGet)| +|[az databoxedge monitoring-config create](#MonitoringConfigCreateOrUpdate#Create)|CreateOrUpdate#Create|[Parameters](#ParametersMonitoringConfigCreateOrUpdate#Create)|[Example](#ExamplesMonitoringConfigCreateOrUpdate#Create)| +|[az databoxedge monitoring-config update](#MonitoringConfigCreateOrUpdate#Update)|CreateOrUpdate#Update|[Parameters](#ParametersMonitoringConfigCreateOrUpdate#Update)|Not Found| +|[az databoxedge monitoring-config delete](#MonitoringConfigDelete)|Delete|[Parameters](#ParametersMonitoringConfigDelete)|[Example](#ExamplesMonitoringConfigDelete)| + +### Commands in `az databoxedge node` group +|CLI Command|Operation Swagger name|Parameters|Examples| +|---------|------------|--------|-----------| +|[az databoxedge node list](#NodesListByDataBoxEdgeDevice)|ListByDataBoxEdgeDevice|[Parameters](#ParametersNodesListByDataBoxEdgeDevice)|[Example](#ExamplesNodesListByDataBoxEdgeDevice)| + +### Commands in `az databoxedge operation-status` group +|CLI Command|Operation Swagger name|Parameters|Examples| +|---------|------------|--------|-----------| +|[az databoxedge operation-status show](#OperationsStatusGet)|Get|[Parameters](#ParametersOperationsStatusGet)|[Example](#ExamplesOperationsStatusGet)| + +### 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)| +|[az databoxedge order list-dc-access-code](#OrdersListDCAccessCode)|ListDCAccessCode|[Parameters](#ParametersOrdersListDCAccessCode)|[Example](#ExamplesOrdersListDCAccessCode)| + +### Commands in `az databoxedge role` group +|CLI Command|Operation Swagger name|Parameters|Examples| +|---------|------------|--------|-----------| +|[az databoxedge role list](#RolesListByDataBoxEdgeDevice)|ListByDataBoxEdgeDevice|[Parameters](#ParametersRolesListByDataBoxEdgeDevice)|[Example](#ExamplesRolesListByDataBoxEdgeDevice)| +|[az databoxedge role show](#RolesGet)|Get|[Parameters](#ParametersRolesGet)|[Example](#ExamplesRolesGet)| +|[az databoxedge role create](#RolesCreateOrUpdate#Create)|CreateOrUpdate#Create|[Parameters](#ParametersRolesCreateOrUpdate#Create)|[Example](#ExamplesRolesCreateOrUpdate#Create)| +|[az databoxedge role update](#RolesCreateOrUpdate#Update)|CreateOrUpdate#Update|[Parameters](#ParametersRolesCreateOrUpdate#Update)|Not Found| +|[az databoxedge role delete](#RolesDelete)|Delete|[Parameters](#ParametersRolesDelete)|[Example](#ExamplesRolesDelete)| + +### Commands in `az databoxedge share` group +|CLI Command|Operation Swagger name|Parameters|Examples| +|---------|------------|--------|-----------| +|[az databoxedge share list](#SharesListByDataBoxEdgeDevice)|ListByDataBoxEdgeDevice|[Parameters](#ParametersSharesListByDataBoxEdgeDevice)|[Example](#ExamplesSharesListByDataBoxEdgeDevice)| +|[az databoxedge share show](#SharesGet)|Get|[Parameters](#ParametersSharesGet)|[Example](#ExamplesSharesGet)| +|[az databoxedge share create](#SharesCreateOrUpdate#Create)|CreateOrUpdate#Create|[Parameters](#ParametersSharesCreateOrUpdate#Create)|[Example](#ExamplesSharesCreateOrUpdate#Create)| +|[az databoxedge share update](#SharesCreateOrUpdate#Update)|CreateOrUpdate#Update|[Parameters](#ParametersSharesCreateOrUpdate#Update)|Not Found| +|[az databoxedge share delete](#SharesDelete)|Delete|[Parameters](#ParametersSharesDelete)|[Example](#ExamplesSharesDelete)| +|[az databoxedge share refresh](#SharesRefresh)|Refresh|[Parameters](#ParametersSharesRefresh)|[Example](#ExamplesSharesRefresh)| + +### Commands in `az databoxedge storage-account` group +|CLI Command|Operation Swagger name|Parameters|Examples| +|---------|------------|--------|-----------| +|[az databoxedge storage-account list](#StorageAccountsListByDataBoxEdgeDevice)|ListByDataBoxEdgeDevice|[Parameters](#ParametersStorageAccountsListByDataBoxEdgeDevice)|[Example](#ExamplesStorageAccountsListByDataBoxEdgeDevice)| +|[az databoxedge storage-account show](#StorageAccountsGet)|Get|[Parameters](#ParametersStorageAccountsGet)|[Example](#ExamplesStorageAccountsGet)| +|[az databoxedge storage-account delete](#StorageAccountsDelete)|Delete|[Parameters](#ParametersStorageAccountsDelete)|[Example](#ExamplesStorageAccountsDelete)| + +### Commands in `az databoxedge storage-account-credentials` group +|CLI Command|Operation Swagger name|Parameters|Examples| +|---------|------------|--------|-----------| +|[az databoxedge storage-account-credentials list](#StorageAccountCredentialsListByDataBoxEdgeDevice)|ListByDataBoxEdgeDevice|[Parameters](#ParametersStorageAccountCredentialsListByDataBoxEdgeDevice)|[Example](#ExamplesStorageAccountCredentialsListByDataBoxEdgeDevice)| +|[az databoxedge storage-account-credentials show](#StorageAccountCredentialsGet)|Get|[Parameters](#ParametersStorageAccountCredentialsGet)|[Example](#ExamplesStorageAccountCredentialsGet)| +|[az databoxedge storage-account-credentials delete](#StorageAccountCredentialsDelete)|Delete|[Parameters](#ParametersStorageAccountCredentialsDelete)|[Example](#ExamplesStorageAccountCredentialsDelete)| + +### Commands in `az databoxedge support-package` group +|CLI Command|Operation Swagger name|Parameters|Examples| +|---------|------------|--------|-----------| +|[az databoxedge support-package trigger-support-package](#SupportPackagesTriggerSupportPackage)|TriggerSupportPackage|[Parameters](#ParametersSupportPackagesTriggerSupportPackage)|[Example](#ExamplesSupportPackagesTriggerSupportPackage)| + +### Commands in `az databoxedge trigger` group +|CLI Command|Operation Swagger name|Parameters|Examples| +|---------|------------|--------|-----------| +|[az databoxedge trigger list](#TriggersListByDataBoxEdgeDevice)|ListByDataBoxEdgeDevice|[Parameters](#ParametersTriggersListByDataBoxEdgeDevice)|[Example](#ExamplesTriggersListByDataBoxEdgeDevice)| +|[az databoxedge trigger show](#TriggersGet)|Get|[Parameters](#ParametersTriggersGet)|[Example](#ExamplesTriggersGet)| +|[az databoxedge trigger create](#TriggersCreateOrUpdate#Create)|CreateOrUpdate#Create|[Parameters](#ParametersTriggersCreateOrUpdate#Create)|[Example](#ExamplesTriggersCreateOrUpdate#Create)| +|[az databoxedge trigger update](#TriggersCreateOrUpdate#Update)|CreateOrUpdate#Update|[Parameters](#ParametersTriggersCreateOrUpdate#Update)|Not Found| +|[az databoxedge trigger delete](#TriggersDelete)|Delete|[Parameters](#ParametersTriggersDelete)|[Example](#ExamplesTriggersDelete)| + +### Commands in `az databoxedge user` group +|CLI Command|Operation Swagger name|Parameters|Examples| +|---------|------------|--------|-----------| +|[az databoxedge user list](#UsersListByDataBoxEdgeDevice)|ListByDataBoxEdgeDevice|[Parameters](#ParametersUsersListByDataBoxEdgeDevice)|[Example](#ExamplesUsersListByDataBoxEdgeDevice)| +|[az databoxedge user show](#UsersGet)|Get|[Parameters](#ParametersUsersGet)|[Example](#ExamplesUsersGet)| +|[az databoxedge user create](#UsersCreateOrUpdate#Create)|CreateOrUpdate#Create|[Parameters](#ParametersUsersCreateOrUpdate#Create)|[Example](#ExamplesUsersCreateOrUpdate#Create)| +|[az databoxedge user update](#UsersCreateOrUpdate#Update)|CreateOrUpdate#Update|[Parameters](#ParametersUsersCreateOrUpdate#Update)|Not Found| +|[az databoxedge user delete](#UsersDelete)|Delete|[Parameters](#ParametersUsersDelete)|[Example](#ExamplesUsersDelete)| + + +## COMMAND DETAILS + +### group `az databoxedge addon` +#### Command `az databoxedge addon list` + +##### Example +``` +az databoxedge addon list --device-name "testedgedevice" --resource-group "GroupForEdgeAutomation" --role-name \ +"IoTRole1" +``` +##### Parameters +|Option|Type|Description|Path (SDK)|Swagger name| +|------|----|-----------|----------|------------| +|**--device-name**|string|The device name.|device_name|deviceName| +|**--role-name**|string|The role name.|role_name|roleName| +|**--resource-group-name**|string|The resource group name.|resource_group_name|resourceGroupName| + +#### Command `az databoxedge addon show` + +##### Example +``` +az databoxedge addon show --name "arcName" --device-name "testedgedevice" --resource-group "GroupForEdgeAutomation" \ +--role-name "KubernetesRole" +``` +##### Parameters +|Option|Type|Description|Path (SDK)|Swagger name| +|------|----|-----------|----------|------------| +|**--device-name**|string|The device name.|device_name|deviceName| +|**--role-name**|string|The role name.|role_name|roleName| +|**--addon-name**|string|The addon name.|addon_name|addonName| +|**--resource-group-name**|string|The resource group name.|resource_group_name|resourceGroupName| + +#### Command `az databoxedge addon create` + +##### Example +``` +az databoxedge addon create --addon "{\\"kind\\":\\"ArcForKubernetes\\",\\"properties\\":{\\"resourceGroupName\\":\\"Gr\ +oupForEdgeAutomation\\",\\"resourceLocation\\":\\"EastUS\\",\\"resourceName\\":\\"testedgedevice\\",\\"subscriptionId\\\ +":\\"4385cf00-2d3a-425a-832f-f4285b1c9dce\\"}}" --name "arcName" --device-name "testedgedevice" --resource-group \ +"GroupForEdgeAutomation" --role-name "KubernetesRole" +``` +##### Parameters +|Option|Type|Description|Path (SDK)|Swagger name| +|------|----|-----------|----------|------------| +|**--device-name**|string|The device name.|device_name|deviceName| +|**--role-name**|string|The role name.|role_name|roleName| +|**--addon-name**|string|The addon name.|addon_name|addonName| +|**--resource-group-name**|string|The resource group name.|resource_group_name|resourceGroupName| +|**--addon**|object|The addon properties.|addon|addon| + +#### Command `az databoxedge addon update` + +##### Parameters +|Option|Type|Description|Path (SDK)|Swagger name| +|------|----|-----------|----------|------------| +|**--device-name**|string|The device name.|device_name|deviceName| +|**--role-name**|string|The role name.|role_name|roleName| +|**--addon-name**|string|The addon name.|addon_name|addonName| +|**--resource-group-name**|string|The resource group name.|resource_group_name|resourceGroupName| +|**--addon**|object|The addon properties.|addon|addon| + +#### Command `az databoxedge addon delete` + +##### Example +``` +az databoxedge addon delete --name "arcName" --device-name "testedgedevice" --resource-group "GroupForEdgeAutomation" \ +--role-name "KubernetesRole" +``` +##### Parameters +|Option|Type|Description|Path (SDK)|Swagger name| +|------|----|-----------|----------|------------| +|**--device-name**|string|The device name.|device_name|deviceName| +|**--role-name**|string|The role name.|role_name|roleName| +|**--addon-name**|string|The addon name.|addon_name|addonName| +|**--resource-group-name**|string|The resource group name.|resource_group_name|resourceGroupName| + +### 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 available-sku` +#### Command `az databoxedge available-sku list` + +##### Example +``` +az databoxedge available-sku list +``` +##### Parameters +|Option|Type|Description|Path (SDK)|Swagger name| +|------|----|-----------|----------|------------| +### 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 container` +#### Command `az databoxedge container list` + +##### Example +``` +az databoxedge container list --device-name "testedgedevice" --resource-group "GroupForEdgeAutomation" \ +--storage-account-name "storageaccount1" +``` +##### Parameters +|Option|Type|Description|Path (SDK)|Swagger name| +|------|----|-----------|----------|------------| +|**--device-name**|string|The device name.|device_name|deviceName| +|**--storage-account-name**|string|The storage Account name.|storage_account_name|storageAccountName| +|**--resource-group-name**|string|The resource group name.|resource_group_name|resourceGroupName| + +#### Command `az databoxedge container show` + +##### Example +``` +az databoxedge container show --name "blobcontainer1" --device-name "testedgedevice" --resource-group \ +"GroupForEdgeAutomation" --storage-account-name "storageaccount1" +``` +##### Parameters +|Option|Type|Description|Path (SDK)|Swagger name| +|------|----|-----------|----------|------------| +|**--device-name**|string|The device name.|device_name|deviceName| +|**--storage-account-name**|string|The Storage Account Name|storage_account_name|storageAccountName| +|**--container-name**|string|The container Name|container_name|containerName| +|**--resource-group-name**|string|The resource group name.|resource_group_name|resourceGroupName| + +#### Command `az databoxedge container create` + +##### Example +``` +az databoxedge container create --data-format "BlockBlob" --name "blobcontainer1" --device-name "testedgedevice" \ +--resource-group "GroupForEdgeAutomation" --storage-account-name "storageaccount1" +``` +##### Parameters +|Option|Type|Description|Path (SDK)|Swagger name| +|------|----|-----------|----------|------------| +|**--device-name**|string|The device name.|device_name|deviceName| +|**--storage-account-name**|string|The Storage Account Name|storage_account_name|storageAccountName| +|**--container-name**|string|The container name.|container_name|containerName| +|**--resource-group-name**|string|The resource group name.|resource_group_name|resourceGroupName| +|**--data-format**|choice|DataFormat for Container|data_format|dataFormat| + +#### Command `az databoxedge container update` + +##### Parameters +|Option|Type|Description|Path (SDK)|Swagger name| +|------|----|-----------|----------|------------| +|**--device-name**|string|The device name.|device_name|deviceName| +|**--storage-account-name**|string|The Storage Account Name|storage_account_name|storageAccountName| +|**--container-name**|string|The container name.|container_name|containerName| +|**--resource-group-name**|string|The resource group name.|resource_group_name|resourceGroupName| +|**--data-format**|choice|DataFormat for Container|data_format|dataFormat| + +#### Command `az databoxedge container delete` + +##### Example +``` +az databoxedge container delete --name "blobcontainer1" --device-name "testedgedevice" --resource-group \ +"GroupForEdgeAutomation" --storage-account-name "storageaccount1" +``` +##### Parameters +|Option|Type|Description|Path (SDK)|Swagger name| +|------|----|-----------|----------|------------| +|**--device-name**|string|The device name.|device_name|deviceName| +|**--storage-account-name**|string|The Storage Account Name|storage_account_name|storageAccountName| +|**--container-name**|string|The container name.|container_name|containerName| +|**--resource-group-name**|string|The resource group name.|resource_group_name|resourceGroupName| + +#### Command `az databoxedge container refresh` + +##### Example +``` +az databoxedge container refresh --name "blobcontainer1" --device-name "testedgedevice" --resource-group \ +"GroupForEdgeAutomation" --storage-account-name "storageaccount1" +``` +##### Parameters +|Option|Type|Description|Path (SDK)|Swagger name| +|------|----|-----------|----------|------------| +|**--device-name**|string|The device name.|device_name|deviceName| +|**--storage-account-name**|string|The Storage Account Name|storage_account_name|storageAccountName| +|**--container-name**|string|The container name.|container_name|containerName| +|**--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 "WUS" --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| +|**--kind**|choice|The kind of the device.|kind|kind| +|**--data-box-edge-device-status**|choice|The status of the Data Box Edge/Gateway device.|data_box_edge_device_status|dataBoxEdgeDeviceStatus| +|**--type**|choice|DataResidencyType enum|type|type| +|**--msi-identity-type**|choice|Identity type|msi_identity_type|type| + +#### Command `az databoxedge device update` + +##### Example +``` +az databoxedge device update --name "testedgedevice" --id "/subscriptions/0d44739e-0563-474f-97e7-24a0cdb23b29/resource\ +Groups/rapvs-rg/providers/Microsoft.AzureStack/linkedSubscriptions/ca014ddc-5cf2-45f8-b390-e901e4a0ae87" \ +--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| +|**--id**|string|The path ID that uniquely identifies the subscription of the edge profile.|id|id| +|**--type**|choice|Identity type|type|type| + +#### 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 create-or-update-security-setting` + +##### Example +``` +az databoxedge device create-or-update-security-setting --name "testedgedevice" --resource-group "AzureVM" \ +--device-admin-password encryption-algorithm="AES256" encryption-cert-thumbprint="" \ +value="" +``` +##### 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| +|**--device-admin-password**|object|Device administrator password as an encrypted string (encrypted using RSA PKCS #1) is used to sign into the local web UI of the device. The Actual password should have at least 8 characters that are a combination of uppercase, lowercase, numeric, and special characters.|device_admin_password|deviceAdminPassword| + +#### 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 generate-certificate` + +##### Example +``` +az databoxedge device generate-certificate --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 get-extended-information` + +##### Example +``` +az databoxedge device get-extended-information --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-network-setting` + +##### Example +``` +az databoxedge device show-network-setting --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| + +#### Command `az databoxedge device update-extended-information` + +##### Example +``` +az databoxedge device update-extended-information --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| +|**--client-secret-store-id**|string|The Key Vault ARM Id for client secrets|client_secret_store_id|clientSecretStoreId| +|**--client-secret-store-url**|string|The url to access the Client Key Vault|client_secret_store_url|clientSecretStoreUrl| +|**--channel-integrity-key-name**|string|The name for Channel Integrity Key stored in the Client Key Vault|channel_integrity_key_name|channelIntegrityKeyName| +|**--channel-integrity-key-version**|string|The version of Channel Integrity Key stored in the Client Key Vault|channel_integrity_key_version|channelIntegrityKeyVersion| +|**--sync-status**|choice|For changing or to initiate the resync to key-vault set the status to KeyVaultSyncPending, rest of the status will not be applicable.|sync_status|syncStatus| + +#### Command `az databoxedge device upload-certificate` + +##### Example +``` +az databoxedge device upload-certificate --name "testedgedevice" --certificate "MIIC9DCCAdygAwIBAgIQWJae7GNjiI9Mcv/gJyr\ +OPTANBgkqhkiG9w0BAQUFADASMRAwDgYDVQQDDAdXaW5kb3dzMB4XDTE4MTEyNzAwMTA0NVoXDTIxMTEyODAwMTA0NVowEjEQMA4GA1UEAwwHV2luZG93cz\ +CCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAKxkRExqxf0qH1avnyORptIbRC2yQwqe3EIbJ2FPKr5jtAppGeX/dGKrFSnX+7/0HFr77aJHafdpE\ +AtOiLyJ4zCAVs0obZCCIq4qJdmjYUTU0UXH/w/YzXfQA0d9Zh9AN+NJBX9xj05NzgsT24fkgsK2v6mWJQXT7YcWAsl5sEYPnx1e+MrupNyVSL/RUJmrS+et\ +JSysHtFeWRhsUhVAs1DD5ExJvBLU3WH0IsojEvpXcjrutB5/MDQNrd/StGI6WovoSSPH7FyT9tgERx+q+Yg3YUGzfaIPCctlrRGehcdtzdNoKd0rsX62yCq\ +0U6POoSfwe22NJu41oAUMd7e6R8cCAwEAAaNGMEQwEwYDVR0lBAwwCgYIKwYBBQUHAwIwHQYDVR0OBBYEFDd0VxnS3LnMIfwc7xW4b4IZWG5GMA4GA1UdDw\ +EB/wQEAwIFIDANBgkqhkiG9w0BAQUFAAOCAQEAPQRby2u9celvtvL/DLEb5Vt3/tPStRQC5MyTD62L5RT/q8E6EMCXVZNkXF5WlWucLJi/18tY+9PNgP9xW\ +LJh7kpSWlWdi9KPtwMqKDlEH8L2TnQdjimt9XuiCrTnoFy/1X2BGLY/rCaUJNSd15QCkz2xeW+Z+YSk2GwAc/A/4YfNpqSIMfNuPrT76o02VdD9WmJUA3fS\ +/HY0sU9qgQRS/3F5/0EPS+HYQ0SvXCK9tggcCd4O050ytNBMJC9qMOJ7yE0iOrFfOJSCfDAuPhn/rHFh79Kn1moF+/CE+nc0/2RPiLC8r54/rt5dYyyxJDf\ +Xg0a3VrrX39W69WZGW5OXiw==" --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| +|**--certificate**|string|The base64 encoded certificate raw data.|certificate|certificate| +|**--authentication-type**|choice|The authentication type.|authentication_type|authenticationType| + +### group `az databoxedge diagnostic-setting` +#### Command `az databoxedge diagnostic-setting show-diagnostic-proactive-log-collection-setting` + +##### Example +``` +az databoxedge diagnostic-setting show-diagnostic-proactive-log-collection-setting --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 diagnostic-setting show-diagnostic-remote-support-setting` + +##### Example +``` +az databoxedge diagnostic-setting show-diagnostic-remote-support-setting --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 diagnostic-setting update-diagnostic-proactive-log-collection-setting` + +##### Example +``` +az databoxedge diagnostic-setting update-diagnostic-proactive-log-collection-setting --device-name "testedgedevice" \ +--user-consent "Enabled" --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| +|**--user-consent**|choice|Proactive diagnostic collection consent flag|user_consent|userConsent| + +#### Command `az databoxedge diagnostic-setting update-diagnostic-remote-support-setting` + +##### Example +``` +az databoxedge diagnostic-setting update-diagnostic-remote-support-setting --device-name "testedgedevice" \ +--remote-support-settings-list access-level="ReadWrite" expiration-time-stamp-in-utc="2021-07-07T00:00:00+00:00" \ +remote-application-type="Powershell" --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| +|**--remote-support-settings-list**|array|Remote support settings list according to the RemoteApplicationType|remote_support_settings_list|remoteSupportSettingsList| + +### group `az databoxedge job` +#### Command `az databoxedge job show` + +##### Example +``` +az databoxedge job 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 job name.|name|name| +|**--resource-group-name**|string|The resource group name.|resource_group_name|resourceGroupName| + +### group `az databoxedge monitoring-config` +#### Command `az databoxedge monitoring-config list` + +##### Example +``` +az databoxedge monitoring-config list --device-name "testedgedevice" --resource-group "GroupForEdgeAutomation" \ +--role-name "testrole" +``` +##### Parameters +|Option|Type|Description|Path (SDK)|Swagger name| +|------|----|-----------|----------|------------| +|**--device-name**|string|The device name.|device_name|deviceName| +|**--role-name**|string|The role name.|role_name|roleName| +|**--resource-group-name**|string|The resource group name.|resource_group_name|resourceGroupName| + +#### Command `az databoxedge monitoring-config show` + +##### Example +``` +az databoxedge monitoring-config show --device-name "testedgedevice" --resource-group "GroupForEdgeAutomation" \ +--role-name "testrole" +``` +##### Parameters +|Option|Type|Description|Path (SDK)|Swagger name| +|------|----|-----------|----------|------------| +|**--device-name**|string|The device name.|device_name|deviceName| +|**--role-name**|string|The role name.|role_name|roleName| +|**--resource-group-name**|string|The resource group name.|resource_group_name|resourceGroupName| + +#### Command `az databoxedge monitoring-config create` + +##### Example +``` +az databoxedge monitoring-config create --device-name "testedgedevice" --metric-configurations \ +"[{\\"counterSets\\":[{\\"counters\\":[{\\"name\\":\\"test\\"}]}],\\"mdmAccount\\":\\"test\\",\\"metricNameSpace\\":\\"\ +test\\",\\"resourceId\\":\\"test\\"}]" --resource-group "GroupForEdgeAutomation" --role-name "testrole" +``` +##### Parameters +|Option|Type|Description|Path (SDK)|Swagger name| +|------|----|-----------|----------|------------| +|**--device-name**|string|The device name.|device_name|deviceName| +|**--role-name**|string|The role name.|role_name|roleName| +|**--resource-group-name**|string|The resource group name.|resource_group_name|resourceGroupName| +|**--metric-configurations**|array|The metrics configuration details|metric_configurations|metricConfigurations| + +#### Command `az databoxedge monitoring-config update` + +##### Parameters +|Option|Type|Description|Path (SDK)|Swagger name| +|------|----|-----------|----------|------------| +|**--device-name**|string|The device name.|device_name|deviceName| +|**--role-name**|string|The role name.|role_name|roleName| +|**--resource-group-name**|string|The resource group name.|resource_group_name|resourceGroupName| +|**--metric-configurations**|array|The metrics configuration details|metric_configurations|metricConfigurations| + +#### Command `az databoxedge monitoring-config delete` + +##### Example +``` +az databoxedge monitoring-config delete --device-name "testedgedevice" --resource-group "GroupForEdgeAutomation" \ +--role-name "testrole" +``` +##### Parameters +|Option|Type|Description|Path (SDK)|Swagger name| +|------|----|-----------|----------|------------| +|**--device-name**|string|The device name.|device_name|deviceName| +|**--role-name**|string|The role name.|role_name|roleName| +|**--resource-group-name**|string|The resource group name.|resource_group_name|resourceGroupName| + +### group `az databoxedge node` +#### Command `az databoxedge node list` + +##### Example +``` +az databoxedge node 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| + +### group `az databoxedge operation-status` +#### Command `az databoxedge operation-status show` + +##### Example +``` +az databoxedge operation-status 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 job name.|name|name| +|**--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" --contact-information company-name="Microsoft" \ +contact-person="John Mcclane" email-list="john@microsoft.com" phone="(800) 426-9400" --shipping-address \ +address-line1="Microsoft Corporation" address-line2="One Microsoft Way" address-line3="Redmond" city="WA" \ +country="USA" 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| +|**--contact-information**|object|The contact details.|contact_information|contactInformation| +|**--shipping-address**|object|The shipping address.|shipping_address|shippingAddress| +|**--shipment-type**|choice|ShipmentType of the order|shipment_type|shipmentType| + +#### 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| +|**--contact-information**|object|The contact details.|contact_information|contactInformation| +|**--shipping-address**|object|The shipping address.|shipping_address|shippingAddress| +|**--shipment-type**|choice|ShipmentType of the order|shipment_type|shipmentType| + +#### 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| + +#### Command `az databoxedge order list-dc-access-code` + +##### Example +``` +az databoxedge order list-dc-access-code --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 role` +#### Command `az databoxedge role list` + +##### Example +``` +az databoxedge role 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 role show` + +##### Example +``` +az databoxedge role show --name "IoTRole1" --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 role name.|name|name| +|**--resource-group-name**|string|The resource group name.|resource_group_name|resourceGroupName| + +#### Command `az databoxedge role create` + +##### Example +``` +az databoxedge role create --name "IoTRole1" --device-name "testedgedevice" --resource-group "GroupForEdgeAutomation" \ +--role "{\\"kind\\":\\"IOT\\",\\"properties\\":{\\"hostPlatform\\":\\"Linux\\",\\"ioTDeviceDetails\\":{\\"authenticatio\ +n\\":{\\"symmetricKey\\":{\\"connectionString\\":{\\"encryptionAlgorithm\\":\\"AES256\\",\\"encryptionCertThumbprint\\"\ +:\\"348586569999244\\",\\"value\\":\\"Encrypted<>\\"}}},\\"deviceId\\":\\"iotdevice\\",\\"ioTHostHub\\":\\"iothub.azure-devic\ +es.net\\"},\\"ioTEdgeDeviceDetails\\":{\\"authentication\\":{\\"symmetricKey\\":{\\"connectionString\\":{\\"encryptionA\ +lgorithm\\":\\"AES256\\",\\"encryptionCertThumbprint\\":\\"1245475856069999244\\",\\"value\\":\\"Encrypted<>\\"}}},\\"deviceId\ +\\":\\"iotEdge\\",\\"ioTHostHub\\":\\"iothub.azure-devices.net\\"},\\"roleStatus\\":\\"Enabled\\",\\"shareMappings\\":[\ +]}}" +``` +##### Parameters +|Option|Type|Description|Path (SDK)|Swagger name| +|------|----|-----------|----------|------------| +|**--device-name**|string|The device name.|device_name|deviceName| +|**--name**|string|The role name.|name|name| +|**--resource-group-name**|string|The resource group name.|resource_group_name|resourceGroupName| +|**--role**|object|The role properties.|role|role| + +#### Command `az databoxedge role update` + +##### Parameters +|Option|Type|Description|Path (SDK)|Swagger name| +|------|----|-----------|----------|------------| +|**--device-name**|string|The device name.|device_name|deviceName| +|**--name**|string|The role name.|name|name| +|**--resource-group-name**|string|The resource group name.|resource_group_name|resourceGroupName| +|**--role**|object|The role properties.|role|role| + +#### Command `az databoxedge role delete` + +##### Example +``` +az databoxedge role delete --name "IoTRole1" --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 role name.|name|name| +|**--resource-group-name**|string|The resource group name.|resource_group_name|resourceGroupName| + +### group `az databoxedge share` +#### Command `az databoxedge share list` + +##### Example +``` +az databoxedge share 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 share show` + +##### Example +``` +az databoxedge share show --name "smbshare" --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 share name.|name|name| +|**--resource-group-name**|string|The resource group name.|resource_group_name|resourceGroupName| + +#### Command `az databoxedge share create` + +##### Example +``` +az databoxedge share create --name "smbshare" --device-name "testedgedevice" --resource-group "GroupForEdgeAutomation" \ +--description "" --access-protocol "SMB" --azure-container-info container-name="testContainerSMB" \ +data-format="BlockBlob" storage-account-credential-id="/subscriptions/4385cf00-2d3a-425a-832f-f4285b1c9dce/resourceGrou\ +ps/GroupForEdgeAutomation/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/testedgedevice/storageAccountCredentials/s\ +ac1" --data-policy "Cloud" --monitoring-status "Enabled" --share-status "Online" --user-access-rights \ +access-type="Change" user-id="/subscriptions/4385cf00-2d3a-425a-832f-f4285b1c9dce/resourceGroups/GroupForEdgeAutomation\ +/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/testedgedevice/users/user2" +``` +##### Parameters +|Option|Type|Description|Path (SDK)|Swagger name| +|------|----|-----------|----------|------------| +|**--device-name**|string|The device name.|device_name|deviceName| +|**--name**|string|The share name.|name|name| +|**--resource-group-name**|string|The resource group name.|resource_group_name|resourceGroupName| +|**--share-status**|choice|Current status of the share.|share_status|shareStatus| +|**--monitoring-status**|choice|Current monitoring status of the share.|monitoring_status|monitoringStatus| +|**--access-protocol**|choice|Access protocol to be used by the share.|access_protocol|accessProtocol| +|**--description**|string|Description for the share.|description|description| +|**--azure-container-info**|object|Azure container mapping for the share.|azure_container_info|azureContainerInfo| +|**--user-access-rights**|array|Mapping of users and corresponding access rights on the share (required for SMB protocol).|user_access_rights|userAccessRights| +|**--client-access-rights**|array|List of IP addresses and corresponding access rights on the share(required for NFS protocol).|client_access_rights|clientAccessRights| +|**--refresh-details**|object|Details of the refresh job on this share.|refresh_details|refreshDetails| +|**--data-policy**|choice|Data policy of the share.|data_policy|dataPolicy| + +#### Command `az databoxedge share update` + +##### Parameters +|Option|Type|Description|Path (SDK)|Swagger name| +|------|----|-----------|----------|------------| +|**--device-name**|string|The device name.|device_name|deviceName| +|**--name**|string|The share name.|name|name| +|**--resource-group-name**|string|The resource group name.|resource_group_name|resourceGroupName| +|**--share-status**|choice|Current status of the share.|share_status|shareStatus| +|**--monitoring-status**|choice|Current monitoring status of the share.|monitoring_status|monitoringStatus| +|**--access-protocol**|choice|Access protocol to be used by the share.|access_protocol|accessProtocol| +|**--description**|string|Description for the share.|description|description| +|**--azure-container-info**|object|Azure container mapping for the share.|azure_container_info|azureContainerInfo| +|**--user-access-rights**|array|Mapping of users and corresponding access rights on the share (required for SMB protocol).|user_access_rights|userAccessRights| +|**--client-access-rights**|array|List of IP addresses and corresponding access rights on the share(required for NFS protocol).|client_access_rights|clientAccessRights| +|**--refresh-details**|object|Details of the refresh job on this share.|refresh_details|refreshDetails| +|**--data-policy**|choice|Data policy of the share.|data_policy|dataPolicy| + +#### Command `az databoxedge share delete` + +##### Example +``` +az databoxedge share delete --name "smbshare" --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 share name.|name|name| +|**--resource-group-name**|string|The resource group name.|resource_group_name|resourceGroupName| + +#### Command `az databoxedge share refresh` + +##### Example +``` +az databoxedge share refresh --name "smbshare" --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 share name.|name|name| +|**--resource-group-name**|string|The resource group name.|resource_group_name|resourceGroupName| + +### group `az databoxedge storage-account` +#### Command `az databoxedge storage-account list` + +##### Example +``` +az databoxedge storage-account 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 storage-account show` + +##### Example +``` +az databoxedge storage-account show --device-name "testedgedevice" --resource-group "GroupForEdgeAutomation" --name \ +"blobstorageaccount1" +``` +##### Parameters +|Option|Type|Description|Path (SDK)|Swagger name| +|------|----|-----------|----------|------------| +|**--device-name**|string|The device name.|device_name|deviceName| +|**--storage-account-name**|string|The storage account name.|storage_account_name|storageAccountName| +|**--resource-group-name**|string|The resource group name.|resource_group_name|resourceGroupName| + +#### Command `az databoxedge storage-account delete` + +##### Example +``` +az databoxedge storage-account delete --device-name "testedgedevice" --resource-group "GroupForEdgeAutomation" --name \ +"storageaccount1" +``` +##### Parameters +|Option|Type|Description|Path (SDK)|Swagger name| +|------|----|-----------|----------|------------| +|**--device-name**|string|The device name.|device_name|deviceName| +|**--storage-account-name**|string|The StorageAccount name.|storage_account_name|storageAccountName| +|**--resource-group-name**|string|The resource group name.|resource_group_name|resourceGroupName| + +### group `az databoxedge storage-account-credentials` +#### Command `az databoxedge storage-account-credentials list` + +##### Example +``` +az databoxedge storage-account-credentials 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 storage-account-credentials show` + +##### Example +``` +az databoxedge storage-account-credentials show --name "sac1" --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 storage account credential name.|name|name| +|**--resource-group-name**|string|The resource group name.|resource_group_name|resourceGroupName| + +#### Command `az databoxedge storage-account-credentials delete` + +##### Example +``` +az databoxedge storage-account-credentials delete --name "sac1" --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 storage account credential name.|name|name| +|**--resource-group-name**|string|The resource group name.|resource_group_name|resourceGroupName| + +### group `az databoxedge support-package` +#### Command `az databoxedge support-package trigger-support-package` + +##### Example +``` +az databoxedge support-package trigger-support-package --device-name "testedgedevice" --resource-group \ +"GroupForEdgeAutomation" --include "DefaultWithDumps" --maximum-time-stamp "2018-12-18T02:19:51.4270267Z" \ +--minimum-time-stamp "2018-12-18T02:18:51.4270267Z" +``` +##### 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| +|**--minimum-time-stamp**|date-time|MinimumTimeStamp from where logs need to be collected|minimum_time_stamp|minimumTimeStamp| +|**--maximum-time-stamp**|date-time|MaximumTimeStamp until where logs need to be collected|maximum_time_stamp|maximumTimeStamp| +|**--include**|string|Type of files, which need to be included in the logs This will contain the type of logs (Default/DefaultWithDumps/None/All/DefaultWithArchived) or a comma separated list of log types that are required|include|include| + +### group `az databoxedge trigger` +#### Command `az databoxedge trigger list` + +##### Example +``` +az databoxedge trigger 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| +|**--filter**|string|Specify $filter='CustomContextTag eq ' to filter on custom context tag property|filter|$filter| + +#### Command `az databoxedge trigger show` + +##### Example +``` +az databoxedge trigger show --name "trigger1" --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 trigger name.|name|name| +|**--resource-group-name**|string|The resource group name.|resource_group_name|resourceGroupName| + +#### Command `az databoxedge trigger create` + +##### Example +``` +az databoxedge trigger create --name "trigger1" --device-name "testedgedevice" --resource-group \ +"GroupForEdgeAutomation" --file-event-trigger custom-context-tag="CustomContextTags-1235346475" \ +role-id="/subscriptions/4385cf00-2d3a-425a-832f-f4285b1c9dce/resourceGroups/GroupForEdgeAutomation/providers/Microsoft.\ +DataBoxEdge/dataBoxEdgeDevices/testedgedevice/roles/role1" share-id="/subscriptions/4385cf00-2d3a-425a-832f-f4285b1c9dc\ +e/resourceGroups/GroupForEdgeAutomation/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/testedgedevice/shares/share1\ +" +``` +##### Parameters +|Option|Type|Description|Path (SDK)|Swagger name| +|------|----|-----------|----------|------------| +|**--device-name**|string|Creates or updates a trigger|device_name|deviceName| +|**--name**|string|The trigger name.|name|name| +|**--resource-group-name**|string|The resource group name.|resource_group_name|resourceGroupName| +|**--file-event-trigger**|object|Trigger details.|file_event_trigger|FileEventTrigger| +|**--periodic-timer-event-trigger**|object|Trigger details.|periodic_timer_event_trigger|PeriodicTimerEventTrigger| + +#### Command `az databoxedge trigger update` + +##### Parameters +|Option|Type|Description|Path (SDK)|Swagger name| +|------|----|-----------|----------|------------| +|**--device-name**|string|Creates or updates a trigger|device_name|deviceName| +|**--name**|string|The trigger name.|name|name| +|**--resource-group-name**|string|The resource group name.|resource_group_name|resourceGroupName| +|**--file-event-trigger**|object|Trigger details.|file_event_trigger|FileEventTrigger| +|**--periodic-timer-event-trigger**|object|Trigger details.|periodic_timer_event_trigger|PeriodicTimerEventTrigger| + +#### Command `az databoxedge trigger delete` + +##### Example +``` +az databoxedge trigger delete --name "trigger1" --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 trigger name.|name|name| +|**--resource-group-name**|string|The resource group name.|resource_group_name|resourceGroupName| + +### group `az databoxedge user` +#### Command `az databoxedge user list` + +##### Example +``` +az databoxedge user 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| +|**--filter**|string|Specify $filter='Type eq ' to filter on user type property|filter|$filter| + +#### Command `az databoxedge user show` + +##### Example +``` +az databoxedge user show --name "user1" --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 user name.|name|name| +|**--resource-group-name**|string|The resource group name.|resource_group_name|resourceGroupName| + +#### Command `az databoxedge user create` + +##### Example +``` +az databoxedge user create --name "user1" --device-name "testedgedevice" --resource-group "GroupForEdgeAutomation" \ +--encrypted-password encryption-algorithm="None" encryption-cert-thumbprint="blah" value="" --user-type "Share" +``` +##### Parameters +|Option|Type|Description|Path (SDK)|Swagger name| +|------|----|-----------|----------|------------| +|**--device-name**|string|The device name.|device_name|deviceName| +|**--name**|string|The user name.|name|name| +|**--resource-group-name**|string|The resource group name.|resource_group_name|resourceGroupName| +|**--user-type**|choice|Type of the user.|user_type|userType| +|**--encrypted-password**|object|The password details.|encrypted_password|encryptedPassword| + +#### Command `az databoxedge user update` + +##### Parameters +|Option|Type|Description|Path (SDK)|Swagger name| +|------|----|-----------|----------|------------| +|**--device-name**|string|The device name.|device_name|deviceName| +|**--name**|string|The user name.|name|name| +|**--resource-group-name**|string|The resource group name.|resource_group_name|resourceGroupName| +|**--user-type**|choice|Type of the user.|user_type|userType| +|**--encrypted-password**|object|The password details.|encrypted_password|encryptedPassword| + +#### Command `az databoxedge user delete` + +##### Example +``` +az databoxedge user delete --name "user1" --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 user name.|name|name| +|**--resource-group-name**|string|The resource group name.|resource_group_name|resourceGroupName| diff --git a/src/databoxedge/setup.cfg b/src/databoxedge/setup.cfg new file mode 100644 index 00000000000..2fdd96e5d39 --- /dev/null +++ b/src/databoxedge/setup.cfg @@ -0,0 +1 @@ +#setup.cfg \ No newline at end of file diff --git a/src/databoxedge/setup.py b/src/databoxedge/setup.py new file mode 100644 index 00000000000..fbf0e168735 --- /dev/null +++ b/src/databoxedge/setup.py @@ -0,0 +1,58 @@ +#!/usr/bin/env python + +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# -------------------------------------------------------------------------------------------- + + +from codecs import open +from setuptools import setup, find_packages + +# HISTORY.rst entry. +VERSION = '0.1.0' +try: + from azext_databoxedge.manual.version import VERSION +except ImportError: + pass + +# The full list of classifiers is available at +# https://pypi.python.org/pypi?%3Aaction=list_classifiers +CLASSIFIERS = [ + 'Development Status :: 4 - Beta', + 'Intended Audience :: Developers', + 'Intended Audience :: System Administrators', + 'Programming Language :: Python', + 'Programming Language :: Python :: 3', + 'Programming Language :: Python :: 3.6', + 'Programming Language :: Python :: 3.7', + 'Programming Language :: Python :: 3.8', + 'License :: OSI Approved :: MIT License', +] + +DEPENDENCIES = [] + +try: + from azext_databoxedge.manual.dependency import DEPENDENCIES +except ImportError: + pass + +with open('README.md', 'r', encoding='utf-8') as f: + README = f.read() +with open('HISTORY.rst', 'r', encoding='utf-8') as f: + HISTORY = f.read() + +setup( + name='databoxedge', + version=VERSION, + description='Microsoft Azure Command-Line Tools DataBoxEdgeManagementClient Extension', + author='Microsoft Corporation', + author_email='azpycli@microsoft.com', + url='https://github.com/Azure/azure-cli-extensions/tree/master/src/databoxedge', + long_description=README + '\n\n' + HISTORY, + license='MIT', + classifiers=CLASSIFIERS, + packages=find_packages(), + install_requires=DEPENDENCIES, + package_data={'azext_databoxedge': ['azext_metadata.json']}, +)