From c4cb4736634f44b2d9981fee38809dd47999cd18 Mon Sep 17 00:00:00 2001 From: SDK Automation Date: Thu, 29 Oct 2020 05:55:54 +0000 Subject: [PATCH] Generated from cc28f75ab2ba0ba66287204b34457d1f060c1461 --- src/databoxedge/HISTORY.rst | 8 + src/databoxedge/README.md | 292 ++ 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 | 76 + .../azext_databoxedge/generated/_help.py | 1179 ++++++ .../azext_databoxedge/generated/_params.py | 562 +++ .../generated/_validators.py | 9 + .../azext_databoxedge/generated/action.py | 310 ++ .../azext_databoxedge/generated/commands.py | 202 + .../azext_databoxedge/generated/custom.py | 836 ++++ .../azext_databoxedge/manual/__init__.py | 12 + .../azext_databoxedge/tests/__init__.py | 114 + .../tests/latest/__init__.py | 12 + .../tests/latest/test_databoxedge_scenario.py | 784 ++++ .../vendored_sdks/__init__.py | 12 + .../vendored_sdks/databoxedge/__init__.py | 16 + .../databoxedge/_configuration.py | 70 + .../_data_box_edge_management_client.py | 144 + .../vendored_sdks/databoxedge/aio/__init__.py | 10 + .../databoxedge/aio/_configuration.py | 66 + .../aio/_data_box_edge_management_client.py | 138 + .../databoxedge/aio/operations/__init__.py | 43 + .../aio/operations/_alert_operations.py | 180 + .../_bandwidth_schedule_operations.py | 445 +++ .../aio/operations/_container_operations.py | 582 +++ .../aio/operations/_device_operations.py | 1292 +++++++ .../aio/operations/_job_operations.py | 105 + .../aio/operations/_node_operations.py | 116 + .../aio/operations/_operation_operations.py | 106 + .../_operation_status_operations.py | 105 + .../aio/operations/_order_operations.py | 435 +++ .../aio/operations/_role_operations.py | 428 ++ .../aio/operations/_share_operations.py | 595 +++ .../aio/operations/_sku_operations.py | 115 + ..._storage_account_credentials_operations.py | 468 +++ .../operations/_storage_account_operations.py | 451 +++ .../aio/operations/_trigger_operations.py | 434 +++ .../aio/operations/_user_operations.py | 447 +++ .../databoxedge/models/__init__.py | 317 ++ .../_data_box_edge_management_client_enums.py | 402 ++ .../databoxedge/models/_models.py | 3243 ++++++++++++++++ .../databoxedge/models/_models_py3.py | 3427 +++++++++++++++++ .../databoxedge/operations/__init__.py | 43 + .../operations/_alert_operations.py | 186 + .../_bandwidth_schedule_operations.py | 455 +++ .../operations/_container_operations.py | 594 +++ .../operations/_device_operations.py | 1316 +++++++ .../databoxedge/operations/_job_operations.py | 110 + .../operations/_node_operations.py | 121 + .../operations/_operation_operations.py | 111 + .../_operation_status_operations.py | 110 + .../operations/_order_operations.py | 445 +++ .../operations/_role_operations.py | 438 +++ .../operations/_share_operations.py | 607 +++ .../databoxedge/operations/_sku_operations.py | 120 + ..._storage_account_credentials_operations.py | 478 +++ .../operations/_storage_account_operations.py | 461 +++ .../operations/_trigger_operations.py | 444 +++ .../operations/_user_operations.py | 457 +++ .../vendored_sdks/databoxedge/py.typed | 1 + src/databoxedge/report.md | 1128 ++++++ src/databoxedge/setup.cfg | 1 + src/databoxedge/setup.py | 58 + 67 files changed, 26372 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/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/_alert_operations.py create mode 100644 src/databoxedge/azext_databoxedge/vendored_sdks/databoxedge/aio/operations/_bandwidth_schedule_operations.py create mode 100644 src/databoxedge/azext_databoxedge/vendored_sdks/databoxedge/aio/operations/_container_operations.py create mode 100644 src/databoxedge/azext_databoxedge/vendored_sdks/databoxedge/aio/operations/_device_operations.py create mode 100644 src/databoxedge/azext_databoxedge/vendored_sdks/databoxedge/aio/operations/_job_operations.py create mode 100644 src/databoxedge/azext_databoxedge/vendored_sdks/databoxedge/aio/operations/_node_operations.py create mode 100644 src/databoxedge/azext_databoxedge/vendored_sdks/databoxedge/aio/operations/_operation_operations.py create mode 100644 src/databoxedge/azext_databoxedge/vendored_sdks/databoxedge/aio/operations/_operation_status_operations.py create mode 100644 src/databoxedge/azext_databoxedge/vendored_sdks/databoxedge/aio/operations/_order_operations.py create mode 100644 src/databoxedge/azext_databoxedge/vendored_sdks/databoxedge/aio/operations/_role_operations.py create mode 100644 src/databoxedge/azext_databoxedge/vendored_sdks/databoxedge/aio/operations/_share_operations.py create mode 100644 src/databoxedge/azext_databoxedge/vendored_sdks/databoxedge/aio/operations/_sku_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_account_operations.py create mode 100644 src/databoxedge/azext_databoxedge/vendored_sdks/databoxedge/aio/operations/_trigger_operations.py create mode 100644 src/databoxedge/azext_databoxedge/vendored_sdks/databoxedge/aio/operations/_user_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/_alert_operations.py create mode 100644 src/databoxedge/azext_databoxedge/vendored_sdks/databoxedge/operations/_bandwidth_schedule_operations.py create mode 100644 src/databoxedge/azext_databoxedge/vendored_sdks/databoxedge/operations/_container_operations.py create mode 100644 src/databoxedge/azext_databoxedge/vendored_sdks/databoxedge/operations/_device_operations.py create mode 100644 src/databoxedge/azext_databoxedge/vendored_sdks/databoxedge/operations/_job_operations.py create mode 100644 src/databoxedge/azext_databoxedge/vendored_sdks/databoxedge/operations/_node_operations.py create mode 100644 src/databoxedge/azext_databoxedge/vendored_sdks/databoxedge/operations/_operation_operations.py create mode 100644 src/databoxedge/azext_databoxedge/vendored_sdks/databoxedge/operations/_operation_status_operations.py create mode 100644 src/databoxedge/azext_databoxedge/vendored_sdks/databoxedge/operations/_order_operations.py create mode 100644 src/databoxedge/azext_databoxedge/vendored_sdks/databoxedge/operations/_role_operations.py create mode 100644 src/databoxedge/azext_databoxedge/vendored_sdks/databoxedge/operations/_share_operations.py create mode 100644 src/databoxedge/azext_databoxedge/vendored_sdks/databoxedge/operations/_sku_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_account_operations.py create mode 100644 src/databoxedge/azext_databoxedge/vendored_sdks/databoxedge/operations/_trigger_operations.py create mode 100644 src/databoxedge/azext_databoxedge/vendored_sdks/databoxedge/operations/_user_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..1349aee0dc5 --- /dev/null +++ b/src/databoxedge/README.md @@ -0,0 +1,292 @@ +# 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 device #### +##### Create ##### +``` +az databoxedge device create --location "eastus" --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" --tags Key1="value1" Key2="value2" \ + --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="7DCBDFC44ED968D232C9A998FC105B5C70E84BE0" value="jJ5MvXa/AEWvwxviS92uCjatCXeyLYTy8jx/k105MjQRXT7i6Do8qpEcQ8d+OBbwmQTnwKW0CYyzzVRCc0uZcPCf6PsWtP4l6wvcKGAP66PwK68eEkTUOmp+wUHc4hk02kWmTWeAjBZkuDBP3xK1RnZo95g2RE4i1UgKNP5BEKCLd71O104DW3AWW41mh9XLWNOaxw+VjQY7wmvlE6XkvpkMhcGuha2u7lx8zi9ZkcMvJVYDYK36Fb/K3KhBAmDjjDmVq04jtBlcSTXQObt0nlj4BwGGtdrpeIpr67zqr5i3cPm6e6AleIaIhp6sI/uyGSMiT3oev2eg49u2ii7kVA==" +``` +##### Download-update ##### +``` +az databoxedge device download-update --name "testedgedevice" --resource-group "GroupForEdgeAutomation" +``` +##### Get-extended-information ##### +``` +az databoxedge device get-extended-information --name "testedgedevice" --resource-group "GroupForEdgeAutomation" +``` +##### Get-network-setting ##### +``` +az databoxedge device get-network-setting --name "testedgedevice" --resource-group "GroupForEdgeAutomation" +``` +##### Get-update-summary ##### +``` +az databoxedge device get-update-summary --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" +``` +##### 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" \ + --days "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 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" +``` +##### 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 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 #### +##### Create ##### +``` +az databoxedge storage-account-credentials create --name "sac1" --device-name "testedgedevice" \ + --resource-group "GroupForEdgeAutomation" \ + --account-key encryption-algorithm="AES256" encryption-cert-thumbprint="2A9D8D6BE51574B5461230AEF02F162C5F01AD31" value="lAeZEYi6rNP1/EyNaVUYmTSZEYyaIaWmwUsGwek0+xiZj54GM9Ue9/UA2ed/ClC03wuSit2XzM/cLRU5eYiFBwks23rGwiQOr3sruEL2a74EjPD050xYjA6M1I2hu/w2yjVHhn5j+DbXS4Xzi+rHHNZK3DgfDO3PkbECjPck+PbpSBjy9+6Mrjcld5DIZhUAeMlMHrFlg+WKRKB14o/og56u5/xX6WKlrMLEQ+y6E18dUwvWs2elTNoVO8PBE8SM/CfooX4AMNvaNdSObNBPdP+F6Lzc556nFNWXrBLRt0vC7s9qTiVRO4x/qCNaK/B4y7IqXMllwQFf4Np9UQ2ECA==" \ + --account-type "BlobStorage" --alias "sac1" --ssl-status "Disabled" --user-name "cisbvt" +``` +##### Show ##### +``` +az databoxedge storage-account-credentials show --name "sac1" --device-name "testedgedevice" \ + --resource-group "GroupForEdgeAutomation" +``` +##### List ##### +``` +az databoxedge storage-account-credentials list --device-name "testedgedevice" \ + --resource-group "GroupForEdgeAutomation" +``` +##### Delete ##### +``` +az databoxedge storage-account-credentials delete --name "sac1" --device-name "testedgedevice" \ + --resource-group "GroupForEdgeAutomation" +``` +#### databoxedge storage-account #### +##### Create ##### +``` +az databoxedge storage-account create --device-name "testedgedevice" --resource-group "GroupForEdgeAutomation" \ + --description "It\'s an awesome storage account" --data-policy "Cloud" \ + --storage-account-credential-id "/subscriptions/4385cf00-2d3a-425a-832f-f4285b1c9dce/resourceGroups/GroupForDataBoxEdgeAutomation/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/testedgedevice/storageAccountCredentials/cisbvt" \ + --storage-account-status "OK" --name "blobstorageaccount1" +``` +##### Show ##### +``` +az databoxedge storage-account show --device-name "testedgedevice" --resource-group "GroupForEdgeAutomation" \ + --name "blobstorageaccount1" +``` +##### List ##### +``` +az databoxedge storage-account list --device-name "testedgedevice" --resource-group "GroupForEdgeAutomation" +``` +##### 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" +``` +##### 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 user #### +##### Create ##### +``` +az databoxedge user create --name "user1" --device-name "testedgedevice" --resource-group "GroupForEdgeAutomation" \ + --encrypted-password encryption-algorithm="None" encryption-cert-thumbprint="blah" value="Password@1" \ + --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" +``` +#### databoxedge sku #### +##### List ##### +``` +az databoxedge sku list +``` \ 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..4f48fa652a5 --- /dev/null +++ b/src/databoxedge/azext_databoxedge/azext_metadata.json @@ -0,0 +1,4 @@ +{ + "azext.isExperimental": true, + "azext.minCliCoreVersion": "2.11.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..377ee7867c9 --- /dev/null +++ b/src/databoxedge/azext_databoxedge/generated/_client_factory.py @@ -0,0 +1,76 @@ +# -------------------------------------------------------------------------- +# 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 ..vendored_sdks.databoxedge import DataBoxEdgeManagementClient + return get_mgmt_service_client(cli_ctx, + DataBoxEdgeManagementClient) + + +def cf_device(cli_ctx, *_): + return cf_databoxedge_cl(cli_ctx).device + + +def cf_alert(cli_ctx, *_): + return cf_databoxedge_cl(cli_ctx).alert + + +def cf_bandwidth_schedule(cli_ctx, *_): + return cf_databoxedge_cl(cli_ctx).bandwidth_schedule + + +def cf_job(cli_ctx, *_): + return cf_databoxedge_cl(cli_ctx).job + + +def cf_node(cli_ctx, *_): + return cf_databoxedge_cl(cli_ctx).node + + +def cf_operation_status(cli_ctx, *_): + return cf_databoxedge_cl(cli_ctx).operation_status + + +def cf_order(cli_ctx, *_): + return cf_databoxedge_cl(cli_ctx).order + + +def cf_role(cli_ctx, *_): + return cf_databoxedge_cl(cli_ctx).role + + +def cf_share(cli_ctx, *_): + return cf_databoxedge_cl(cli_ctx).share + + +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_account + + +def cf_container(cli_ctx, *_): + return cf_databoxedge_cl(cli_ctx).container + + +def cf_trigger(cli_ctx, *_): + return cf_databoxedge_cl(cli_ctx).trigger + + +def cf_user(cli_ctx, *_): + return cf_databoxedge_cl(cli_ctx).user + + +def cf_sku(cli_ctx, *_): + return cf_databoxedge_cl(cli_ctx).sku diff --git a/src/databoxedge/azext_databoxedge/generated/_help.py b/src/databoxedge/azext_databoxedge/generated/_help.py new file mode 100644 index 00000000000..0e317aba7db --- /dev/null +++ b/src/databoxedge/azext_databoxedge/generated/_help.py @@ -0,0 +1,1179 @@ +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- +# pylint: disable=too-many-lines + +from knack.help_files import helps + + +helps['databoxedge device'] = """ + type: group + short-summary: databoxedge device +""" + +helps['databoxedge device list'] = """ + type: command + short-summary: "Gets all the Data Box Edge/Data Box Gateway devices in a resource group. And Gets all the Data Box \ +Edge/Data Box Gateway devices in a subscription." + examples: + - name: DataBoxEdgeDeviceGetByResourceGroup + text: |- + az databoxedge device list --resource-group "GroupForEdgeAutomation" + - name: DataBoxEdgeDeviceGetBySubscription + text: |- + az databoxedge device list +""" + +helps['databoxedge device show'] = """ + type: command + short-summary: "Gets the properties of the Data Box Edge/Data Box Gateway device." + examples: + - name: DataBoxEdgeDeviceGetByName + text: |- + az databoxedge device show --name "testedgedevice" --resource-group "GroupForEdgeAutomation" +""" + +helps['databoxedge device create'] = """ + type: command + short-summary: "Create a Data Box Edge/Data Box Gateway resource." + parameters: + - name: --sku + short-summary: "The SKU type." + long-summary: | + Usage: --sku name=XX tier=XX + + name: SKU name. + tier: The SKU tier. This is based on the SKU name. + examples: + - name: DataBoxEdgeDevicePut + text: |- + az databoxedge device create --location "eastus" --sku name="Edge" tier="Standard" --name \ +"testedgedevice" --resource-group "GroupForEdgeAutomation" +""" + +helps['databoxedge device update'] = """ + type: command + short-summary: "Modifies a Data Box Edge/Data Box Gateway resource." + examples: + - name: DataBoxEdgeDevicePatch + text: |- + az databoxedge device update --name "testedgedevice" --tags Key1="value1" Key2="value2" \ +--resource-group "GroupForEdgeAutomation" +""" + +helps['databoxedge device delete'] = """ + type: command + short-summary: "Deletes the Data Box Edge/Data Box Gateway device." + examples: + - name: DataBoxEdgeDeviceDelete + text: |- + az databoxedge device delete --name "testedgedevice" --resource-group "GroupForEdgeAutomation" +""" + +helps['databoxedge device 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="7DCBDFC44ED968D232C9A998FC1\ +05B5C70E84BE0" value="jJ5MvXa/AEWvwxviS92uCjatCXeyLYTy8jx/k105MjQRXT7i6Do8qpEcQ8d+OBbwmQTnwKW0CYyzzVRCc0uZcPCf6PsWtP4l6\ +wvcKGAP66PwK68eEkTUOmp+wUHc4hk02kWmTWeAjBZkuDBP3xK1RnZo95g2RE4i1UgKNP5BEKCLd71O104DW3AWW41mh9XLWNOaxw+VjQY7wmvlE6XkvpkM\ +hcGuha2u7lx8zi9ZkcMvJVYDYK36Fb/K3KhBAmDjjDmVq04jtBlcSTXQObt0nlj4BwGGtdrpeIpr67zqr5i3cPm6e6AleIaIhp6sI/uyGSMiT3oev2eg49u\ +2ii7kVA==" +""" + +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 get-extended-information'] = """ + type: command + short-summary: "Gets additional information for the specified Data Box Edge/Data Box Gateway device." + examples: + - name: ExtendedInfoPost + text: |- + az databoxedge device get-extended-information --name "testedgedevice" --resource-group \ +"GroupForEdgeAutomation" +""" + +helps['databoxedge device get-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 get-network-setting --name "testedgedevice" --resource-group \ +"GroupForEdgeAutomation" +""" + +helps['databoxedge device get-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 get-update-summary --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 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 created. + text: |- + az databoxedge device wait --name "testedgedevice" --resource-group "GroupForEdgeAutomation" --created + - name: Pause executing next line of CLI script until the databoxedge device is successfully deleted. + text: |- + az databoxedge device wait --name "testedgedevice" --resource-group "GroupForEdgeAutomation" --deleted +""" + +helps['databoxedge alert'] = """ + type: group + short-summary: databoxedge alert +""" + +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: databoxedge bandwidth-schedule +""" + +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" --days "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 job'] = """ + type: group + short-summary: databoxedge job +""" + +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: databoxedge node +""" + +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: databoxedge operation-status +""" + +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: databoxedge order +""" + +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: Required. The address line1. + address-line2: The address line2. + address-line3: The address line3. + postal-code: Required. The postal code. + city: Required. The city name. + state: Required. 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: Required. The address line1. + address-line2: The address line2. + address-line3: The address line3. + postal-code: Required. The postal code. + city: Required. The city name. + state: Required. 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 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: databoxedge role +""" + +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 share'] = """ + type: group + short-summary: databoxedge share +""" + +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: databoxedge storage-account-credentials +""" + +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 create'] = """ + type: command + short-summary: "Create the storage account credential." + parameters: + - name: --account-key + short-summary: "Encrypted storage key." + long-summary: | + Usage: --account-key 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: SACPut + text: |- + az databoxedge storage-account-credentials create --name "sac1" --device-name "testedgedevice" \ +--resource-group "GroupForEdgeAutomation" --account-key encryption-algorithm="AES256" encryption-cert-thumbprint="2A9D8\ +D6BE51574B5461230AEF02F162C5F01AD31" value="lAeZEYi6rNP1/EyNaVUYmTSZEYyaIaWmwUsGwek0+xiZj54GM9Ue9/UA2ed/ClC03wuSit2XzM/\ +cLRU5eYiFBwks23rGwiQOr3sruEL2a74EjPD050xYjA6M1I2hu/w2yjVHhn5j+DbXS4Xzi+rHHNZK3DgfDO3PkbECjPck+PbpSBjy9+6Mrjcld5DIZhUAeM\ +lMHrFlg+WKRKB14o/og56u5/xX6WKlrMLEQ+y6E18dUwvWs2elTNoVO8PBE8SM/CfooX4AMNvaNdSObNBPdP+F6Lzc556nFNWXrBLRt0vC7s9qTiVRO4x/q\ +CNaK/B4y7IqXMllwQFf4Np9UQ2ECA==" --account-type "BlobStorage" --alias "sac1" --ssl-status "Disabled" --user-name \ +"cisbvt" +""" + +helps['databoxedge storage-account-credentials update'] = """ + type: command + short-summary: "Update the storage account credential." + parameters: + - name: --account-key + short-summary: "Encrypted storage key." + long-summary: | + Usage: --account-key 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 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 created. + text: |- + az databoxedge storage-account-credentials wait --name "sac1" --device-name "testedgedevice" \ +--resource-group "GroupForEdgeAutomation" --created + - name: Pause executing next line of CLI script until the databoxedge storage-account-credentials is \ +successfully updated. + text: |- + az databoxedge storage-account-credentials wait --name "sac1" --device-name "testedgedevice" \ +--resource-group "GroupForEdgeAutomation" --updated + - 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: databoxedge storage-account +""" + +helps['databoxedge storage-account list'] = """ + type: command + short-summary: "Lists all the storage accounts 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 create'] = """ + type: command + short-summary: "Creates a new StorageAccount or updates an existing StorageAccount on the device." + examples: + - name: StorageAccountPut + text: |- + az databoxedge storage-account create --device-name "testedgedevice" --resource-group \ +"GroupForEdgeAutomation" --description "It\'s an awesome storage account" --data-policy "Cloud" \ +--storage-account-credential-id "/subscriptions/4385cf00-2d3a-425a-832f-f4285b1c9dce/resourceGroups/GroupForDataBoxEdge\ +Automation/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/testedgedevice/storageAccountCredentials/cisbvt" \ +--storage-account-status "OK" --name "blobstorageaccount1" +""" + +helps['databoxedge storage-account update'] = """ + type: command + short-summary: "Update a new StorageAccount or updates an existing StorageAccount on the device." +""" + +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 created. + text: |- + az databoxedge storage-account wait --device-name "testedgedevice" --resource-group \ +"GroupForEdgeAutomation" --name "blobstorageaccount1" --created + - name: Pause executing next line of CLI script until the databoxedge storage-account is successfully updated. + text: |- + az databoxedge storage-account wait --device-name "testedgedevice" --resource-group \ +"GroupForEdgeAutomation" --name "blobstorageaccount1" --updated + - 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: databoxedge container +""" + +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: databoxedge trigger +""" + +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" +""" + +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 user'] = """ + type: group + short-summary: databoxedge user +""" + +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". + - name: --share-access-rights + short-summary: "List of shares that the user has rights on. This field should not be specified during user \ +creation." + long-summary: | + Usage: --share-access-rights share-id=XX access-type=XX + + share-id: Required. The share ID. + access-type: Required. Type of access to be allowed on the share for this user. + + Multiple actions can be specified by using more than one --share-access-rights argument. + 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="Password@1" --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". + - name: --share-access-rights + short-summary: "List of shares that the user has rights on. This field should not be specified during user \ +creation." + long-summary: | + Usage: --share-access-rights share-id=XX access-type=XX + + share-id: Required. The share ID. + access-type: Required. Type of access to be allowed on the share for this user. + + Multiple actions can be specified by using more than one --share-access-rights argument. +""" + +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 +""" + +helps['databoxedge sku'] = """ + type: group + short-summary: databoxedge sku +""" + +helps['databoxedge sku list'] = """ + type: command + short-summary: "List all the available Skus in the region and information related to them." + examples: + - name: ListSkus + text: |- + az databoxedge sku list +""" diff --git a/src/databoxedge/azext_databoxedge/generated/_params.py b/src/databoxedge/azext_databoxedge/generated/_params.py new file mode 100644 index 00000000000..df3c15981b7 --- /dev/null +++ b/src/databoxedge/azext_databoxedge/generated/_params.py @@ -0,0 +1,562 @@ +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- +# pylint: disable=too-many-lines +# pylint: disable=too-many-statements + +from azure.cli.core.commands.parameters import ( + tags_type, + get_enum_type, + resource_group_name_type, + get_location_type +) +from azure.cli.core.commands.validators import ( + get_default_location_from_resource_group, + validate_file_or_dict +) +from azext_databoxedge.action import ( + AddSku, + AddDeviceAdminPassword, + AddContactInformation, + AddShippingAddress, + AddAzureContainerInfo, + AddUserAccessRights, + AddClientAccessRights, + AddRefreshDetails, + AddFileEventTrigger, + AddPeriodicTimerEventTrigger, + AddShareAccessRights +) + + +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=:code:`` 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), + validator=get_default_location_from_resource_group) + c.argument('tags', tags_type) + c.argument('sku', action=AddSku, nargs='*', help='The SKU type.') + c.argument('etag', type=str, help='The etag for the devices.') + c.argument('data_box_edge_device_status', arg_type=get_enum_type(['ReadyToSetup', 'Online', 'Offline', '' + 'NeedsAttention', 'Disconnected', '' + 'PartiallyDisconnected', 'Maintenance']), + help='The status of the Data Box Edge/Gateway device.') + c.argument('description', type=str, help='The Description of the Data Box Edge/Gateway device.') + c.argument('model_description', type=str, help='The description of the Data Box Edge/Gateway device model.') + c.argument('friendly_name', type=str, help='The Data Box Edge/Gateway device name.') + + with self.argument_context('databoxedge device update') as c: + c.argument('device_name', options_list=['--name', '-n', '--device-name'], type=str, help='The device name.', + id_part='name') + c.argument('resource_group_name', resource_group_name_type) + c.argument('tags', tags_type) + + with self.argument_context('databoxedge device delete') as c: + c.argument('device_name', options_list=['--name', '-n', '--device-name'], type=str, help='The device name.', + id_part='name') + c.argument('resource_group_name', resource_group_name_type) + + with self.argument_context('databoxedge device 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 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 get-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 get-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 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 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.') + + 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 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('current_status_status', arg_type=get_enum_type(['Untracked', 'AwaitingFulfilment', '' + 'AwaitingPreparation', 'AwaitingShipment', '' + 'Shipped', 'Arriving', 'Delivered', '' + 'ReplacementRequested', 'LostDevice', 'Declined', '' + 'ReturnInitiated', 'AwaitingReturnShipment', '' + 'ShippedBack', 'CollectedAtMicrosoft']), help='' + 'Status of the order as per the allowed status types.') + c.argument('current_status_comments', type=str, help='Comments related to this status change.') + + 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('current_status_status', arg_type=get_enum_type(['Untracked', 'AwaitingFulfilment', '' + 'AwaitingPreparation', 'AwaitingShipment', '' + 'Shipped', 'Arriving', 'Delivered', '' + 'ReplacementRequested', 'LostDevice', 'Declined', '' + 'ReturnInitiated', 'AwaitingReturnShipment', '' + 'ShippedBack', 'CollectedAtMicrosoft']), help='' + 'Status of the order as per the allowed status types.') + c.argument('current_status_comments', type=str, help='Comments related to this status change.') + + 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 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 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.') + + 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 create') as c: + c.argument('device_name', type=str, help='The device name.') + c.argument('name', type=str, help='The storage account credential name.') + c.argument('resource_group_name', resource_group_name_type) + c.argument('alias', type=str, help='Alias for the storage account.') + c.argument('user_name', type=str, help='Username for the storage account.') + c.argument('account_key', action=AddDeviceAdminPassword, nargs='*', help='Encrypted storage key.') + c.argument('connection_string', type=str, help='Connection string for the storage account. Use this string if ' + 'username and account key are not specified.') + c.argument('ssl_status', arg_type=get_enum_type(['Enabled', 'Disabled']), help='Signifies whether SSL needs to ' + 'be enabled or not.') + c.argument('blob_domain_name', type=str, help='Blob end point for private clouds.') + c.argument('account_type', arg_type=get_enum_type(['GeneralPurposeStorage', 'BlobStorage']), help='Type of ' + 'storage accessed on the storage account.') + c.argument('storage_account_id', type=str, help='Id of the storage account.') + + with self.argument_context('databoxedge storage-account-credentials update') 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) + c.argument('alias', type=str, help='Alias for the storage account.') + c.argument('user_name', type=str, help='Username for the storage account.') + c.argument('account_key', action=AddDeviceAdminPassword, nargs='*', help='Encrypted storage key.') + c.argument('connection_string', type=str, help='Connection string for the storage account. Use this string if ' + 'username and account key are not specified.') + c.argument('ssl_status', arg_type=get_enum_type(['Enabled', 'Disabled']), help='Signifies whether SSL needs to ' + 'be enabled or not.') + c.argument('blob_domain_name', type=str, help='Blob end point for private clouds.') + c.argument('account_type', arg_type=get_enum_type(['GeneralPurposeStorage', 'BlobStorage']), help='Type of ' + 'storage accessed on the storage account.') + c.argument('storage_account_id', type=str, help='Id of the storage account.') + + 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 create') as c: + c.argument('device_name', type=str, help='The device name.') + c.argument('storage_account_name', options_list=['--name', '-n', '--storage-account-name'], type=str, help='' + 'The StorageAccount name.') + c.argument('resource_group_name', resource_group_name_type) + c.argument('description', type=str, help='Description for the storage Account.') + c.argument('storage_account_status', arg_type=get_enum_type(['OK', 'Offline', 'Unknown', 'Updating', '' + 'NeedsAttention']), help='Current status of the ' + 'storage account') + c.argument('data_policy', arg_type=get_enum_type(['Cloud', 'Local']), help='Data policy of the storage ' + 'Account.') + c.argument('storage_account_credential_id', type=str, help='Storage Account Credential Id') + + with self.argument_context('databoxedge storage-account update') 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) + c.argument('description', type=str, help='Description for the storage Account.') + c.argument('storage_account_status', arg_type=get_enum_type(['OK', 'Offline', 'Unknown', 'Updating', '' + 'NeedsAttention']), help='Current status of the ' + 'storage account') + c.argument('data_policy', arg_type=get_enum_type(['Cloud', 'Local']), help='Data policy of the storage ' + 'Account.') + c.argument('storage_account_credential_id', type=str, help='Storage Account Credential Id') + + 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') + + 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 ' + ':code:``\' 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 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=\'UserType eq ' + ':code:``\' 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('share_access_rights', action=AddShareAccessRights, nargs='*', help='List of shares that the user ' + 'has rights on. This field should not be specified during user creation.') + 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('share_access_rights', action=AddShareAccessRights, nargs='*', help='List of shares that the user ' + 'has rights on. This field should not be specified during user creation.') + c.argument('user_type', arg_type=get_enum_type(['Share', 'LocalManagement', 'ARM']), help='Type of the 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) + + with self.argument_context('databoxedge sku list') as c: + c.argument('filter_', options_list=['--filter'], type=str, help='Specify $filter=\'location eq ' + ':code:``\' to filter on location.') 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..286c1504978 --- /dev/null +++ b/src/databoxedge/azext_databoxedge/generated/action.py @@ -0,0 +1,310 @@ +# -------------------------------------------------------------------------- +# 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] + 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] + 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 + 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] + 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] + 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] + 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] + 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] + 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] + 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] + d['kind'] = 'PeriodicTimerEvent' + return d + + +class AddShareAccessRights(argparse._AppendAction): + def __call__(self, parser, namespace, values, option_string=None): + action = self.get_action(values, option_string) + super(AddShareAccessRights, 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 == 'share-id': + d['share_id'] = v[0] + elif kl == 'access-type': + d['access_type'] = v[0] + 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..f3b210fa56b --- /dev/null +++ b/src/databoxedge/azext_databoxedge/generated/commands.py @@ -0,0 +1,202 @@ +# -------------------------------------------------------------------------- +# 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_device + databoxedge_device = CliCommandType( + operations_tmpl='azext_databoxedge.vendored_sdks.databoxedge.operations._device_operations#DeviceOperations.{}', + client_factory=cf_device) + with self.command_group('databoxedge device', databoxedge_device, client_factory=cf_device, + is_experimental=True) as g: + g.custom_command('list', 'databoxedge_device_list') + g.custom_show_command('show', 'databoxedge_device_show') + g.custom_command('create', 'databoxedge_device_create', supports_no_wait=True) + g.custom_command('update', 'databoxedge_device_update') + g.custom_command('delete', 'databoxedge_device_delete', supports_no_wait=True, confirmation=True) + g.custom_command('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('get-extended-information', 'databoxedge_device_get_extended_information') + g.custom_command('get-network-setting', 'databoxedge_device_get_network_setting') + g.custom_command('get-update-summary', 'databoxedge_device_get_update_summary') + 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('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._alert_operations#AlertOperations.{}', + client_factory=cf_alert) + with self.command_group('databoxedge alert', databoxedge_alert, client_factory=cf_alert, + is_experimental=True) 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_schedule_operations#Bandwidt' + 'hScheduleOperations.{}', + client_factory=cf_bandwidth_schedule) + with self.command_group('databoxedge bandwidth-schedule', databoxedge_bandwidth_schedule, + client_factory=cf_bandwidth_schedule, is_experimental=True) 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.custom_command('update', '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_job + databoxedge_job = CliCommandType( + operations_tmpl='azext_databoxedge.vendored_sdks.databoxedge.operations._job_operations#JobOperations.{}', + client_factory=cf_job) + with self.command_group('databoxedge job', databoxedge_job, client_factory=cf_job, is_experimental=True) 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._node_operations#NodeOperations.{}', + client_factory=cf_node) + with self.command_group('databoxedge node', databoxedge_node, client_factory=cf_node, is_experimental=True) 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._operation_status_operations#OperationS' + 'tatusOperations.{}', + client_factory=cf_operation_status) + with self.command_group('databoxedge operation-status', databoxedge_operation_status, + client_factory=cf_operation_status, is_experimental=True) 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._order_operations#OrderOperations.{}', + client_factory=cf_order) + with self.command_group('databoxedge order', databoxedge_order, client_factory=cf_order, + is_experimental=True) 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.custom_command('update', 'databoxedge_order_update', supports_no_wait=True) + g.custom_command('delete', 'databoxedge_order_delete', supports_no_wait=True, confirmation=True) + g.custom_wait_command('wait', 'databoxedge_order_show') + + from azext_databoxedge.generated._client_factory import cf_role + databoxedge_role = CliCommandType( + operations_tmpl='azext_databoxedge.vendored_sdks.databoxedge.operations._role_operations#RoleOperations.{}', + client_factory=cf_role) + with self.command_group('databoxedge role', databoxedge_role, client_factory=cf_role, is_experimental=True) 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.generic_update_command('update', setter_arg_name='role', setter_name='begin_create_or_update', + custom_func_name='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_share + databoxedge_share = CliCommandType( + operations_tmpl='azext_databoxedge.vendored_sdks.databoxedge.operations._share_operations#ShareOperations.{}', + client_factory=cf_share) + with self.command_group('databoxedge share', databoxedge_share, client_factory=cf_share, + is_experimental=True) 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.custom_command('update', '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, is_experimental=True) as g: + g.custom_command('list', 'databoxedge_storage_account_credentials_list') + g.custom_show_command('show', 'databoxedge_storage_account_credentials_show') + g.custom_command('create', 'databoxedge_storage_account_credentials_create', supports_no_wait=True) + g.custom_command('update', 'databoxedge_storage_account_credentials_update', supports_no_wait=True) + 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_account_operations#StorageAcco' + 'untOperations.{}', + client_factory=cf_storage_account) + with self.command_group('databoxedge storage-account', databoxedge_storage_account, + client_factory=cf_storage_account, is_experimental=True) as g: + g.custom_command('list', 'databoxedge_storage_account_list') + g.custom_show_command('show', 'databoxedge_storage_account_show') + g.custom_command('create', 'databoxedge_storage_account_create', supports_no_wait=True) + g.custom_command('update', 'databoxedge_storage_account_update', supports_no_wait=True) + 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._container_operations#ContainerOperatio' + 'ns.{}', + client_factory=cf_container) + with self.command_group('databoxedge container', databoxedge_container, client_factory=cf_container, + is_experimental=True) 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.custom_command('update', '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._trigger_operations#TriggerOperations.{' + '}', + client_factory=cf_trigger) + with self.command_group('databoxedge trigger', databoxedge_trigger, client_factory=cf_trigger, + is_experimental=True) 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.generic_update_command('update', setter_arg_name='trigger', setter_name='begin_create_or_update', + custom_func_name='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_user + databoxedge_user = CliCommandType( + operations_tmpl='azext_databoxedge.vendored_sdks.databoxedge.operations._user_operations#UserOperations.{}', + client_factory=cf_user) + with self.command_group('databoxedge user', databoxedge_user, client_factory=cf_user, is_experimental=True) 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.custom_command('update', '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') + + from azext_databoxedge.generated._client_factory import cf_sku + databoxedge_sku = CliCommandType( + operations_tmpl='azext_databoxedge.vendored_sdks.databoxedge.operations._sku_operations#SkuOperations.{}', + client_factory=cf_sku) + with self.command_group('databoxedge sku', databoxedge_sku, client_factory=cf_sku, is_experimental=True) as g: + g.custom_command('list', 'databoxedge_sku_list') diff --git a/src/databoxedge/azext_databoxedge/generated/custom.py b/src/databoxedge/azext_databoxedge/generated/custom.py new file mode 100644 index 00000000000..05bc5044b69 --- /dev/null +++ b/src/databoxedge/azext_databoxedge/generated/custom.py @@ -0,0 +1,836 @@ +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- +# pylint: disable=too-many-lines +# pylint: disable=unused-argument + +from knack.util import CLIError +from azure.cli.core.util import sdk_no_wait + + +def databoxedge_device_list(client, + resource_group_name=None, + expand=None): + if resource_group_name: + return client.list_by_resource_group(resource_group_name=resource_group_name, + expand=expand) + return client.list_by_subscription(expand=expand) + + +def databoxedge_device_show(client, + device_name, + resource_group_name): + return client.get(device_name=device_name, + resource_group_name=resource_group_name) + + +def databoxedge_device_create(client, + device_name, + resource_group_name, + location, + tags=None, + sku=None, + etag=None, + data_box_edge_device_status=None, + description=None, + model_description=None, + friendly_name=None, + no_wait=False): + return sdk_no_wait(no_wait, + client.begin_create_or_update, + device_name=device_name, + resource_group_name=resource_group_name, + location=location, + tags=tags, + sku=sku, + etag=etag, + data_box_edge_device_status=data_box_edge_device_status, + description=description, + model_description=model_description, + friendly_name=friendly_name) + + +def databoxedge_device_update(client, + device_name, + resource_group_name, + tags=None): + return client.update(device_name=device_name, + resource_group_name=resource_group_name, + tags=tags) + + +def databoxedge_device_delete(client, + device_name, + resource_group_name, + no_wait=False): + return sdk_no_wait(no_wait, + client.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): + return sdk_no_wait(no_wait, + client.begin_create_or_update_security_setting, + device_name=device_name, + resource_group_name=resource_group_name, + device_admin_password=device_admin_password) + + +def databoxedge_device_download_update(client, + device_name, + resource_group_name, + no_wait=False): + return sdk_no_wait(no_wait, + client.begin_download_update, + 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_get_network_setting(client, + device_name, + resource_group_name): + return client.get_network_setting(device_name=device_name, + resource_group_name=resource_group_name) + + +def databoxedge_device_get_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_install_update(client, + device_name, + resource_group_name, + no_wait=False): + return sdk_no_wait(no_wait, + client.begin_install_update, + 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_update, + device_name=device_name, + resource_group_name=resource_group_name) + + +def databoxedge_device_upload_certificate(client, + device_name, + resource_group_name, + certificate, + authentication_type=None): + return client.upload_certificate(device_name=device_name, + resource_group_name=resource_group_name, + authentication_type=authentication_type, + certificate=certificate) + + +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): + return sdk_no_wait(no_wait, + client.begin_create_or_update, + device_name=device_name, + name=name, + resource_group_name=resource_group_name, + start=start, + stop=stop, + rate_in_mbps=rate_in_mbps, + days=days) + + +def databoxedge_bandwidth_schedule_update(client, + device_name, + name, + resource_group_name, + start, + stop, + rate_in_mbps, + days, + 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, + start=start, + stop=stop, + rate_in_mbps=rate_in_mbps, + days=days) + + +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_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, + current_status_status=None, + current_status_comments=None, + no_wait=False): + return sdk_no_wait(no_wait, + client.begin_create_or_update, + device_name=device_name, + resource_group_name=resource_group_name, + contact_information=contact_information, + shipping_address=shipping_address, + status=current_status_status, + comments=current_status_comments) + + +def databoxedge_order_update(client, + device_name, + resource_group_name, + contact_information=None, + shipping_address=None, + current_status_status=None, + current_status_comments=None, + no_wait=False): + return sdk_no_wait(no_wait, + client.begin_create_or_update, + device_name=device_name, + resource_group_name=resource_group_name, + contact_information=contact_information, + shipping_address=shipping_address, + status=current_status_status, + comments=current_status_comments) + + +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_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(instance, + device_name, + name, + resource_group_name, + no_wait=False): + return instance + + +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_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): + return sdk_no_wait(no_wait, + client.begin_create_or_update, + device_name=device_name, + name=name, + resource_group_name=resource_group_name, + description=description, + share_status=share_status, + monitoring_status=monitoring_status, + azure_container_info=azure_container_info, + access_protocol=access_protocol, + user_access_rights=user_access_rights, + client_access_rights=client_access_rights, + refresh_details=refresh_details, + data_policy=data_policy) + + +def databoxedge_share_update(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): + return sdk_no_wait(no_wait, + client.begin_create_or_update, + device_name=device_name, + name=name, + resource_group_name=resource_group_name, + description=description, + share_status=share_status, + monitoring_status=monitoring_status, + azure_container_info=azure_container_info, + access_protocol=access_protocol, + user_access_rights=user_access_rights, + client_access_rights=client_access_rights, + refresh_details=refresh_details, + data_policy=data_policy) + + +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_create(client, + device_name, + name, + resource_group_name, + alias, + ssl_status, + account_type, + user_name=None, + account_key=None, + connection_string=None, + blob_domain_name=None, + storage_account_id=None, + 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, + alias=alias, + user_name=user_name, + account_key=account_key, + connection_string=connection_string, + ssl_status=ssl_status, + blob_domain_name=blob_domain_name, + account_type=account_type, + storage_account_id=storage_account_id) + + +def databoxedge_storage_account_credentials_update(client, + device_name, + name, + resource_group_name, + alias, + ssl_status, + account_type, + user_name=None, + account_key=None, + connection_string=None, + blob_domain_name=None, + storage_account_id=None, + 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, + alias=alias, + user_name=user_name, + account_key=account_key, + connection_string=connection_string, + ssl_status=ssl_status, + blob_domain_name=blob_domain_name, + account_type=account_type, + storage_account_id=storage_account_id) + + +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_create(client, + device_name, + storage_account_name, + resource_group_name, + description=None, + storage_account_status=None, + data_policy=None, + storage_account_credential_id=None, + no_wait=False): + return sdk_no_wait(no_wait, + client.begin_create_or_update, + device_name=device_name, + storage_account_name=storage_account_name, + resource_group_name=resource_group_name, + description=description, + storage_account_status=storage_account_status, + data_policy=data_policy, + storage_account_credential_id=storage_account_credential_id) + + +def databoxedge_storage_account_update(client, + device_name, + storage_account_name, + resource_group_name, + description=None, + storage_account_status=None, + data_policy=None, + storage_account_credential_id=None, + no_wait=False): + return sdk_no_wait(no_wait, + client.begin_create_or_update, + device_name=device_name, + storage_account_name=storage_account_name, + resource_group_name=resource_group_name, + description=description, + storage_account_status=storage_account_status, + data_policy=data_policy, + storage_account_credential_id=storage_account_credential_id) + + +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): + 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, + data_format=data_format) + + +def databoxedge_container_update(client, + device_name, + storage_account_name, + container_name, + resource_group_name, + data_format, + no_wait=False): + 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, + data_format=data_format) + + +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(instance, + device_name, + name, + resource_group_name, + file_event_trigger=None, + periodic_timer_event_trigger=None, + no_wait=False): + return instance + + +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_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, + share_access_rights=None, + 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, + encrypted_password=encrypted_password, + share_access_rights=share_access_rights, + user_type=user_type) + + +def databoxedge_user_update(client, + device_name, + name, + resource_group_name, + user_type, + encrypted_password=None, + share_access_rights=None, + 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, + encrypted_password=encrypted_password, + share_access_rights=share_access_rights, + user_type=user_type) + + +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) + + +def databoxedge_sku_list(client, + filter_=None): + return client.list(filter=filter_) 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..50e0627daff --- /dev/null +++ b/src/databoxedge/azext_databoxedge/tests/__init__.py @@ -0,0 +1,114 @@ +# 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) + module_path = __path__[0] + 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) + 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: + 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/test_databoxedge_scenario.py b/src/databoxedge/azext_databoxedge/tests/latest/test_databoxedge_scenario.py new file mode 100644 index 00000000000..5a99ea34b1d --- /dev/null +++ b/src/databoxedge/azext_databoxedge/tests/latest/test_databoxedge_scenario.py @@ -0,0 +1,784 @@ +# -------------------------------------------------------------------------- +# 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 .. import try_manual, raise_if, calc_coverage +from azure.cli.testsdk import ResourceGroupPreparer +from azure.cli.testsdk import StorageAccountPreparer + + +TEST_DIR = os.path.abspath(os.path.join(os.path.abspath(__file__), '..')) + + +# Env setup +@try_manual +def setup(test, rg, rg_3, rg_2): + pass + + +# EXAMPLE: DataBoxEdgeDevicePut +@try_manual +def step_databoxedgedeviceput(test, rg, rg_3, rg_2): + test.cmd('az databoxedge device create ' + '--location "eastus" ' + '--sku name="Edge" tier="Standard" ' + '--name "{myDevice}" ' + '--resource-group "{rg}"', + checks=[ + test.check("location", "eastus", case_sensitive=False), + test.check("sku.name", "Edge", case_sensitive=False), + test.check("sku.tier", "Standard", case_sensitive=False), + test.check("name", "{myDevice}", case_sensitive=False), + ]) + + +# EXAMPLE: UserPut +@try_manual +def step_userput(test, rg, rg_3, rg_2): + test.cmd('az databoxedge user create ' + '--name "user1" ' + '--device-name "{myDevice}" ' + '--resource-group "{rg}" ' + '--encrypted-password encryption-algorithm="None" encryption-cert-thumbprint="blah" value="Password@1" ' + '--user-type "Share"', + checks=[]) + + +# EXAMPLE: RolePut +@try_manual +def step_roleput(test, rg, rg_3, rg_2): + test.cmd('az databoxedge role create ' + '--name "IoTRole1" ' + '--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=[]) + + +# EXAMPLE: SharePut +@try_manual +def step_shareput(test, rg, rg_3, rg_2): + 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=[]) + + +# EXAMPLE: OrderPut +@try_manual +def step_orderput(test, rg, rg_3, rg_2): + 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=[]) + + +# EXAMPLE: TriggerPut +@try_manual +def step_triggerput(test, rg, rg_3, rg_2): + test.cmd('az databoxedge trigger create ' + '--name "trigger1" ' + '--device-name "{myDevice}" ' + '--resource-group "{rg}" ' + '--file-event-trigger custom-context-tag="CustomContextTags-1235346475"', + checks=[]) + + +# EXAMPLE: StorageAccountPut +@try_manual +def step_storageaccountput(test, rg, rg_3, rg_2): + test.cmd('az databoxedge storage-account create ' + '--device-name "{myDevice}" ' + '--resource-group "{rg}" ' + '--description "It\'s an awesome storage account" ' + '--data-policy "Cloud" ' + '--storage-account-credential-id "/subscriptions/{subscription_id}/resourceGroups/{rg_3}/providers/Microso' + 'ft.DataBoxEdge/dataBoxEdgeDevices/{myDevice}/storageAccountCredentials/{myStorageAccountCredentials2}" ' + '--storage-account-status "OK" ' + '--name "{sa}"', + checks=[]) + + +# EXAMPLE: BandwidthSchedulePut +@try_manual +def step_bandwidthscheduleput(test, rg, rg_3, rg_2): + test.cmd('az databoxedge bandwidth-schedule create ' + '--name "bandwidth-1" ' + '--device-name "{myDevice}" ' + '--days "Sunday" ' + '--days "Monday" ' + '--rate-in-mbps 100 ' + '--start "0:0:0" ' + '--stop "13:59:0" ' + '--resource-group "{rg}"', + checks=[]) + + +# EXAMPLE: SACPut +@try_manual +def step_sacput(test, rg, rg_3, rg_2): + test.cmd('az databoxedge storage-account-credentials create ' + '--name "{myStorageAccountCredentials}" ' + '--device-name "{myDevice}" ' + '--resource-group "{rg}" ' + '--account-key encryption-algorithm="AES256" encryption-cert-thumbprint="2A9D8D6BE51574B5461230AEF02F162C5' + 'F01AD31" value="lAeZEYi6rNP1/EyNaVUYmTSZEYyaIaWmwUsGwek0+xiZj54GM9Ue9/UA2ed/ClC03wuSit2XzM/cLRU5eYiFBwks2' + '3rGwiQOr3sruEL2a74EjPD050xYjA6M1I2hu/w2yjVHhn5j+DbXS4Xzi+rHHNZK3DgfDO3PkbECjPck+PbpSBjy9+6Mrjcld5DIZhUAeM' + 'lMHrFlg+WKRKB14o/og56u5/xX6WKlrMLEQ+y6E18dUwvWs2elTNoVO8PBE8SM/CfooX4AMNvaNdSObNBPdP+F6Lzc556nFNWXrBLRt0v' + 'C7s9qTiVRO4x/qCNaK/B4y7IqXMllwQFf4Np9UQ2ECA ' + '--account-type "BlobStorage" ' + '--alias "{myStorageAccountCredentials}" ' + '--ssl-status "Disabled" ' + '--user-name "{myUser2}"', + checks=[]) + + +# EXAMPLE: ContainerPut +@try_manual +def step_containerput(test, rg, rg_3, rg_2): + test.cmd('az databoxedge container create ' + '--data-format "BlockBlob" ' + '--name "{myContainer}" ' + '--device-name "{myDevice}" ' + '--resource-group "{rg}" ' + '--storage-account-name "{sa_2}"', + checks=[ + test.check("dataFormat", "BlockBlob", case_sensitive=False), + ]) + + +# EXAMPLE: ContainerGet +@try_manual +def step_containerget(test, rg, rg_3, rg_2): + test.cmd('az databoxedge container show ' + '--name "{myContainer}" ' + '--device-name "{myDevice}" ' + '--resource-group "{rg}" ' + '--storage-account-name "{sa_2}"', + checks=[ + test.check("dataFormat", "BlockBlob", case_sensitive=False), + test.check("name", "{myContainer}", case_sensitive=False), + ]) + + +# EXAMPLE: SACGet +@try_manual +def step_sacget(test, rg, rg_3, rg_2): + test.cmd('az databoxedge storage-account-credentials show ' + '--name "{myStorageAccountCredentials}" ' + '--device-name "{myDevice}" ' + '--resource-group "{rg}"', + checks=[]) + + +# EXAMPLE: ContainerListAllInDevice +@try_manual +def step_containerlistallindevice(test, rg, rg_3, rg_2): + test.cmd('az databoxedge container list ' + '--device-name "{myDevice}" ' + '--resource-group "{rg}" ' + '--storage-account-name "{sa_2}"', + checks=[ + test.check('length(@)', 1), + ]) + + +# EXAMPLE: BandwidthScheduleGet +@try_manual +def step_bandwidthscheduleget(test, rg, rg_3, rg_2): + test.cmd('az databoxedge bandwidth-schedule show ' + '--name "bandwidth-1" ' + '--device-name "{myDevice}" ' + '--resource-group "{rg}"', + checks=[]) + + +# EXAMPLE: OperationsStatusGet +@try_manual +def step_operationsstatusget(test, rg, rg_3, rg_2): + test.cmd('az databoxedge operation-status show ' + '--name "159a00c7-8543-4343-9435-263ac87df3bb" ' + '--device-name "{myDevice}" ' + '--resource-group "{rg}"', + checks=[]) + + +# EXAMPLE: StorageAccountGet +@try_manual +def step_storageaccountget(test, rg, rg_3, rg_2): + test.cmd('az databoxedge storage-account show ' + '--device-name "{myDevice}" ' + '--resource-group "{rg}" ' + '--name "{sa}"', + checks=[]) + + +# EXAMPLE: NetworkSettingsGet +@try_manual +def step_networksettingsget(test, rg, rg_3, rg_2): + test.cmd('az databoxedge device get-network-setting ' + '--name "{myDevice}" ' + '--resource-group "{rg}"', + checks=[]) + + +# EXAMPLE: UpdateSummaryGet +@try_manual +def step_updatesummaryget(test, rg, rg_3, rg_2): + test.cmd('az databoxedge device get-update-summary ' + '--name "{myDevice}" ' + '--resource-group "{rg}"', + checks=[]) + + +# EXAMPLE: TriggerGet +@try_manual +def step_triggerget(test, rg, rg_3, rg_2): + test.cmd('az databoxedge trigger show ' + '--name "trigger1" ' + '--device-name "{myDevice}" ' + '--resource-group "{rg}"', + checks=[]) + + +# EXAMPLE: SACGetAllInDevice +@try_manual +def step_sacgetallindevice(test, rg, rg_3, rg_2): + test.cmd('az databoxedge storage-account-credentials list ' + '--device-name "{myDevice}" ' + '--resource-group "{rg}"', + checks=[]) + + +# EXAMPLE: AlertGet +@try_manual +def step_alertget(test, rg, rg_3, rg_2): + test.cmd('az databoxedge alert show ' + '--name "159a00c7-8543-4343-9435-263ac87df3bb" ' + '--device-name "{myDevice}" ' + '--resource-group "{rg}"', + checks=[]) + + +# EXAMPLE: ShareGet +@try_manual +def step_shareget(test, rg, rg_3, rg_2): + test.cmd('az databoxedge share show ' + '--name "smbshare" ' + '--device-name "{myDevice}" ' + '--resource-group "{rg}"', + checks=[]) + + +# EXAMPLE: OrderGet +@try_manual +def step_orderget(test, rg, rg_3, rg_2): + test.cmd('az databoxedge order show ' + '--device-name "{myDevice}" ' + '--resource-group "{rg}"', + checks=[]) + + +# EXAMPLE: UserGet +@try_manual +def step_userget(test, rg, rg_3, rg_2): + test.cmd('az databoxedge user show ' + '--name "user1" ' + '--device-name "{myDevice}" ' + '--resource-group "{rg}"', + checks=[]) + + +# EXAMPLE: RoleGet +@try_manual +def step_roleget(test, rg, rg_3, rg_2): + test.cmd('az databoxedge role show ' + '--name "IoTRole1" ' + '--device-name "{myDevice}" ' + '--resource-group "{rg}"', + checks=[]) + + +# EXAMPLE: JobsGet +@try_manual +def step_jobsget(test, rg, rg_3, rg_2): + test.cmd('az databoxedge job show ' + '--name "159a00c7-8543-4343-9435-263ac87df3bb" ' + '--device-name "{myDevice}" ' + '--resource-group "{rg}"', + checks=[]) + + +# EXAMPLE: BandwidthScheduleGetAllInDevice +@try_manual +def step_bandwidthschedulegetallindevice(test, rg, rg_3, rg_2): + test.cmd('az databoxedge bandwidth-schedule list ' + '--device-name "{myDevice}" ' + '--resource-group "{rg}"', + checks=[]) + + +# EXAMPLE: StorageAccountGetAllInDevice +@try_manual +def step_storageaccountgetallindevice(test, rg, rg_3, rg_2): + test.cmd('az databoxedge storage-account list ' + '--device-name "{myDevice}" ' + '--resource-group "{rg}"', + checks=[]) + + +# EXAMPLE: TriggerGetAllInDevice +@try_manual +def step_triggergetallindevice(test, rg, rg_3, rg_2): + test.cmd('az databoxedge trigger list ' + '--device-name "{myDevice}" ' + '--resource-group "{rg}"', + checks=[]) + + +# EXAMPLE: OrderGetAllInDevice +@try_manual +def step_ordergetallindevice(test, rg, rg_3, rg_2): + test.cmd('az databoxedge order list ' + '--device-name "{myDevice}" ' + '--resource-group "{rg}"', + checks=[]) + + +# EXAMPLE: AlertGetAllInDevice +@try_manual +def step_alertgetallindevice(test, rg, rg_3, rg_2): + test.cmd('az databoxedge alert list ' + '--device-name "{myDevice}" ' + '--resource-group "{rg}"', + checks=[]) + + +# EXAMPLE: ShareGetAllInDevice +@try_manual +def step_sharegetallindevice(test, rg, rg_3, rg_2): + test.cmd('az databoxedge share list ' + '--device-name "{myDevice}" ' + '--resource-group "{rg}"', + checks=[]) + + +# EXAMPLE: NodesGetAllInDevice +@try_manual +def step_nodesgetallindevice(test, rg, rg_3, rg_2): + test.cmd('az databoxedge node list ' + '--device-name "{myDevice}" ' + '--resource-group "{rg}"', + checks=[]) + + +# EXAMPLE: RoleGetAllInDevice +@try_manual +def step_rolegetallindevice(test, rg, rg_3, rg_2): + test.cmd('az databoxedge role list ' + '--device-name "{myDevice}" ' + '--resource-group "{rg}"', + checks=[]) + + +# EXAMPLE: UserGetAllInDevice +@try_manual +def step_usergetallindevice(test, rg, rg_3, rg_2): + test.cmd('az databoxedge user list ' + '--device-name "{myDevice}" ' + '--resource-group "{rg}"', + checks=[]) + + +# EXAMPLE: DataBoxEdgeDeviceGetByName +@try_manual +def step_databoxedgedevicegetbyname(test, rg, rg_3, rg_2): + test.cmd('az databoxedge device show ' + '--name "{myDevice}" ' + '--resource-group "{rg}"', + checks=[ + test.check("location", "eastus", case_sensitive=False), + test.check("sku.name", "Edge", case_sensitive=False), + test.check("sku.tier", "Standard", case_sensitive=False), + test.check("name", "{myDevice}", case_sensitive=False), + ]) + + +# EXAMPLE: DataBoxEdgeDeviceGetByResourceGroup +@try_manual +def step_databoxedgedevicegetbyresourcegroup(test, rg, rg_3, rg_2): + test.cmd('az databoxedge device list ' + '--resource-group "{rg}"', + checks=[ + test.check('length(@)', 1), + ]) + + +# EXAMPLE: DataBoxEdgeDeviceGetBySubscription +@try_manual +def step_databoxedgedevicegetbysubscription(test, rg, rg_3, rg_2): + test.cmd('az databoxedge device list ' + '-g ""', + checks=[ + test.check('length(@)', 1), + ]) + + +# EXAMPLE: ListSkus +@try_manual +def step_listskus(test, rg, rg_3, rg_2): + test.cmd('az databoxedge sku list', + checks=[]) + + +# EXAMPLE: ListAvailableSkus +@try_manual +def step_listavailableskus(test, rg, rg_3, rg_2): + # EXAMPLE NOT FOUND! + pass + + +# EXAMPLE: OperationsGet +@try_manual +def step_operationsget(test, rg, rg_3, rg_2): + # EXAMPLE NOT FOUND! + pass + + +# EXAMPLE: ContainerRefresh +@try_manual +def step_containerrefresh(test, rg, rg_3, rg_2): + test.cmd('az databoxedge container refresh ' + '--name "{myContainer}" ' + '--device-name "{myDevice}" ' + '--resource-group "{rg}" ' + '--storage-account-name "{sa_2}"', + checks=[]) + + +# EXAMPLE: CreateOrUpdateSecuritySettings +@try_manual +def step_createorupdatesecuritysettings(test, rg, rg_3, rg_2): + test.cmd('az databoxedge device create-or-update-security-setting ' + '--name "{myDevice}" ' + '--resource-group "{rg_2}" ' + '--device-admin-password encryption-algorithm="AES256" encryption-cert-thumbprint="7DCBDFC44ED968D232C9A99' + '8FC105B5C70E84BE0" value="jJ5MvXa/AEWvwxviS92uCjatCXeyLYTy8jx/k105MjQRXT7i6Do8qpEcQ8d+OBbwmQTnwKW0CYyzzVR' + 'Cc0uZcPCf6PsWtP4l6wvcKGAP66PwK68eEkTUOmp+wUHc4hk02kWmTWeAjBZkuDBP3xK1RnZo95g2RE4i1UgKNP5BEKCLd71O104DW3AW' + 'W41mh9XLWNOaxw+VjQY7wmvlE6XkvpkMhcGuha2u7lx8zi9ZkcMvJVYDYK36Fb/K3KhBAmDjjDmVq04jtBlcSTXQObt0nlj4BwGGtdrpe' + 'Ipr67zqr5i3cPm6e6AleIaIhp6sI/uyGSMiT3oev2eg49u2ii7kVA', + checks=[]) + + +# EXAMPLE: ShareRefreshPost +@try_manual +def step_sharerefreshpost(test, rg, rg_3, rg_2): + test.cmd('az databoxedge share refresh ' + '--name "smbshare" ' + '--device-name "{myDevice}" ' + '--resource-group "{rg}"', + checks=[]) + + +# EXAMPLE: ExtendedInfoPost +@try_manual +def step_extendedinfopost(test, rg, rg_3, rg_2): + test.cmd('az databoxedge device get-extended-information ' + '--name "{myDevice}" ' + '--resource-group "{rg}"', + checks=[]) + + +# EXAMPLE: UploadCertificatePost +@try_manual +def step_uploadcertificatepost(test, rg, rg_3, rg_2): + 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=[]) + + +# EXAMPLE: DownloadUpdatesPost +@try_manual +def step_downloadupdatespost(test, rg, rg_3, rg_2): + test.cmd('az databoxedge device download-update ' + '--name "{myDevice}" ' + '--resource-group "{rg}"', + checks=[]) + + +# EXAMPLE: ScanForUpdatesPost +@try_manual +def step_scanforupdatespost(test, rg, rg_3, rg_2): + test.cmd('az databoxedge device scan-for-update ' + '--name "{myDevice}" ' + '--resource-group "{rg}"', + checks=[]) + + +# EXAMPLE: InstallUpdatesPost +@try_manual +def step_installupdatespost(test, rg, rg_3, rg_2): + test.cmd('az databoxedge device install-update ' + '--name "{myDevice}" ' + '--resource-group "{rg}"', + checks=[]) + + +# EXAMPLE: DataBoxEdgeDevicePatch +@try_manual +def step_databoxedgedevicepatch(test, rg, rg_3, rg_2): + test.cmd('az databoxedge device update ' + '--name "{myDevice}" ' + '--tags Key1="value1" Key2="value2" ' + '--resource-group "{rg}"', + checks=[ + test.check("name", "{myDevice}", case_sensitive=False), + test.check("tags.Key1", "value1", case_sensitive=False), + test.check("tags.Key2", "value2", case_sensitive=False), + ]) + + +# EXAMPLE: ContainerDelete +@try_manual +def step_containerdelete(test, rg, rg_3, rg_2): + test.cmd('az databoxedge container delete -y ' + '--name "{myContainer}" ' + '--device-name "{myDevice}" ' + '--resource-group "{rg}" ' + '--storage-account-name "{sa_2}"', + checks=[]) + + +# EXAMPLE: SACDelete +@try_manual +def step_sacdelete(test, rg, rg_3, rg_2): + test.cmd('az databoxedge storage-account-credentials delete -y ' + '--name "{myStorageAccountCredentials}" ' + '--device-name "{myDevice}" ' + '--resource-group "{rg}"', + checks=[]) + + +# EXAMPLE: BandwidthScheduleDelete +@try_manual +def step_bandwidthscheduledelete(test, rg, rg_3, rg_2): + test.cmd('az databoxedge bandwidth-schedule delete -y ' + '--name "bandwidth-1" ' + '--device-name "{myDevice}" ' + '--resource-group "{rg}"', + checks=[]) + + +# EXAMPLE: StorageAccountDelete +@try_manual +def step_storageaccountdelete(test, rg, rg_3, rg_2): + test.cmd('az databoxedge storage-account delete -y ' + '--device-name "{myDevice}" ' + '--resource-group "{rg}" ' + '--name "{sa_2}"', + checks=[]) + + +# EXAMPLE: TriggerDelete +@try_manual +def step_triggerdelete(test, rg, rg_3, rg_2): + test.cmd('az databoxedge trigger delete -y ' + '--name "trigger1" ' + '--device-name "{myDevice}" ' + '--resource-group "{rg}"', + checks=[]) + + +# EXAMPLE: ShareDelete +@try_manual +def step_sharedelete(test, rg, rg_3, rg_2): + test.cmd('az databoxedge share delete -y ' + '--name "smbshare" ' + '--device-name "{myDevice}" ' + '--resource-group "{rg}"', + checks=[]) + + +# EXAMPLE: OrderDelete +@try_manual +def step_orderdelete(test, rg, rg_3, rg_2): + test.cmd('az databoxedge order delete -y ' + '--device-name "{myDevice}" ' + '--resource-group "{rg}"', + checks=[]) + + +# EXAMPLE: UserDelete +@try_manual +def step_userdelete(test, rg, rg_3, rg_2): + test.cmd('az databoxedge user delete -y ' + '--name "user1" ' + '--device-name "{myDevice}" ' + '--resource-group "{rg}"', + checks=[]) + + +# EXAMPLE: RoleDelete +@try_manual +def step_roledelete(test, rg, rg_3, rg_2): + test.cmd('az databoxedge role delete -y ' + '--name "IoTRole1" ' + '--device-name "{myDevice}" ' + '--resource-group "{rg}"', + checks=[]) + + +# EXAMPLE: DataBoxEdgeDeviceDelete +@try_manual +def step_databoxedgedevicedelete(test, rg, rg_3, rg_2): + test.cmd('az databoxedge device delete -y ' + '--name "{myDevice}" ' + '--resource-group "{rg}"', + checks=[]) + + +# Env cleanup +@try_manual +def cleanup(test, rg, rg_3, rg_2): + pass + + +# Testcase +@try_manual +def call_scenario(test, rg, rg_3, rg_2): + setup(test, rg, rg_3, rg_2) + step_databoxedgedeviceput(test, rg, rg_3, rg_2) + step_userput(test, rg, rg_3, rg_2) + step_roleput(test, rg, rg_3, rg_2) + step_shareput(test, rg, rg_3, rg_2) + step_orderput(test, rg, rg_3, rg_2) + step_triggerput(test, rg, rg_3, rg_2) + step_storageaccountput(test, rg, rg_3, rg_2) + step_bandwidthscheduleput(test, rg, rg_3, rg_2) + step_sacput(test, rg, rg_3, rg_2) + step_containerput(test, rg, rg_3, rg_2) + step_containerget(test, rg, rg_3, rg_2) + step_sacget(test, rg, rg_3, rg_2) + step_containerlistallindevice(test, rg, rg_3, rg_2) + step_bandwidthscheduleget(test, rg, rg_3, rg_2) + step_operationsstatusget(test, rg, rg_3, rg_2) + step_storageaccountget(test, rg, rg_3, rg_2) + step_networksettingsget(test, rg, rg_3, rg_2) + step_updatesummaryget(test, rg, rg_3, rg_2) + step_triggerget(test, rg, rg_3, rg_2) + step_sacgetallindevice(test, rg, rg_3, rg_2) + step_alertget(test, rg, rg_3, rg_2) + step_shareget(test, rg, rg_3, rg_2) + step_orderget(test, rg, rg_3, rg_2) + step_userget(test, rg, rg_3, rg_2) + step_roleget(test, rg, rg_3, rg_2) + step_jobsget(test, rg, rg_3, rg_2) + step_bandwidthschedulegetallindevice(test, rg, rg_3, rg_2) + step_storageaccountgetallindevice(test, rg, rg_3, rg_2) + step_triggergetallindevice(test, rg, rg_3, rg_2) + step_ordergetallindevice(test, rg, rg_3, rg_2) + step_alertgetallindevice(test, rg, rg_3, rg_2) + step_sharegetallindevice(test, rg, rg_3, rg_2) + step_nodesgetallindevice(test, rg, rg_3, rg_2) + step_rolegetallindevice(test, rg, rg_3, rg_2) + step_usergetallindevice(test, rg, rg_3, rg_2) + step_databoxedgedevicegetbyname(test, rg, rg_3, rg_2) + step_databoxedgedevicegetbyresourcegroup(test, rg, rg_3, rg_2) + step_databoxedgedevicegetbysubscription(test, rg, rg_3, rg_2) + step_listskus(test, rg, rg_3, rg_2) + step_listavailableskus(test, rg, rg_3, rg_2) + step_operationsget(test, rg, rg_3, rg_2) + step_containerrefresh(test, rg, rg_3, rg_2) + step_createorupdatesecuritysettings(test, rg, rg_3, rg_2) + step_sharerefreshpost(test, rg, rg_3, rg_2) + step_extendedinfopost(test, rg, rg_3, rg_2) + step_uploadcertificatepost(test, rg, rg_3, rg_2) + step_downloadupdatespost(test, rg, rg_3, rg_2) + step_scanforupdatespost(test, rg, rg_3, rg_2) + step_installupdatespost(test, rg, rg_3, rg_2) + step_databoxedgedevicepatch(test, rg, rg_3, rg_2) + step_containerdelete(test, rg, rg_3, rg_2) + step_sacdelete(test, rg, rg_3, rg_2) + step_bandwidthscheduledelete(test, rg, rg_3, rg_2) + step_storageaccountdelete(test, rg, rg_3, rg_2) + step_triggerdelete(test, rg, rg_3, rg_2) + step_sharedelete(test, rg, rg_3, rg_2) + step_orderdelete(test, rg, rg_3, rg_2) + step_userdelete(test, rg, rg_3, rg_2) + step_roledelete(test, rg, rg_3, rg_2) + step_databoxedgedevicedelete(test, rg, rg_3, rg_2) + cleanup(test, rg, rg_3, rg_2) + + +@try_manual +class DataBoxEdgeManagementClientScenarioTest(ScenarioTest): + + @ResourceGroupPreparer(name_prefix='clitestdataboxedge_GroupForEdgeAutomation'[:7], key='rg', parameter_name='rg') + @ResourceGroupPreparer(name_prefix='clitestdataboxedge_GroupForDataBoxEdgeAutomation'[:7], key='rg_3', + parameter_name='rg_3') + @ResourceGroupPreparer(name_prefix='clitestdataboxedge_AzureVM'[:7], key='rg_2', parameter_name='rg_2') + @StorageAccountPreparer(name_prefix='clitestdataboxedge_blobstorageaccount1'[:7], key='sa', + resource_group_parameter_name='rg') + @StorageAccountPreparer(name_prefix='clitestdataboxedge_storageaccount1'[:7], key='sa_2', + resource_group_parameter_name='rg') + def test_databoxedge(self, rg, rg_3, rg_2): + + self.kwargs.update({ + 'subscription_id': self.get_subscription_id() + }) + + self.kwargs.update({ + 'myDevice': 'testedgedevice', + 'myContainer': 'blobcontainer1', + 'myUser': 'user2', + 'myUser2': 'cisbvt', + 'myStorageAccountCredentials': 'sac1', + 'myStorageAccountCredentials2': 'cisbvt', + }) + + call_scenario(self, rg, rg_3, rg_2) + 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..cfc7fd6db5d --- /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 = "2019-08-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..b8692a07292 --- /dev/null +++ b/src/databoxedge/azext_databoxedge/vendored_sdks/databoxedge/_data_box_edge_management_client.py @@ -0,0 +1,144 @@ +# 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 OperationOperations +from .operations import DeviceOperations +from .operations import AlertOperations +from .operations import BandwidthScheduleOperations +from .operations import JobOperations +from .operations import NodeOperations +from .operations import OperationStatusOperations +from .operations import OrderOperations +from .operations import RoleOperations +from .operations import ShareOperations +from .operations import StorageAccountCredentialsOperations +from .operations import StorageAccountOperations +from .operations import ContainerOperations +from .operations import TriggerOperations +from .operations import UserOperations +from .operations import SkuOperations +from . import models + + +class DataBoxEdgeManagementClient(object): + """DataBoxEdgeManagementClient. + + :ivar operation: OperationOperations operations + :vartype operation: data_box_edge_management_client.operations.OperationOperations + :ivar device: DeviceOperations operations + :vartype device: data_box_edge_management_client.operations.DeviceOperations + :ivar alert: AlertOperations operations + :vartype alert: data_box_edge_management_client.operations.AlertOperations + :ivar bandwidth_schedule: BandwidthScheduleOperations operations + :vartype bandwidth_schedule: data_box_edge_management_client.operations.BandwidthScheduleOperations + :ivar job: JobOperations operations + :vartype job: data_box_edge_management_client.operations.JobOperations + :ivar node: NodeOperations operations + :vartype node: data_box_edge_management_client.operations.NodeOperations + :ivar operation_status: OperationStatusOperations operations + :vartype operation_status: data_box_edge_management_client.operations.OperationStatusOperations + :ivar order: OrderOperations operations + :vartype order: data_box_edge_management_client.operations.OrderOperations + :ivar role: RoleOperations operations + :vartype role: data_box_edge_management_client.operations.RoleOperations + :ivar share: ShareOperations operations + :vartype share: data_box_edge_management_client.operations.ShareOperations + :ivar storage_account_credentials: StorageAccountCredentialsOperations operations + :vartype storage_account_credentials: data_box_edge_management_client.operations.StorageAccountCredentialsOperations + :ivar storage_account: StorageAccountOperations operations + :vartype storage_account: data_box_edge_management_client.operations.StorageAccountOperations + :ivar container: ContainerOperations operations + :vartype container: data_box_edge_management_client.operations.ContainerOperations + :ivar trigger: TriggerOperations operations + :vartype trigger: data_box_edge_management_client.operations.TriggerOperations + :ivar user: UserOperations operations + :vartype user: data_box_edge_management_client.operations.UserOperations + :ivar sku: SkuOperations operations + :vartype sku: data_box_edge_management_client.operations.SkuOperations + :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.operation = OperationOperations( + self._client, self._config, self._serialize, self._deserialize) + self.device = DeviceOperations( + self._client, self._config, self._serialize, self._deserialize) + self.alert = AlertOperations( + self._client, self._config, self._serialize, self._deserialize) + self.bandwidth_schedule = BandwidthScheduleOperations( + self._client, self._config, self._serialize, self._deserialize) + self.job = JobOperations( + self._client, self._config, self._serialize, self._deserialize) + self.node = NodeOperations( + self._client, self._config, self._serialize, self._deserialize) + self.operation_status = OperationStatusOperations( + self._client, self._config, self._serialize, self._deserialize) + self.order = OrderOperations( + self._client, self._config, self._serialize, self._deserialize) + self.role = RoleOperations( + self._client, self._config, self._serialize, self._deserialize) + self.share = ShareOperations( + self._client, self._config, self._serialize, self._deserialize) + self.storage_account_credentials = StorageAccountCredentialsOperations( + self._client, self._config, self._serialize, self._deserialize) + self.storage_account = StorageAccountOperations( + self._client, self._config, self._serialize, self._deserialize) + self.container = ContainerOperations( + self._client, self._config, self._serialize, self._deserialize) + self.trigger = TriggerOperations( + self._client, self._config, self._serialize, self._deserialize) + self.user = UserOperations( + self._client, self._config, self._serialize, self._deserialize) + self.sku = SkuOperations( + 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..fe6a8d542d8 --- /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 = "2019-08-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..5000e553fa5 --- /dev/null +++ b/src/databoxedge/azext_databoxedge/vendored_sdks/databoxedge/aio/_data_box_edge_management_client.py @@ -0,0 +1,138 @@ +# 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 OperationOperations +from .operations import DeviceOperations +from .operations import AlertOperations +from .operations import BandwidthScheduleOperations +from .operations import JobOperations +from .operations import NodeOperations +from .operations import OperationStatusOperations +from .operations import OrderOperations +from .operations import RoleOperations +from .operations import ShareOperations +from .operations import StorageAccountCredentialsOperations +from .operations import StorageAccountOperations +from .operations import ContainerOperations +from .operations import TriggerOperations +from .operations import UserOperations +from .operations import SkuOperations +from .. import models + + +class DataBoxEdgeManagementClient(object): + """DataBoxEdgeManagementClient. + + :ivar operation: OperationOperations operations + :vartype operation: data_box_edge_management_client.aio.operations.OperationOperations + :ivar device: DeviceOperations operations + :vartype device: data_box_edge_management_client.aio.operations.DeviceOperations + :ivar alert: AlertOperations operations + :vartype alert: data_box_edge_management_client.aio.operations.AlertOperations + :ivar bandwidth_schedule: BandwidthScheduleOperations operations + :vartype bandwidth_schedule: data_box_edge_management_client.aio.operations.BandwidthScheduleOperations + :ivar job: JobOperations operations + :vartype job: data_box_edge_management_client.aio.operations.JobOperations + :ivar node: NodeOperations operations + :vartype node: data_box_edge_management_client.aio.operations.NodeOperations + :ivar operation_status: OperationStatusOperations operations + :vartype operation_status: data_box_edge_management_client.aio.operations.OperationStatusOperations + :ivar order: OrderOperations operations + :vartype order: data_box_edge_management_client.aio.operations.OrderOperations + :ivar role: RoleOperations operations + :vartype role: data_box_edge_management_client.aio.operations.RoleOperations + :ivar share: ShareOperations operations + :vartype share: data_box_edge_management_client.aio.operations.ShareOperations + :ivar storage_account_credentials: StorageAccountCredentialsOperations operations + :vartype storage_account_credentials: data_box_edge_management_client.aio.operations.StorageAccountCredentialsOperations + :ivar storage_account: StorageAccountOperations operations + :vartype storage_account: data_box_edge_management_client.aio.operations.StorageAccountOperations + :ivar container: ContainerOperations operations + :vartype container: data_box_edge_management_client.aio.operations.ContainerOperations + :ivar trigger: TriggerOperations operations + :vartype trigger: data_box_edge_management_client.aio.operations.TriggerOperations + :ivar user: UserOperations operations + :vartype user: data_box_edge_management_client.aio.operations.UserOperations + :ivar sku: SkuOperations operations + :vartype sku: data_box_edge_management_client.aio.operations.SkuOperations + :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.operation = OperationOperations( + self._client, self._config, self._serialize, self._deserialize) + self.device = DeviceOperations( + self._client, self._config, self._serialize, self._deserialize) + self.alert = AlertOperations( + self._client, self._config, self._serialize, self._deserialize) + self.bandwidth_schedule = BandwidthScheduleOperations( + self._client, self._config, self._serialize, self._deserialize) + self.job = JobOperations( + self._client, self._config, self._serialize, self._deserialize) + self.node = NodeOperations( + self._client, self._config, self._serialize, self._deserialize) + self.operation_status = OperationStatusOperations( + self._client, self._config, self._serialize, self._deserialize) + self.order = OrderOperations( + self._client, self._config, self._serialize, self._deserialize) + self.role = RoleOperations( + self._client, self._config, self._serialize, self._deserialize) + self.share = ShareOperations( + self._client, self._config, self._serialize, self._deserialize) + self.storage_account_credentials = StorageAccountCredentialsOperations( + self._client, self._config, self._serialize, self._deserialize) + self.storage_account = StorageAccountOperations( + self._client, self._config, self._serialize, self._deserialize) + self.container = ContainerOperations( + self._client, self._config, self._serialize, self._deserialize) + self.trigger = TriggerOperations( + self._client, self._config, self._serialize, self._deserialize) + self.user = UserOperations( + self._client, self._config, self._serialize, self._deserialize) + self.sku = SkuOperations( + 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..e9db1d82903 --- /dev/null +++ b/src/databoxedge/azext_databoxedge/vendored_sdks/databoxedge/aio/operations/__init__.py @@ -0,0 +1,43 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from ._operation_operations import OperationOperations +from ._device_operations import DeviceOperations +from ._alert_operations import AlertOperations +from ._bandwidth_schedule_operations import BandwidthScheduleOperations +from ._job_operations import JobOperations +from ._node_operations import NodeOperations +from ._operation_status_operations import OperationStatusOperations +from ._order_operations import OrderOperations +from ._role_operations import RoleOperations +from ._share_operations import ShareOperations +from ._storage_account_credentials_operations import StorageAccountCredentialsOperations +from ._storage_account_operations import StorageAccountOperations +from ._container_operations import ContainerOperations +from ._trigger_operations import TriggerOperations +from ._user_operations import UserOperations +from ._sku_operations import SkuOperations + +__all__ = [ + 'OperationOperations', + 'DeviceOperations', + 'AlertOperations', + 'BandwidthScheduleOperations', + 'JobOperations', + 'NodeOperations', + 'OperationStatusOperations', + 'OrderOperations', + 'RoleOperations', + 'ShareOperations', + 'StorageAccountCredentialsOperations', + 'StorageAccountOperations', + 'ContainerOperations', + 'TriggerOperations', + 'UserOperations', + 'SkuOperations', +] diff --git a/src/databoxedge/azext_databoxedge/vendored_sdks/databoxedge/aio/operations/_alert_operations.py b/src/databoxedge/azext_databoxedge/vendored_sdks/databoxedge/aio/operations/_alert_operations.py new file mode 100644 index 00000000000..f85ed1d72d5 --- /dev/null +++ b/src/databoxedge/azext_databoxedge/vendored_sdks/databoxedge/aio/operations/_alert_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 AlertOperations: + """AlertOperations 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 = "2019-08-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 = "2019-08-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/_bandwidth_schedule_operations.py b/src/databoxedge/azext_databoxedge/vendored_sdks/databoxedge/aio/operations/_bandwidth_schedule_operations.py new file mode 100644 index 00000000000..2b1c43f23c2 --- /dev/null +++ b/src/databoxedge/azext_databoxedge/vendored_sdks/databoxedge/aio/operations/_bandwidth_schedule_operations.py @@ -0,0 +1,445 @@ +# 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, List, 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 BandwidthScheduleOperations: + """BandwidthScheduleOperations 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 = "2019-08-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 = "2019-08-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, + start: str, + stop: str, + rate_in_mbps: int, + days: List[Union[str, "models.DayOfWeek"]], + **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', {})) + + parameters = models.BandwidthSchedule(start=start, stop=stop, rate_in_mbps=rate_in_mbps, days=days) + api_version = "2019-08-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, + start: str, + stop: str, + rate_in_mbps: int, + days: List[Union[str, "models.DayOfWeek"]], + **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 start: The start time of the schedule in UTC. + :type start: str + :param stop: The stop time of the schedule in UTC. + :type stop: str + :param rate_in_mbps: The bandwidth rate in Mbps. + :type rate_in_mbps: int + :param days: The days of the week when this schedule is applicable. + :type days: list[str or ~data_box_edge_management_client.models.DayOfWeek] + :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, + start=start, + stop=stop, + rate_in_mbps=rate_in_mbps, + days=days, + 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 = "2019-08-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/_container_operations.py b/src/databoxedge/azext_databoxedge/vendored_sdks/databoxedge/aio/operations/_container_operations.py new file mode 100644 index 00000000000..7edd310ddeb --- /dev/null +++ b/src/databoxedge/azext_databoxedge/vendored_sdks/databoxedge/aio/operations/_container_operations.py @@ -0,0 +1,582 @@ +# 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 ContainerOperations: + """ContainerOperations 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 = "2019-08-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 = "2019-08-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, + data_format: Union[str, "models.AzureContainerDataFormat"], + **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', {})) + + container = models.Container(data_format=data_format) + api_version = "2019-08-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, + data_format: Union[str, "models.AzureContainerDataFormat"], + **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 data_format: DataFormat for Container. + :type data_format: str or ~data_box_edge_management_client.models.AzureContainerDataFormat + :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, + data_format=data_format, + 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 = "2019-08-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 = "2019-08-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/_device_operations.py b/src/databoxedge/azext_databoxedge/vendored_sdks/databoxedge/aio/operations/_device_operations.py new file mode 100644 index 00000000000..ce0e622effb --- /dev/null +++ b/src/databoxedge/azext_databoxedge/vendored_sdks/databoxedge/aio/operations/_device_operations.py @@ -0,0 +1,1292 @@ +# 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 DeviceOperations: + """DeviceOperations 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 = "2019-08-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 = "2019-08-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 = "2019-08-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_initial( + self, + device_name: str, + resource_group_name: str, + location: str, + tags: Optional[Dict[str, str]] = None, + sku: Optional["models.Sku"] = None, + etag: Optional[str] = None, + data_box_edge_device_status: Optional[Union[str, "models.DataBoxEdgeDeviceStatus"]] = None, + description: Optional[str] = None, + model_description: Optional[str] = None, + friendly_name: Optional[str] = None, + **kwargs + ) -> "models.DataBoxEdgeDevice": + cls = kwargs.pop('cls', None) # type: ClsType["models.DataBoxEdgeDevice"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + data_box_edge_device = models.DataBoxEdgeDevice(location=location, tags=tags, sku=sku, etag=etag, data_box_edge_device_status=data_box_edge_device_status, description=description, model_description=model_description, friendly_name=friendly_name) + api_version = "2019-08-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(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_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}'} # type: ignore + + async def begin_create_or_update( + self, + device_name: str, + resource_group_name: str, + location: str, + tags: Optional[Dict[str, str]] = None, + sku: Optional["models.Sku"] = None, + etag: Optional[str] = None, + data_box_edge_device_status: Optional[Union[str, "models.DataBoxEdgeDeviceStatus"]] = None, + description: Optional[str] = None, + model_description: Optional[str] = None, + friendly_name: Optional[str] = None, + **kwargs + ) -> AsyncLROPoller["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 location: 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: 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 data_box_edge_device_status: The status of the Data Box Edge/Gateway device. + :type data_box_edge_device_status: str or ~data_box_edge_management_client.models.DataBoxEdgeDeviceStatus + :param description: The Description of the Data Box Edge/Gateway device. + :type description: str + :param model_description: The description of the Data Box Edge/Gateway device model. + :type model_description: str + :param friendly_name: The Data Box Edge/Gateway device name. + :type friendly_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 DataBoxEdgeDevice or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~data_box_edge_management_client.models.DataBoxEdgeDevice] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["models.DataBoxEdgeDevice"] + 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, + location=location, + tags=tags, + sku=sku, + etag=etag, + data_box_edge_device_status=data_box_edge_device_status, + description=description, + model_description=model_description, + friendly_name=friendly_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): + deserialized = self._deserialize('DataBoxEdgeDevice', 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}'} # 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 = "2019-08-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, + tags: Optional[Dict[str, str]] = None, + **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 tags: The tags attached to the Data Box Edge/Gateway resource. + :type tags: dict[str, 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', {})) + + parameters = models.DataBoxEdgeDevicePatch(tags=tags) + api_version = "2019-08-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_update_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 = "2019-08-01" + accept = "application/json" + + # Construct URL + url = self._download_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['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_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/downloadUpdates'} # type: ignore + + async def begin_download_update( + 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_update_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_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/downloadUpdates'} # type: ignore + + async def get_extended_information( + self, + device_name: str, + resource_group_name: str, + **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 + :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 = "2019-08-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_update_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 = "2019-08-01" + accept = "application/json" + + # Construct URL + url = self._install_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['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_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/installUpdates'} # type: ignore + + async def begin_install_update( + 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_update_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_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/installUpdates'} # type: ignore + + async def get_network_setting( + 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 = "2019-08-01" + accept = "application/json" + + # Construct URL + url = self.get_network_setting.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_setting.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/networkSettings/default'} # type: ignore + + async def _scan_for_update_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 = "2019-08-01" + accept = "application/json" + + # Construct URL + url = self._scan_for_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['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_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/scanForUpdates'} # type: ignore + + async def begin_scan_for_update( + 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_update_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_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/scanForUpdates'} # type: ignore + + async def _create_or_update_security_setting_initial( + self, + device_name: str, + resource_group_name: str, + device_admin_password: "models.AsymmetricEncryptedSecret", + **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', {})) + + security_settings = models.SecuritySettings(device_admin_password=device_admin_password) + api_version = "2019-08-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._create_or_update_security_setting_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_setting_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/securitySettings/default/update'} # type: ignore + + async def begin_create_or_update_security_setting( + self, + device_name: str, + resource_group_name: str, + device_admin_password: "models.AsymmetricEncryptedSecret", + **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 device_admin_password: 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 + :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_setting_initial( + device_name=device_name, + resource_group_name=resource_group_name, + device_admin_password=device_admin_password, + 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_setting.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/securitySettings/default/update'} # 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 = "2019-08-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, + certificate: str, + authentication_type: Optional[Union[str, "models.AuthenticationType"]] = None, + **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 certificate: The base64 encoded certificate raw data. + :type certificate: str + :param authentication_type: The authentication type. + :type authentication_type: str or ~data_box_edge_management_client.models.AuthenticationType + :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', {})) + + parameters = models.UploadCertificateRequest(authentication_type=authentication_type, certificate=certificate) + api_version = "2019-08-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/_job_operations.py b/src/databoxedge/azext_databoxedge/vendored_sdks/databoxedge/aio/operations/_job_operations.py new file mode 100644 index 00000000000..64df941744e --- /dev/null +++ b/src/databoxedge/azext_databoxedge/vendored_sdks/databoxedge/aio/operations/_job_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 JobOperations: + """JobOperations 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 = "2019-08-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/_node_operations.py b/src/databoxedge/azext_databoxedge/vendored_sdks/databoxedge/aio/operations/_node_operations.py new file mode 100644 index 00000000000..9734505d9e5 --- /dev/null +++ b/src/databoxedge/azext_databoxedge/vendored_sdks/databoxedge/aio/operations/_node_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 NodeOperations: + """NodeOperations 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 = "2019-08-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 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/_operation_operations.py b/src/databoxedge/azext_databoxedge/vendored_sdks/databoxedge/aio/operations/_operation_operations.py new file mode 100644 index 00000000000..3a80c9be2fc --- /dev/null +++ b/src/databoxedge/azext_databoxedge/vendored_sdks/databoxedge/aio/operations/_operation_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 OperationOperations: + """OperationOperations 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 = "2019-08-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/_operation_status_operations.py b/src/databoxedge/azext_databoxedge/vendored_sdks/databoxedge/aio/operations/_operation_status_operations.py new file mode 100644 index 00000000000..cd6fa1373ca --- /dev/null +++ b/src/databoxedge/azext_databoxedge/vendored_sdks/databoxedge/aio/operations/_operation_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 OperationStatusOperations: + """OperationStatusOperations 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 = "2019-08-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/_order_operations.py b/src/databoxedge/azext_databoxedge/vendored_sdks/databoxedge/aio/operations/_order_operations.py new file mode 100644 index 00000000000..51c4b81b0c2 --- /dev/null +++ b/src/databoxedge/azext_databoxedge/vendored_sdks/databoxedge/aio/operations/_order_operations.py @@ -0,0 +1,435 @@ +# 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 OrderOperations: + """OrderOperations 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 = "2019-08-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 = "2019-08-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, + contact_information: Optional["models.ContactDetails"] = None, + shipping_address: Optional["models.Address"] = None, + status: Optional[Union[str, "models.OrderState"]] = None, + comments: Optional[str] = None, + **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', {})) + + order = models.Order(contact_information=contact_information, shipping_address=shipping_address, status=status, comments=comments) + api_version = "2019-08-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, + contact_information: Optional["models.ContactDetails"] = None, + shipping_address: Optional["models.Address"] = None, + status: Optional[Union[str, "models.OrderState"]] = None, + comments: Optional[str] = None, + **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 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 + :param status: Status of the order as per the allowed status types. + :type status: str or ~data_box_edge_management_client.models.OrderState + :param comments: Comments related to this status change. + :type comments: 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 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, + contact_information=contact_information, + shipping_address=shipping_address, + status=status, + comments=comments, + 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 = "2019-08-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 diff --git a/src/databoxedge/azext_databoxedge/vendored_sdks/databoxedge/aio/operations/_role_operations.py b/src/databoxedge/azext_databoxedge/vendored_sdks/databoxedge/aio/operations/_role_operations.py new file mode 100644 index 00000000000..24f29481160 --- /dev/null +++ b/src/databoxedge/azext_databoxedge/vendored_sdks/databoxedge/aio/operations/_role_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 RoleOperations: + """RoleOperations 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 = "2019-08-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 = "2019-08-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 = "2019-08-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 = "2019-08-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/_share_operations.py b/src/databoxedge/azext_databoxedge/vendored_sdks/databoxedge/aio/operations/_share_operations.py new file mode 100644 index 00000000000..5e3e741e92a --- /dev/null +++ b/src/databoxedge/azext_databoxedge/vendored_sdks/databoxedge/aio/operations/_share_operations.py @@ -0,0 +1,595 @@ +# 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, List, 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 ShareOperations: + """ShareOperations 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 = "2019-08-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 = "2019-08-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_status: Union[str, "models.ShareStatus"], + monitoring_status: Union[str, "models.MonitoringStatus"], + access_protocol: Union[str, "models.ShareAccessProtocol"], + description: Optional[str] = None, + azure_container_info: Optional["models.AzureContainerInfo"] = None, + user_access_rights: Optional[List["models.UserAccessRight"]] = None, + client_access_rights: Optional[List["models.ClientAccessRight"]] = None, + refresh_details: Optional["models.RefreshDetails"] = None, + data_policy: Optional[Union[str, "models.DataPolicy"]] = None, + **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', {})) + + share = models.Share(description=description, share_status=share_status, monitoring_status=monitoring_status, azure_container_info=azure_container_info, access_protocol=access_protocol, user_access_rights=user_access_rights, client_access_rights=client_access_rights, refresh_details=refresh_details, data_policy=data_policy) + api_version = "2019-08-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_status: Union[str, "models.ShareStatus"], + monitoring_status: Union[str, "models.MonitoringStatus"], + access_protocol: Union[str, "models.ShareAccessProtocol"], + description: Optional[str] = None, + azure_container_info: Optional["models.AzureContainerInfo"] = None, + user_access_rights: Optional[List["models.UserAccessRight"]] = None, + client_access_rights: Optional[List["models.ClientAccessRight"]] = None, + refresh_details: Optional["models.RefreshDetails"] = None, + data_policy: Optional[Union[str, "models.DataPolicy"]] = None, + **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_status: Current status of the share. + :type share_status: str or ~data_box_edge_management_client.models.ShareStatus + :param monitoring_status: Current monitoring status of the share. + :type monitoring_status: str or ~data_box_edge_management_client.models.MonitoringStatus + :param access_protocol: Access protocol to be used by the share. + :type access_protocol: str or ~data_box_edge_management_client.models.ShareAccessProtocol + :param description: Description for the share. + :type description: str + :param azure_container_info: Azure container mapping for the share. + :type azure_container_info: ~data_box_edge_management_client.models.AzureContainerInfo + :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 + :param data_policy: Data policy of the share. + :type data_policy: str or ~data_box_edge_management_client.models.DataPolicy + :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_status=share_status, + monitoring_status=monitoring_status, + access_protocol=access_protocol, + description=description, + azure_container_info=azure_container_info, + user_access_rights=user_access_rights, + client_access_rights=client_access_rights, + refresh_details=refresh_details, + data_policy=data_policy, + 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 = "2019-08-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 = "2019-08-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/_sku_operations.py b/src/databoxedge/azext_databoxedge/vendored_sdks/databoxedge/aio/operations/_sku_operations.py new file mode 100644 index 00000000000..d55a27ee212 --- /dev/null +++ b/src/databoxedge/azext_databoxedge/vendored_sdks/databoxedge/aio/operations/_sku_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 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 SkuOperations: + """SkuOperations 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, + filter: Optional[str] = None, + **kwargs + ) -> AsyncIterable["models.SkuInformationList"]: + """List all the available Skus in the region and information related to them. + + List all the available Skus in the region and information related to them. + + :param filter: Specify $filter='location eq :code:``' to filter on location. + :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 SkuInformationList or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~data_box_edge_management_client.models.SkuInformationList] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.SkuInformationList"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2019-08-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + if 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('SkuInformationList', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.DataBoxEdge/skus'} # 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..f2ebbc9ed7a --- /dev/null +++ b/src/databoxedge/azext_databoxedge/vendored_sdks/databoxedge/aio/operations/_storage_account_credentials_operations.py @@ -0,0 +1,468 @@ +# 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 = "2019-08-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 = "2019-08-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, + alias: str, + ssl_status: Union[str, "models.SSLStatus"], + account_type: Union[str, "models.AccountType"], + user_name: Optional[str] = None, + account_key: Optional["models.AsymmetricEncryptedSecret"] = None, + connection_string: Optional[str] = None, + blob_domain_name: Optional[str] = None, + storage_account_id: Optional[str] = None, + **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', {})) + + storage_account_credential = models.StorageAccountCredential(alias=alias, user_name=user_name, account_key=account_key, connection_string=connection_string, ssl_status=ssl_status, blob_domain_name=blob_domain_name, account_type=account_type, storage_account_id=storage_account_id) + api_version = "2019-08-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, + alias: str, + ssl_status: Union[str, "models.SSLStatus"], + account_type: Union[str, "models.AccountType"], + user_name: Optional[str] = None, + account_key: Optional["models.AsymmetricEncryptedSecret"] = None, + connection_string: Optional[str] = None, + blob_domain_name: Optional[str] = None, + storage_account_id: Optional[str] = None, + **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 alias: Alias for the storage account. + :type alias: str + :param ssl_status: Signifies whether SSL needs to be enabled or not. + :type ssl_status: str or ~data_box_edge_management_client.models.SSLStatus + :param account_type: Type of storage accessed on the storage account. + :type account_type: str or ~data_box_edge_management_client.models.AccountType + :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 blob_domain_name: Blob end point for private clouds. + :type blob_domain_name: str + :param storage_account_id: Id of the storage account. + :type storage_account_id: 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 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, + alias=alias, + ssl_status=ssl_status, + account_type=account_type, + user_name=user_name, + account_key=account_key, + connection_string=connection_string, + blob_domain_name=blob_domain_name, + storage_account_id=storage_account_id, + 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 = "2019-08-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_account_operations.py b/src/databoxedge/azext_databoxedge/vendored_sdks/databoxedge/aio/operations/_storage_account_operations.py new file mode 100644 index 00000000000..3280d2d9d81 --- /dev/null +++ b/src/databoxedge/azext_databoxedge/vendored_sdks/databoxedge/aio/operations/_storage_account_operations.py @@ -0,0 +1,451 @@ +# 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 StorageAccountOperations: + """StorageAccountOperations 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 storage accounts in a Data Box Edge/Data Box Gateway device. + + Lists all the storage accounts 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 = "2019-08-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 = "2019-08-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, + description: Optional[str] = None, + storage_account_status: Optional[Union[str, "models.StorageAccountStatus"]] = None, + data_policy: Optional[Union[str, "models.DataPolicy"]] = None, + storage_account_credential_id: Optional[str] = None, + **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', {})) + + storage_account = models.StorageAccount(description=description, storage_account_status=storage_account_status, data_policy=data_policy, storage_account_credential_id=storage_account_credential_id) + api_version = "2019-08-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, + description: Optional[str] = None, + storage_account_status: Optional[Union[str, "models.StorageAccountStatus"]] = None, + data_policy: Optional[Union[str, "models.DataPolicy"]] = None, + storage_account_credential_id: Optional[str] = None, + **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 description: Description for the storage Account. + :type description: str + :param storage_account_status: Current status of the storage account. + :type storage_account_status: str or ~data_box_edge_management_client.models.StorageAccountStatus + :param data_policy: Data policy of the storage Account. + :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 + :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, + description=description, + storage_account_status=storage_account_status, + data_policy=data_policy, + storage_account_credential_id=storage_account_credential_id, + 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 = "2019-08-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/_trigger_operations.py b/src/databoxedge/azext_databoxedge/vendored_sdks/databoxedge/aio/operations/_trigger_operations.py new file mode 100644 index 00000000000..a622f6313a2 --- /dev/null +++ b/src/databoxedge/azext_databoxedge/vendored_sdks/databoxedge/aio/operations/_trigger_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 TriggerOperations: + """TriggerOperations 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 = "2019-08-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 = "2019-08-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 = "2019-08-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 = "2019-08-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/_user_operations.py b/src/databoxedge/azext_databoxedge/vendored_sdks/databoxedge/aio/operations/_user_operations.py new file mode 100644 index 00000000000..47cc13677e2 --- /dev/null +++ b/src/databoxedge/azext_databoxedge/vendored_sdks/databoxedge/aio/operations/_user_operations.py @@ -0,0 +1,447 @@ +# 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, List, 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 UserOperations: + """UserOperations 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='UserType 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 = "2019-08-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 = "2019-08-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_type: Union[str, "models.UserType"], + encrypted_password: Optional["models.AsymmetricEncryptedSecret"] = None, + share_access_rights: Optional[List["models.ShareAccessRight"]] = None, + **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', {})) + + user = models.User(encrypted_password=encrypted_password, share_access_rights=share_access_rights, user_type=user_type) + api_version = "2019-08-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_type: Union[str, "models.UserType"], + encrypted_password: Optional["models.AsymmetricEncryptedSecret"] = None, + share_access_rights: Optional[List["models.ShareAccessRight"]] = None, + **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_type: Type of the user. + :type user_type: str or ~data_box_edge_management_client.models.UserType + :param encrypted_password: The password details. + :type encrypted_password: ~data_box_edge_management_client.models.AsymmetricEncryptedSecret + :param share_access_rights: List of shares that the user has rights on. This field should not + be specified during user creation. + :type share_access_rights: list[~data_box_edge_management_client.models.ShareAccessRight] + :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_type=user_type, + encrypted_password=encrypted_password, + share_access_rights=share_access_rights, + 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 = "2019-08-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..143311dcfba --- /dev/null +++ b/src/databoxedge/azext_databoxedge/vendored_sdks/databoxedge/models/__init__.py @@ -0,0 +1,317 @@ +# 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 Address + from ._models_py3 import Alert + from ._models_py3 import AlertErrorDetails + from ._models_py3 import AlertList + 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 CloudErrorBody + 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 DataBoxEdgeDeviceList + from ._models_py3 import DataBoxEdgeDevicePatch + from ._models_py3 import FileEventTrigger + from ._models_py3 import IoTDeviceInfo + 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 MetricDimensionV1 + from ._models_py3 import MetricSpecificationV1 + 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 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 RefreshDetails + from ._models_py3 import ResourceTypeSku + from ._models_py3 import Role + from ._models_py3 import RoleList + 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 SkuCost + from ._models_py3 import SkuInformationList + from ._models_py3 import SkuLocationInfo + from ._models_py3 import SkuRestriction + from ._models_py3 import SkuRestrictionInfo + from ._models_py3 import StorageAccount + from ._models_py3 import StorageAccountCredential + from ._models_py3 import StorageAccountCredentialList + from ._models_py3 import StorageAccountList + from ._models_py3 import SymmetricKey + from ._models_py3 import TrackingInfo + from ._models_py3 import Trigger + from ._models_py3 import TriggerList + 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 Address # type: ignore + from ._models import Alert # type: ignore + from ._models import AlertErrorDetails # type: ignore + from ._models import AlertList # 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 CloudErrorBody # 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 DataBoxEdgeDeviceList # type: ignore + from ._models import DataBoxEdgeDevicePatch # type: ignore + from ._models import FileEventTrigger # type: ignore + from ._models import IoTDeviceInfo # 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 MetricDimensionV1 # type: ignore + from ._models import MetricSpecificationV1 # 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 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 RefreshDetails # type: ignore + from ._models import ResourceTypeSku # type: ignore + from ._models import Role # type: ignore + from ._models import RoleList # 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 SkuCost # type: ignore + from ._models import SkuInformationList # type: ignore + from ._models import SkuLocationInfo # type: ignore + from ._models import SkuRestriction # type: ignore + from ._models import SkuRestrictionInfo # 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 SymmetricKey # type: ignore + from ._models import TrackingInfo # type: ignore + from ._models import Trigger # type: ignore + from ._models import TriggerList # 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 ( + AccountType, + AlertSeverity, + AuthenticationType, + AzureContainerDataFormat, + ClientPermissionType, + ContainerStatus, + DataBoxEdgeDeviceStatus, + DataPolicy, + DayOfWeek, + DeviceType, + DownloadPhase, + EncryptionAlgorithm, + InstallRebootBehavior, + JobStatus, + JobType, + MetricAggregationType, + MetricCategory, + MetricUnit, + MonitoringStatus, + NetworkAdapterDhcpStatus, + NetworkAdapterRdmaStatus, + NetworkAdapterStatus, + NetworkGroup, + NodeStatus, + OrderState, + PlatformType, + RoleStatus, + RoleTypes, + SSLStatus, + ShareAccessProtocol, + ShareAccessType, + ShareStatus, + SkuName, + SkuRestrictionReasonCode, + SkuTier, + StorageAccountStatus, + TimeGrain, + TriggerEventType, + UpdateOperation, + UpdateOperationStage, + UserType, +) + +__all__ = [ + 'Address', + 'Alert', + 'AlertErrorDetails', + 'AlertList', + 'ArmBaseModel', + 'AsymmetricEncryptedSecret', + 'Authentication', + 'AzureContainerInfo', + 'BandwidthSchedule', + 'BandwidthSchedulesList', + 'ClientAccessRight', + 'CloudErrorBody', + 'ContactDetails', + 'Container', + 'ContainerList', + 'DataBoxEdgeDevice', + 'DataBoxEdgeDeviceExtendedInfo', + 'DataBoxEdgeDeviceList', + 'DataBoxEdgeDevicePatch', + 'FileEventTrigger', + 'IoTDeviceInfo', + 'IoTRole', + 'Ipv4Config', + 'Ipv6Config', + 'Job', + 'JobErrorDetails', + 'JobErrorItem', + 'MetricDimensionV1', + 'MetricSpecificationV1', + 'MountPointMap', + 'NetworkAdapter', + 'NetworkAdapterPosition', + 'NetworkSettings', + 'Node', + 'NodeList', + 'Operation', + 'OperationDisplay', + 'OperationsList', + 'Order', + 'OrderList', + 'OrderStatus', + 'PeriodicTimerEventTrigger', + 'RefreshDetails', + 'ResourceTypeSku', + 'Role', + 'RoleList', + 'SecuritySettings', + 'ServiceSpecification', + 'Share', + 'ShareAccessRight', + 'ShareList', + 'Sku', + 'SkuCost', + 'SkuInformationList', + 'SkuLocationInfo', + 'SkuRestriction', + 'SkuRestrictionInfo', + 'StorageAccount', + 'StorageAccountCredential', + 'StorageAccountCredentialList', + 'StorageAccountList', + 'SymmetricKey', + 'TrackingInfo', + 'Trigger', + 'TriggerList', + 'UpdateDownloadProgress', + 'UpdateInstallProgress', + 'UpdateSummary', + 'UploadCertificateRequest', + 'UploadCertificateResponse', + 'User', + 'UserAccessRight', + 'UserList', + 'AccountType', + 'AlertSeverity', + 'AuthenticationType', + 'AzureContainerDataFormat', + 'ClientPermissionType', + 'ContainerStatus', + 'DataBoxEdgeDeviceStatus', + 'DataPolicy', + 'DayOfWeek', + 'DeviceType', + 'DownloadPhase', + 'EncryptionAlgorithm', + 'InstallRebootBehavior', + 'JobStatus', + 'JobType', + 'MetricAggregationType', + 'MetricCategory', + 'MetricUnit', + 'MonitoringStatus', + 'NetworkAdapterDhcpStatus', + 'NetworkAdapterRdmaStatus', + 'NetworkAdapterStatus', + 'NetworkGroup', + 'NodeStatus', + 'OrderState', + 'PlatformType', + 'RoleStatus', + 'RoleTypes', + 'SSLStatus', + 'ShareAccessProtocol', + 'ShareAccessType', + 'ShareStatus', + 'SkuName', + 'SkuRestrictionReasonCode', + 'SkuTier', + 'StorageAccountStatus', + 'TimeGrain', + 'TriggerEventType', + 'UpdateOperation', + 'UpdateOperationStage', + '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..0d05e5fee9b --- /dev/null +++ b/src/databoxedge/azext_databoxedge/vendored_sdks/databoxedge/models/_data_box_edge_management_client_enums.py @@ -0,0 +1,402 @@ +# 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 AccountType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Type of storage accessed on the storage account. + """ + + GENERAL_PURPOSE_STORAGE = "GeneralPurposeStorage" + BLOB_STORAGE = "BlobStorage" + +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 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 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 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" + +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 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_FULFILMENT = "AwaitingFulfilment" + 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" + +class PlatformType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Host OS supported by the IoT role. + """ + + WINDOWS = "Windows" + LINUX = "Linux" + +class RoleStatus(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Role status. + """ + + ENABLED = "Enabled" + DISABLED = "Disabled" + +class RoleTypes(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + + IOT = "IOT" + ASA = "ASA" + FUNCTIONS = "Functions" + COGNITIVE = "Cognitive" + +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 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" + +class SkuRestrictionReasonCode(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """The SKU restriction reason. + """ + + NOT_AVAILABLE_FOR_SUBSCRIPTION = "NotAvailableForSubscription" + QUOTA_ID = "QuotaId" + +class SkuTier(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """The Sku tier + """ + + STANDARD = "Standard" + +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 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 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..9c5ba1df7bd --- /dev/null +++ b/src/databoxedge/azext_databoxedge/vendored_sdks/databoxedge/models/_models.py @@ -0,0 +1,3243 @@ +# 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 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: Required. 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: Required. The postal code. + :type postal_code: str + :param city: Required. The city name. + :type city: str + :param state: Required. The state name. + :type state: str + :param country: Required. The country name. + :type country: str + """ + + _validation = { + 'address_line1': {'required': True}, + 'postal_code': {'required': True}, + 'city': {'required': True}, + 'state': {'required': True}, + '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['address_line1'] + self.address_line2 = kwargs.get('address_line2', None) + self.address_line3 = kwargs.get('address_line3', None) + self.postal_code = kwargs['postal_code'] + self.city = kwargs['city'] + self.state = kwargs['state'] + self.country = kwargs['country'] + + +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 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 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}, + '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'}, + '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.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 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 + :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}, + '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'}, + '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.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 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 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 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}, + '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'}, + '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.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 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 + :param description: The Description of the Data Box Edge/Gateway device. + :type description: str + :param model_description: The description of the Data Box Edge/Gateway device model. + :type 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 + :param friendly_name: The Data Box Edge/Gateway device name. + :type 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 + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': True}, + 'serial_number': {'readonly': True}, + 'device_type': {'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}, + } + + _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'}, + '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'}, + } + + 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.data_box_edge_device_status = kwargs.get('data_box_edge_device_status', None) + self.serial_number = None + self.description = kwargs.get('description', None) + self.model_description = kwargs.get('model_description', None) + self.device_type = None + self.friendly_name = kwargs.get('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 + + +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 + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'resource_key': {'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'}, + } + + 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 + + +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] + """ + + _attribute_map = { + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__( + self, + **kwargs + ): + super(DataBoxEdgeDevicePatch, self).__init__(**kwargs) + self.tags = kwargs.get('tags', 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 + :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}, + 'kind': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + } + + _subtype_map = { + 'kind': {'FileEvent': 'FileEventTrigger', 'PeriodicTimerEvent': 'PeriodicTimerEventTrigger'} + } + + def __init__( + self, + **kwargs + ): + super(Trigger, self).__init__(**kwargs) + 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 + :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 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 + :param role_id: Required. Compute role ID. + :type role_id: str + :param share_id: Required. File share ID. + :type share_id: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'kind': {'required': True}, + 'role_id': {'required': True}, + 'share_id': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'custom_context_tag': {'key': 'properties.customContextTag', 'type': 'str'}, + 'role_id': {'key': 'sinkInfo.roleId', 'type': 'str'}, + 'share_id': {'key': 'sourceInfo.shareId', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(FileEventTrigger, self).__init__(**kwargs) + self.kind = 'FileEvent' # type: str + self.custom_context_tag = kwargs.get('custom_context_tag', None) + self.role_id = kwargs['role_id'] + self.share_id = kwargs['share_id'] + + +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: IoT device authentication info. + :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 Role(ArmBaseModel): + """Compute role. + + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: IoTRole. + + 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". + :type kind: str or ~data_box_edge_management_client.models.RoleTypes + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'kind': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + } + + _subtype_map = { + 'kind': {'IOT': 'IoTRole'} + } + + def __init__( + self, + **kwargs + ): + super(Role, self).__init__(**kwargs) + self.kind = 'Role' # type: str + + +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". + :type kind: str or ~data_box_edge_management_client.models.RoleTypes + :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 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}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + '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]'}, + '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.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". + :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 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 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 role_type: Role type. Possible values include: "IOT", "ASA", "Functions", "Cognitive". + :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}, + 'role_type': {'readonly': True}, + } + + _attribute_map = { + 'share_id': {'key': 'shareId', 'type': 'str'}, + 'role_id': {'key': 'roleId', 'type': 'str'}, + 'mount_point': {'key': 'mountPoint', '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.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 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}, + 'network_adapters': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'network_adapters': {'key': 'properties.networkAdapters', 'type': '[NetworkAdapter]'}, + } + + def __init__( + self, + **kwargs + ): + super(NetworkSettings, self).__init__(**kwargs) + 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 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] + """ + + _validation = { + 'value': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[Node]'}, + } + + def __init__( + self, + **kwargs + ): + super(NodeList, self).__init__(**kwargs) + self.value = None + + +class Operation(msrest.serialization.Model): + """Operations. + + :param name: Name of the operation. + :type name: str + :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'}, + '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.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 + :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 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 status: Status of the order as per the allowed status types. Possible values include: + "Untracked", "AwaitingFulfilment", "AwaitingPreparation", "AwaitingShipment", "Shipped", + "Arriving", "Delivered", "ReplacementRequested", "LostDevice", "Declined", "ReturnInitiated", + "AwaitingReturnShipment", "ShippedBack", "CollectedAtMicrosoft". + :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 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 = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'order_history': {'readonly': True}, + 'serial_number': {'readonly': True}, + 'delivery_tracking_info': {'readonly': True}, + 'return_tracking_info': {'readonly': True}, + 'update_date_time': {'readonly': True}, + 'additional_order_details': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'contact_information': {'key': 'properties.contactInformation', 'type': 'ContactDetails'}, + 'shipping_address': {'key': 'properties.shippingAddress', 'type': 'Address'}, + '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]'}, + 'status': {'key': 'currentStatus.status', 'type': 'str'}, + 'update_date_time': {'key': 'currentStatus.updateDateTime', 'type': 'iso-8601'}, + 'comments': {'key': 'currentStatus.comments', 'type': 'str'}, + 'additional_order_details': {'key': 'currentStatus.additionalOrderDetails', 'type': '{str}'}, + } + + def __init__( + self, + **kwargs + ): + super(Order, self).__init__(**kwargs) + self.contact_information = kwargs.get('contact_information', None) + self.shipping_address = kwargs.get('shipping_address', None) + self.order_history = None + self.serial_number = None + self.delivery_tracking_info = None + self.return_tracking_info = None + self.status = kwargs.get('status', None) + self.update_date_time = None + self.comments = kwargs.get('comments', None) + self.additional_order_details = 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", "AwaitingFulfilment", "AwaitingPreparation", "AwaitingShipment", + "Shipped", "Arriving", "Delivered", "ReplacementRequested", "LostDevice", "Declined", + "ReturnInitiated", "AwaitingReturnShipment", "ShippedBack", "CollectedAtMicrosoft". + :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 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}, + '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'}, + '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.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 + :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 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 + :param role_id: Required. Compute role ID. + :type role_id: str + :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 = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'kind': {'required': True}, + 'role_id': {'required': True}, + 'start_time': {'required': True}, + 'schedule': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'custom_context_tag': {'key': 'properties.customContextTag', 'type': 'str'}, + 'role_id': {'key': 'sinkInfo.roleId', 'type': 'str'}, + 'start_time': {'key': 'sourceInfo.startTime', 'type': 'iso-8601'}, + 'schedule': {'key': 'sourceInfo.schedule', 'type': 'str'}, + 'topic': {'key': 'sourceInfo.topic', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(PeriodicTimerEventTrigger, self).__init__(**kwargs) + self.kind = 'PeriodicTimerEvent' # type: str + self.custom_context_tag = kwargs.get('custom_context_tag', None) + self.role_id = kwargs['role_id'] + 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 ResourceTypeSku(msrest.serialization.Model): + """SkuInformation object. + + 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". + :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 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. + :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 restrictions: Restrictions of the SKU availability. + :vartype restrictions: list[~data_box_edge_management_client.models.SkuRestriction] + """ + + _validation = { + 'resource_type': {'readonly': True}, + 'name': {'readonly': True}, + 'kind': {'readonly': True}, + 'tier': {'readonly': True}, + 'family': {'readonly': True}, + 'locations': {'readonly': True}, + 'api_versions': {'readonly': True}, + 'location_info': {'readonly': True}, + 'costs': {'readonly': True}, + 'restrictions': {'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'}, + '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]'}, + 'restrictions': {'key': 'restrictions', 'type': '[SkuRestriction]'}, + } + + def __init__( + self, + **kwargs + ): + super(ResourceTypeSku, self).__init__(**kwargs) + self.resource_type = None + self.name = None + self.kind = None + self.tier = None + self.family = None + self.locations = None + self.api_versions = None + self.location_info = None + self.costs = None + self.restrictions = 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 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 + :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}, + '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'}, + '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.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". + :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 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: Restriction of the SKU for the location/zone. + :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 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 ResourceType Sku. + :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 SkuRestriction(msrest.serialization.Model): + """The restrictions because of which SKU cannot be used. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar type: The type of the restriction. + :vartype type: str + :ivar values: The locations where sku is restricted. + :vartype values: list[str] + :ivar reason_code: The SKU restriction reason. Possible values include: + "NotAvailableForSubscription", "QuotaId". + :vartype reason_code: str or ~data_box_edge_management_client.models.SkuRestrictionReasonCode + :ivar restriction_info: Restriction of the SKU for the location/zone. + :vartype restriction_info: ~data_box_edge_management_client.models.SkuRestrictionInfo + """ + + _validation = { + 'type': {'readonly': True}, + 'values': {'readonly': True}, + 'reason_code': {'readonly': True}, + 'restriction_info': {'readonly': True}, + } + + _attribute_map = { + 'type': {'key': 'type', 'type': 'str'}, + 'values': {'key': 'values', 'type': '[str]'}, + 'reason_code': {'key': 'reasonCode', 'type': 'str'}, + 'restriction_info': {'key': 'restrictionInfo', 'type': 'SkuRestrictionInfo'}, + } + + def __init__( + self, + **kwargs + ): + super(SkuRestriction, self).__init__(**kwargs) + self.type = None + self.values = None + self.reason_code = None + self.restriction_info = None + + +class SkuRestrictionInfo(msrest.serialization.Model): + """The restriction info with locations and zones. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar locations: The locations. + :vartype locations: list[str] + :ivar zones: The zones. + :vartype zones: list[str] + """ + + _validation = { + 'locations': {'readonly': True}, + 'zones': {'readonly': True}, + } + + _attribute_map = { + 'locations': {'key': 'locations', 'type': '[str]'}, + 'zones': {'key': 'zones', 'type': '[str]'}, + } + + def __init__( + self, + **kwargs + ): + super(SkuRestrictionInfo, self).__init__(**kwargs) + self.locations = None + self.zones = 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. + + :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 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: 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}, + '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'}, + '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.description = kwargs.get('description', None) + self.storage_account_status = kwargs.get('storage_account_status', None) + self.data_policy = kwargs.get('data_policy', None) + 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 + :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}, + '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'}, + '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.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 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 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 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 + :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 + :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_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 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 total_update_size_in_bytes: The total size of updates available for download in bytes. + :vartype total_update_size_in_bytes: float + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'last_completed_download_job_date_time': {'readonly': True}, + 'last_completed_install_job_date_time': {'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}, + 'total_update_size_in_bytes': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + '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_completed_download_job_date_time': {'key': 'properties.lastCompletedDownloadJobDateTime', 'type': 'iso-8601'}, + 'last_completed_install_job_date_time': {'key': 'properties.lastCompletedInstallJobDateTime', 'type': 'iso-8601'}, + '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]'}, + 'total_update_size_in_bytes': {'key': 'properties.totalUpdateSizeInBytes', 'type': 'float'}, + } + + def __init__( + self, + **kwargs + ): + super(UpdateSummary, self).__init__(**kwargs) + 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_completed_download_job_date_time = None + self.last_completed_install_job_date_time = 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.total_update_size_in_bytes = 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 + :param encrypted_password: The password details. + :type encrypted_password: ~data_box_edge_management_client.models.AsymmetricEncryptedSecret + :param share_access_rights: List of shares that the user has rights on. This field should not + be specified during user creation. + :type 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}, + 'user_type': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + '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.encrypted_password = kwargs.get('encrypted_password', None) + self.share_access_rights = kwargs.get('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..fe5189a04d8 --- /dev/null +++ b/src/databoxedge/azext_databoxedge/vendored_sdks/databoxedge/models/_models_py3.py @@ -0,0 +1,3427 @@ +# 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 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: Required. 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: Required. The postal code. + :type postal_code: str + :param city: Required. The city name. + :type city: str + :param state: Required. The state name. + :type state: str + :param country: Required. The country name. + :type country: str + """ + + _validation = { + 'address_line1': {'required': True}, + 'postal_code': {'required': True}, + 'city': {'required': True}, + 'state': {'required': True}, + '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, + *, + address_line1: str, + postal_code: str, + city: str, + state: str, + country: str, + address_line2: Optional[str] = None, + address_line3: 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 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 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 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}, + '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'}, + '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.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 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 + :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}, + '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'}, + '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.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 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 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 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}, + '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'}, + '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.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 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 + :param description: The Description of the Data Box Edge/Gateway device. + :type description: str + :param model_description: The description of the Data Box Edge/Gateway device model. + :type 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 + :param friendly_name: The Data Box Edge/Gateway device name. + :type 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 + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': True}, + 'serial_number': {'readonly': True}, + 'device_type': {'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}, + } + + _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'}, + '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'}, + } + + def __init__( + self, + *, + location: str, + tags: Optional[Dict[str, str]] = None, + sku: Optional["Sku"] = None, + etag: Optional[str] = None, + data_box_edge_device_status: Optional[Union[str, "DataBoxEdgeDeviceStatus"]] = None, + description: Optional[str] = None, + model_description: Optional[str] = None, + friendly_name: Optional[str] = None, + **kwargs + ): + super(DataBoxEdgeDevice, self).__init__(**kwargs) + self.location = location + self.tags = tags + self.sku = sku + self.etag = etag + self.data_box_edge_device_status = data_box_edge_device_status + self.serial_number = None + self.description = description + self.model_description = model_description + self.device_type = None + self.friendly_name = friendly_name + 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 + + +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 + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'resource_key': {'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'}, + } + + def __init__( + self, + *, + encryption_key_thumbprint: Optional[str] = None, + encryption_key: Optional[str] = None, + **kwargs + ): + super(DataBoxEdgeDeviceExtendedInfo, self).__init__(**kwargs) + self.encryption_key_thumbprint = encryption_key_thumbprint + self.encryption_key = encryption_key + self.resource_key = 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] + """ + + _attribute_map = { + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__( + self, + *, + tags: Optional[Dict[str, str]] = None, + **kwargs + ): + super(DataBoxEdgeDevicePatch, self).__init__(**kwargs) + self.tags = tags + + +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 + :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}, + 'kind': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + } + + _subtype_map = { + 'kind': {'FileEvent': 'FileEventTrigger', 'PeriodicTimerEvent': 'PeriodicTimerEventTrigger'} + } + + def __init__( + self, + **kwargs + ): + super(Trigger, self).__init__(**kwargs) + 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 + :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 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 + :param role_id: Required. Compute role ID. + :type role_id: str + :param share_id: Required. File share ID. + :type share_id: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'kind': {'required': True}, + 'role_id': {'required': True}, + 'share_id': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'custom_context_tag': {'key': 'properties.customContextTag', 'type': 'str'}, + 'role_id': {'key': 'sinkInfo.roleId', 'type': 'str'}, + 'share_id': {'key': 'sourceInfo.shareId', 'type': 'str'}, + } + + def __init__( + self, + *, + role_id: str, + share_id: str, + custom_context_tag: Optional[str] = None, + **kwargs + ): + super(FileEventTrigger, self).__init__(**kwargs) + self.kind = 'FileEvent' # type: str + self.custom_context_tag = custom_context_tag + self.role_id = role_id + self.share_id = share_id + + +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: IoT device authentication info. + :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 Role(ArmBaseModel): + """Compute role. + + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: IoTRole. + + 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". + :type kind: str or ~data_box_edge_management_client.models.RoleTypes + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'kind': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + } + + _subtype_map = { + 'kind': {'IOT': 'IoTRole'} + } + + def __init__( + self, + **kwargs + ): + super(Role, self).__init__(**kwargs) + self.kind = 'Role' # type: str + + +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". + :type kind: str or ~data_box_edge_management_client.models.RoleTypes + :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 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}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + '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]'}, + '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, + 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.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". + :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 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 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 role_type: Role type. Possible values include: "IOT", "ASA", "Functions", "Cognitive". + :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}, + 'role_type': {'readonly': True}, + } + + _attribute_map = { + 'share_id': {'key': 'shareId', 'type': 'str'}, + 'role_id': {'key': 'roleId', 'type': 'str'}, + 'mount_point': {'key': 'mountPoint', '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.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 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}, + 'network_adapters': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'network_adapters': {'key': 'properties.networkAdapters', 'type': '[NetworkAdapter]'}, + } + + def __init__( + self, + **kwargs + ): + super(NetworkSettings, self).__init__(**kwargs) + 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 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] + """ + + _validation = { + 'value': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[Node]'}, + } + + def __init__( + self, + **kwargs + ): + super(NodeList, self).__init__(**kwargs) + self.value = None + + +class Operation(msrest.serialization.Model): + """Operations. + + :param name: Name of the operation. + :type name: str + :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'}, + 'display': {'key': 'display', 'type': 'OperationDisplay'}, + 'origin': {'key': 'origin', 'type': 'str'}, + 'service_specification': {'key': 'properties.serviceSpecification', 'type': 'ServiceSpecification'}, + } + + def __init__( + self, + *, + name: Optional[str] = None, + display: Optional["OperationDisplay"] = None, + origin: Optional[str] = None, + service_specification: Optional["ServiceSpecification"] = None, + **kwargs + ): + super(Operation, self).__init__(**kwargs) + self.name = name + 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 + :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 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 status: Status of the order as per the allowed status types. Possible values include: + "Untracked", "AwaitingFulfilment", "AwaitingPreparation", "AwaitingShipment", "Shipped", + "Arriving", "Delivered", "ReplacementRequested", "LostDevice", "Declined", "ReturnInitiated", + "AwaitingReturnShipment", "ShippedBack", "CollectedAtMicrosoft". + :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 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 = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'order_history': {'readonly': True}, + 'serial_number': {'readonly': True}, + 'delivery_tracking_info': {'readonly': True}, + 'return_tracking_info': {'readonly': True}, + 'update_date_time': {'readonly': True}, + 'additional_order_details': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'contact_information': {'key': 'properties.contactInformation', 'type': 'ContactDetails'}, + 'shipping_address': {'key': 'properties.shippingAddress', 'type': 'Address'}, + '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]'}, + 'status': {'key': 'currentStatus.status', 'type': 'str'}, + 'update_date_time': {'key': 'currentStatus.updateDateTime', 'type': 'iso-8601'}, + 'comments': {'key': 'currentStatus.comments', 'type': 'str'}, + 'additional_order_details': {'key': 'currentStatus.additionalOrderDetails', 'type': '{str}'}, + } + + def __init__( + self, + *, + contact_information: Optional["ContactDetails"] = None, + shipping_address: Optional["Address"] = None, + status: Optional[Union[str, "OrderState"]] = None, + comments: Optional[str] = None, + **kwargs + ): + super(Order, self).__init__(**kwargs) + self.contact_information = contact_information + self.shipping_address = shipping_address + self.order_history = None + self.serial_number = None + self.delivery_tracking_info = None + self.return_tracking_info = None + self.status = status + self.update_date_time = None + self.comments = comments + self.additional_order_details = 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", "AwaitingFulfilment", "AwaitingPreparation", "AwaitingShipment", + "Shipped", "Arriving", "Delivered", "ReplacementRequested", "LostDevice", "Declined", + "ReturnInitiated", "AwaitingReturnShipment", "ShippedBack", "CollectedAtMicrosoft". + :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 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}, + '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'}, + '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.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 + :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 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 + :param role_id: Required. Compute role ID. + :type role_id: str + :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 = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'kind': {'required': True}, + 'role_id': {'required': True}, + 'start_time': {'required': True}, + 'schedule': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'custom_context_tag': {'key': 'properties.customContextTag', 'type': 'str'}, + 'role_id': {'key': 'sinkInfo.roleId', 'type': 'str'}, + 'start_time': {'key': 'sourceInfo.startTime', 'type': 'iso-8601'}, + 'schedule': {'key': 'sourceInfo.schedule', 'type': 'str'}, + 'topic': {'key': 'sourceInfo.topic', 'type': 'str'}, + } + + def __init__( + self, + *, + role_id: str, + start_time: datetime.datetime, + schedule: str, + custom_context_tag: Optional[str] = None, + topic: Optional[str] = None, + **kwargs + ): + super(PeriodicTimerEventTrigger, self).__init__(**kwargs) + self.kind = 'PeriodicTimerEvent' # type: str + self.custom_context_tag = custom_context_tag + self.role_id = role_id + 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 ResourceTypeSku(msrest.serialization.Model): + """SkuInformation object. + + 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". + :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 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. + :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 restrictions: Restrictions of the SKU availability. + :vartype restrictions: list[~data_box_edge_management_client.models.SkuRestriction] + """ + + _validation = { + 'resource_type': {'readonly': True}, + 'name': {'readonly': True}, + 'kind': {'readonly': True}, + 'tier': {'readonly': True}, + 'family': {'readonly': True}, + 'locations': {'readonly': True}, + 'api_versions': {'readonly': True}, + 'location_info': {'readonly': True}, + 'costs': {'readonly': True}, + 'restrictions': {'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'}, + '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]'}, + 'restrictions': {'key': 'restrictions', 'type': '[SkuRestriction]'}, + } + + def __init__( + self, + **kwargs + ): + super(ResourceTypeSku, self).__init__(**kwargs) + self.resource_type = None + self.name = None + self.kind = None + self.tier = None + self.family = None + self.locations = None + self.api_versions = None + self.location_info = None + self.costs = None + self.restrictions = 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 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 + :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}, + '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'}, + '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.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". + :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 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: Restriction of the SKU for the location/zone. + :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 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 ResourceType Sku. + :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 SkuRestriction(msrest.serialization.Model): + """The restrictions because of which SKU cannot be used. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar type: The type of the restriction. + :vartype type: str + :ivar values: The locations where sku is restricted. + :vartype values: list[str] + :ivar reason_code: The SKU restriction reason. Possible values include: + "NotAvailableForSubscription", "QuotaId". + :vartype reason_code: str or ~data_box_edge_management_client.models.SkuRestrictionReasonCode + :ivar restriction_info: Restriction of the SKU for the location/zone. + :vartype restriction_info: ~data_box_edge_management_client.models.SkuRestrictionInfo + """ + + _validation = { + 'type': {'readonly': True}, + 'values': {'readonly': True}, + 'reason_code': {'readonly': True}, + 'restriction_info': {'readonly': True}, + } + + _attribute_map = { + 'type': {'key': 'type', 'type': 'str'}, + 'values': {'key': 'values', 'type': '[str]'}, + 'reason_code': {'key': 'reasonCode', 'type': 'str'}, + 'restriction_info': {'key': 'restrictionInfo', 'type': 'SkuRestrictionInfo'}, + } + + def __init__( + self, + **kwargs + ): + super(SkuRestriction, self).__init__(**kwargs) + self.type = None + self.values = None + self.reason_code = None + self.restriction_info = None + + +class SkuRestrictionInfo(msrest.serialization.Model): + """The restriction info with locations and zones. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar locations: The locations. + :vartype locations: list[str] + :ivar zones: The zones. + :vartype zones: list[str] + """ + + _validation = { + 'locations': {'readonly': True}, + 'zones': {'readonly': True}, + } + + _attribute_map = { + 'locations': {'key': 'locations', 'type': '[str]'}, + 'zones': {'key': 'zones', 'type': '[str]'}, + } + + def __init__( + self, + **kwargs + ): + super(SkuRestrictionInfo, self).__init__(**kwargs) + self.locations = None + self.zones = 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. + + :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 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: 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}, + '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'}, + '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, + *, + description: Optional[str] = None, + storage_account_status: Optional[Union[str, "StorageAccountStatus"]] = None, + data_policy: Optional[Union[str, "DataPolicy"]] = None, + storage_account_credential_id: Optional[str] = None, + **kwargs + ): + super(StorageAccount, self).__init__(**kwargs) + 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 + :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}, + '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'}, + '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.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 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 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 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 + :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 + :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_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 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 total_update_size_in_bytes: The total size of updates available for download in bytes. + :vartype total_update_size_in_bytes: float + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'last_completed_download_job_date_time': {'readonly': True}, + 'last_completed_install_job_date_time': {'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}, + 'total_update_size_in_bytes': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + '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_completed_download_job_date_time': {'key': 'properties.lastCompletedDownloadJobDateTime', 'type': 'iso-8601'}, + 'last_completed_install_job_date_time': {'key': 'properties.lastCompletedInstallJobDateTime', 'type': 'iso-8601'}, + '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]'}, + 'total_update_size_in_bytes': {'key': 'properties.totalUpdateSizeInBytes', 'type': 'float'}, + } + + 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, + **kwargs + ): + super(UpdateSummary, self).__init__(**kwargs) + 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_completed_download_job_date_time = None + self.last_completed_install_job_date_time = 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.total_update_size_in_bytes = 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 + :param encrypted_password: The password details. + :type encrypted_password: ~data_box_edge_management_client.models.AsymmetricEncryptedSecret + :param share_access_rights: List of shares that the user has rights on. This field should not + be specified during user creation. + :type 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}, + 'user_type': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + '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, + share_access_rights: Optional[List["ShareAccessRight"]] = None, + **kwargs + ): + super(User, self).__init__(**kwargs) + self.encrypted_password = encrypted_password + self.share_access_rights = share_access_rights + 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..e9db1d82903 --- /dev/null +++ b/src/databoxedge/azext_databoxedge/vendored_sdks/databoxedge/operations/__init__.py @@ -0,0 +1,43 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from ._operation_operations import OperationOperations +from ._device_operations import DeviceOperations +from ._alert_operations import AlertOperations +from ._bandwidth_schedule_operations import BandwidthScheduleOperations +from ._job_operations import JobOperations +from ._node_operations import NodeOperations +from ._operation_status_operations import OperationStatusOperations +from ._order_operations import OrderOperations +from ._role_operations import RoleOperations +from ._share_operations import ShareOperations +from ._storage_account_credentials_operations import StorageAccountCredentialsOperations +from ._storage_account_operations import StorageAccountOperations +from ._container_operations import ContainerOperations +from ._trigger_operations import TriggerOperations +from ._user_operations import UserOperations +from ._sku_operations import SkuOperations + +__all__ = [ + 'OperationOperations', + 'DeviceOperations', + 'AlertOperations', + 'BandwidthScheduleOperations', + 'JobOperations', + 'NodeOperations', + 'OperationStatusOperations', + 'OrderOperations', + 'RoleOperations', + 'ShareOperations', + 'StorageAccountCredentialsOperations', + 'StorageAccountOperations', + 'ContainerOperations', + 'TriggerOperations', + 'UserOperations', + 'SkuOperations', +] diff --git a/src/databoxedge/azext_databoxedge/vendored_sdks/databoxedge/operations/_alert_operations.py b/src/databoxedge/azext_databoxedge/vendored_sdks/databoxedge/operations/_alert_operations.py new file mode 100644 index 00000000000..a3f04b7572d --- /dev/null +++ b/src/databoxedge/azext_databoxedge/vendored_sdks/databoxedge/operations/_alert_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 AlertOperations(object): + """AlertOperations 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 = "2019-08-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 = "2019-08-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/_bandwidth_schedule_operations.py b/src/databoxedge/azext_databoxedge/vendored_sdks/databoxedge/operations/_bandwidth_schedule_operations.py new file mode 100644 index 00000000000..842685afc63 --- /dev/null +++ b/src/databoxedge/azext_databoxedge/vendored_sdks/databoxedge/operations/_bandwidth_schedule_operations.py @@ -0,0 +1,455 @@ +# 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, List, Optional, TypeVar, Union + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class BandwidthScheduleOperations(object): + """BandwidthScheduleOperations 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 = "2019-08-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 = "2019-08-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 + start, # type: str + stop, # type: str + rate_in_mbps, # type: int + days, # type: List[Union[str, "models.DayOfWeek"]] + **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', {})) + + parameters = models.BandwidthSchedule(start=start, stop=stop, rate_in_mbps=rate_in_mbps, days=days) + api_version = "2019-08-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 + start, # type: str + stop, # type: str + rate_in_mbps, # type: int + days, # type: List[Union[str, "models.DayOfWeek"]] + **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 start: The start time of the schedule in UTC. + :type start: str + :param stop: The stop time of the schedule in UTC. + :type stop: str + :param rate_in_mbps: The bandwidth rate in Mbps. + :type rate_in_mbps: int + :param days: The days of the week when this schedule is applicable. + :type days: list[str or ~data_box_edge_management_client.models.DayOfWeek] + :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, + start=start, + stop=stop, + rate_in_mbps=rate_in_mbps, + days=days, + 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 = "2019-08-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/_container_operations.py b/src/databoxedge/azext_databoxedge/vendored_sdks/databoxedge/operations/_container_operations.py new file mode 100644 index 00000000000..f3fa0c8526d --- /dev/null +++ b/src/databoxedge/azext_databoxedge/vendored_sdks/databoxedge/operations/_container_operations.py @@ -0,0 +1,594 @@ +# 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 ContainerOperations(object): + """ContainerOperations 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 = "2019-08-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 = "2019-08-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 + data_format, # type: Union[str, "models.AzureContainerDataFormat"] + **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', {})) + + container = models.Container(data_format=data_format) + api_version = "2019-08-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 + data_format, # type: Union[str, "models.AzureContainerDataFormat"] + **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 data_format: DataFormat for Container. + :type data_format: str or ~data_box_edge_management_client.models.AzureContainerDataFormat + :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, + data_format=data_format, + 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 = "2019-08-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 = "2019-08-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/_device_operations.py b/src/databoxedge/azext_databoxedge/vendored_sdks/databoxedge/operations/_device_operations.py new file mode 100644 index 00000000000..75fece25359 --- /dev/null +++ b/src/databoxedge/azext_databoxedge/vendored_sdks/databoxedge/operations/_device_operations.py @@ -0,0 +1,1316 @@ +# 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 DeviceOperations(object): + """DeviceOperations 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 = "2019-08-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 = "2019-08-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 = "2019-08-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_initial( + self, + device_name, # type: str + resource_group_name, # type: str + location, # type: str + tags=None, # type: Optional[Dict[str, str]] + sku=None, # type: Optional["models.Sku"] + etag=None, # type: Optional[str] + data_box_edge_device_status=None, # type: Optional[Union[str, "models.DataBoxEdgeDeviceStatus"]] + description=None, # type: Optional[str] + model_description=None, # type: Optional[str] + friendly_name=None, # type: Optional[str] + **kwargs # type: Any + ): + # type: (...) -> "models.DataBoxEdgeDevice" + cls = kwargs.pop('cls', None) # type: ClsType["models.DataBoxEdgeDevice"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + data_box_edge_device = models.DataBoxEdgeDevice(location=location, tags=tags, sku=sku, etag=etag, data_box_edge_device_status=data_box_edge_device_status, description=description, model_description=model_description, friendly_name=friendly_name) + api_version = "2019-08-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(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_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}'} # type: ignore + + def begin_create_or_update( + self, + device_name, # type: str + resource_group_name, # type: str + location, # type: str + tags=None, # type: Optional[Dict[str, str]] + sku=None, # type: Optional["models.Sku"] + etag=None, # type: Optional[str] + data_box_edge_device_status=None, # type: Optional[Union[str, "models.DataBoxEdgeDeviceStatus"]] + description=None, # type: Optional[str] + model_description=None, # type: Optional[str] + friendly_name=None, # type: Optional[str] + **kwargs # type: Any + ): + # type: (...) -> LROPoller["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 location: 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: 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 data_box_edge_device_status: The status of the Data Box Edge/Gateway device. + :type data_box_edge_device_status: str or ~data_box_edge_management_client.models.DataBoxEdgeDeviceStatus + :param description: The Description of the Data Box Edge/Gateway device. + :type description: str + :param model_description: The description of the Data Box Edge/Gateway device model. + :type model_description: str + :param friendly_name: The Data Box Edge/Gateway device name. + :type friendly_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 DataBoxEdgeDevice or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~data_box_edge_management_client.models.DataBoxEdgeDevice] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["models.DataBoxEdgeDevice"] + 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, + location=location, + tags=tags, + sku=sku, + etag=etag, + data_box_edge_device_status=data_box_edge_device_status, + description=description, + model_description=model_description, + friendly_name=friendly_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): + deserialized = self._deserialize('DataBoxEdgeDevice', 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}'} # 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 = "2019-08-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 + tags=None, # type: Optional[Dict[str, str]] + **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 tags: The tags attached to the Data Box Edge/Gateway resource. + :type tags: dict[str, 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', {})) + + parameters = models.DataBoxEdgeDevicePatch(tags=tags) + api_version = "2019-08-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_update_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 = "2019-08-01" + accept = "application/json" + + # Construct URL + url = self._download_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['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_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/downloadUpdates'} # type: ignore + + def begin_download_update( + 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_update_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_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/downloadUpdates'} # 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 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: 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 = "2019-08-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_update_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 = "2019-08-01" + accept = "application/json" + + # Construct URL + url = self._install_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['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_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/installUpdates'} # type: ignore + + def begin_install_update( + 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_update_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_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/installUpdates'} # type: ignore + + def get_network_setting( + 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 = "2019-08-01" + accept = "application/json" + + # Construct URL + url = self.get_network_setting.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_setting.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/networkSettings/default'} # type: ignore + + def _scan_for_update_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 = "2019-08-01" + accept = "application/json" + + # Construct URL + url = self._scan_for_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['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_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/scanForUpdates'} # type: ignore + + def begin_scan_for_update( + 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_update_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_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/scanForUpdates'} # type: ignore + + def _create_or_update_security_setting_initial( + self, + device_name, # type: str + resource_group_name, # type: str + device_admin_password, # type: "models.AsymmetricEncryptedSecret" + **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', {})) + + security_settings = models.SecuritySettings(device_admin_password=device_admin_password) + api_version = "2019-08-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._create_or_update_security_setting_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_setting_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/securitySettings/default/update'} # type: ignore + + def begin_create_or_update_security_setting( + self, + device_name, # type: str + resource_group_name, # type: str + device_admin_password, # type: "models.AsymmetricEncryptedSecret" + **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 device_admin_password: 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 + :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_setting_initial( + device_name=device_name, + resource_group_name=resource_group_name, + device_admin_password=device_admin_password, + 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_setting.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/securitySettings/default/update'} # 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 = "2019-08-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 + certificate, # type: str + authentication_type=None, # type: Optional[Union[str, "models.AuthenticationType"]] + **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 certificate: The base64 encoded certificate raw data. + :type certificate: str + :param authentication_type: The authentication type. + :type authentication_type: str or ~data_box_edge_management_client.models.AuthenticationType + :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', {})) + + parameters = models.UploadCertificateRequest(authentication_type=authentication_type, certificate=certificate) + api_version = "2019-08-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/_job_operations.py b/src/databoxedge/azext_databoxedge/vendored_sdks/databoxedge/operations/_job_operations.py new file mode 100644 index 00000000000..6baa58e8125 --- /dev/null +++ b/src/databoxedge/azext_databoxedge/vendored_sdks/databoxedge/operations/_job_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 JobOperations(object): + """JobOperations 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 = "2019-08-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/_node_operations.py b/src/databoxedge/azext_databoxedge/vendored_sdks/databoxedge/operations/_node_operations.py new file mode 100644 index 00000000000..600c41fcf98 --- /dev/null +++ b/src/databoxedge/azext_databoxedge/vendored_sdks/databoxedge/operations/_node_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 NodeOperations(object): + """NodeOperations 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 = "2019-08-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 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/_operation_operations.py b/src/databoxedge/azext_databoxedge/vendored_sdks/databoxedge/operations/_operation_operations.py new file mode 100644 index 00000000000..b2519681a74 --- /dev/null +++ b/src/databoxedge/azext_databoxedge/vendored_sdks/databoxedge/operations/_operation_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 OperationOperations(object): + """OperationOperations 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 = "2019-08-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/_operation_status_operations.py b/src/databoxedge/azext_databoxedge/vendored_sdks/databoxedge/operations/_operation_status_operations.py new file mode 100644 index 00000000000..d89098ffa6d --- /dev/null +++ b/src/databoxedge/azext_databoxedge/vendored_sdks/databoxedge/operations/_operation_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 OperationStatusOperations(object): + """OperationStatusOperations 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 = "2019-08-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/_order_operations.py b/src/databoxedge/azext_databoxedge/vendored_sdks/databoxedge/operations/_order_operations.py new file mode 100644 index 00000000000..e1e3b86eb75 --- /dev/null +++ b/src/databoxedge/azext_databoxedge/vendored_sdks/databoxedge/operations/_order_operations.py @@ -0,0 +1,445 @@ +# 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 OrderOperations(object): + """OrderOperations 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 = "2019-08-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 = "2019-08-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 + contact_information=None, # type: Optional["models.ContactDetails"] + shipping_address=None, # type: Optional["models.Address"] + status=None, # type: Optional[Union[str, "models.OrderState"]] + comments=None, # type: Optional[str] + **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', {})) + + order = models.Order(contact_information=contact_information, shipping_address=shipping_address, status=status, comments=comments) + api_version = "2019-08-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 + contact_information=None, # type: Optional["models.ContactDetails"] + shipping_address=None, # type: Optional["models.Address"] + status=None, # type: Optional[Union[str, "models.OrderState"]] + comments=None, # type: Optional[str] + **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 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 + :param status: Status of the order as per the allowed status types. + :type status: str or ~data_box_edge_management_client.models.OrderState + :param comments: Comments related to this status change. + :type comments: 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 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, + contact_information=contact_information, + shipping_address=shipping_address, + status=status, + comments=comments, + 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 = "2019-08-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 diff --git a/src/databoxedge/azext_databoxedge/vendored_sdks/databoxedge/operations/_role_operations.py b/src/databoxedge/azext_databoxedge/vendored_sdks/databoxedge/operations/_role_operations.py new file mode 100644 index 00000000000..9ade6e3d935 --- /dev/null +++ b/src/databoxedge/azext_databoxedge/vendored_sdks/databoxedge/operations/_role_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 RoleOperations(object): + """RoleOperations 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 = "2019-08-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 = "2019-08-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 = "2019-08-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 = "2019-08-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/_share_operations.py b/src/databoxedge/azext_databoxedge/vendored_sdks/databoxedge/operations/_share_operations.py new file mode 100644 index 00000000000..b95f830c5e9 --- /dev/null +++ b/src/databoxedge/azext_databoxedge/vendored_sdks/databoxedge/operations/_share_operations.py @@ -0,0 +1,607 @@ +# 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, List, Optional, TypeVar, Union + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class ShareOperations(object): + """ShareOperations 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 = "2019-08-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 = "2019-08-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_status, # type: Union[str, "models.ShareStatus"] + monitoring_status, # type: Union[str, "models.MonitoringStatus"] + access_protocol, # type: Union[str, "models.ShareAccessProtocol"] + description=None, # type: Optional[str] + azure_container_info=None, # type: Optional["models.AzureContainerInfo"] + user_access_rights=None, # type: Optional[List["models.UserAccessRight"]] + client_access_rights=None, # type: Optional[List["models.ClientAccessRight"]] + refresh_details=None, # type: Optional["models.RefreshDetails"] + data_policy=None, # type: Optional[Union[str, "models.DataPolicy"]] + **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', {})) + + share = models.Share(description=description, share_status=share_status, monitoring_status=monitoring_status, azure_container_info=azure_container_info, access_protocol=access_protocol, user_access_rights=user_access_rights, client_access_rights=client_access_rights, refresh_details=refresh_details, data_policy=data_policy) + api_version = "2019-08-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_status, # type: Union[str, "models.ShareStatus"] + monitoring_status, # type: Union[str, "models.MonitoringStatus"] + access_protocol, # type: Union[str, "models.ShareAccessProtocol"] + description=None, # type: Optional[str] + azure_container_info=None, # type: Optional["models.AzureContainerInfo"] + user_access_rights=None, # type: Optional[List["models.UserAccessRight"]] + client_access_rights=None, # type: Optional[List["models.ClientAccessRight"]] + refresh_details=None, # type: Optional["models.RefreshDetails"] + data_policy=None, # type: Optional[Union[str, "models.DataPolicy"]] + **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_status: Current status of the share. + :type share_status: str or ~data_box_edge_management_client.models.ShareStatus + :param monitoring_status: Current monitoring status of the share. + :type monitoring_status: str or ~data_box_edge_management_client.models.MonitoringStatus + :param access_protocol: Access protocol to be used by the share. + :type access_protocol: str or ~data_box_edge_management_client.models.ShareAccessProtocol + :param description: Description for the share. + :type description: str + :param azure_container_info: Azure container mapping for the share. + :type azure_container_info: ~data_box_edge_management_client.models.AzureContainerInfo + :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 + :param data_policy: Data policy of the share. + :type data_policy: str or ~data_box_edge_management_client.models.DataPolicy + :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_status=share_status, + monitoring_status=monitoring_status, + access_protocol=access_protocol, + description=description, + azure_container_info=azure_container_info, + user_access_rights=user_access_rights, + client_access_rights=client_access_rights, + refresh_details=refresh_details, + data_policy=data_policy, + 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 = "2019-08-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 = "2019-08-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/_sku_operations.py b/src/databoxedge/azext_databoxedge/vendored_sdks/databoxedge/operations/_sku_operations.py new file mode 100644 index 00000000000..5998d462d91 --- /dev/null +++ b/src/databoxedge/azext_databoxedge/vendored_sdks/databoxedge/operations/_sku_operations.py @@ -0,0 +1,120 @@ +# 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 SkuOperations(object): + """SkuOperations 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, + filter=None, # type: Optional[str] + **kwargs # type: Any + ): + # type: (...) -> Iterable["models.SkuInformationList"] + """List all the available Skus in the region and information related to them. + + List all the available Skus in the region and information related to them. + + :param filter: Specify $filter='location eq :code:``' to filter on location. + :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 SkuInformationList or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~data_box_edge_management_client.models.SkuInformationList] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.SkuInformationList"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2019-08-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + if 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('SkuInformationList', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.DataBoxEdge/skus'} # 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..238b205d04c --- /dev/null +++ b/src/databoxedge/azext_databoxedge/vendored_sdks/databoxedge/operations/_storage_account_credentials_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 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 = "2019-08-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 = "2019-08-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 + alias, # type: str + ssl_status, # type: Union[str, "models.SSLStatus"] + account_type, # type: Union[str, "models.AccountType"] + user_name=None, # type: Optional[str] + account_key=None, # type: Optional["models.AsymmetricEncryptedSecret"] + connection_string=None, # type: Optional[str] + blob_domain_name=None, # type: Optional[str] + storage_account_id=None, # type: Optional[str] + **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', {})) + + storage_account_credential = models.StorageAccountCredential(alias=alias, user_name=user_name, account_key=account_key, connection_string=connection_string, ssl_status=ssl_status, blob_domain_name=blob_domain_name, account_type=account_type, storage_account_id=storage_account_id) + api_version = "2019-08-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 + alias, # type: str + ssl_status, # type: Union[str, "models.SSLStatus"] + account_type, # type: Union[str, "models.AccountType"] + user_name=None, # type: Optional[str] + account_key=None, # type: Optional["models.AsymmetricEncryptedSecret"] + connection_string=None, # type: Optional[str] + blob_domain_name=None, # type: Optional[str] + storage_account_id=None, # type: Optional[str] + **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 alias: Alias for the storage account. + :type alias: str + :param ssl_status: Signifies whether SSL needs to be enabled or not. + :type ssl_status: str or ~data_box_edge_management_client.models.SSLStatus + :param account_type: Type of storage accessed on the storage account. + :type account_type: str or ~data_box_edge_management_client.models.AccountType + :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 blob_domain_name: Blob end point for private clouds. + :type blob_domain_name: str + :param storage_account_id: Id of the storage account. + :type storage_account_id: 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 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, + alias=alias, + ssl_status=ssl_status, + account_type=account_type, + user_name=user_name, + account_key=account_key, + connection_string=connection_string, + blob_domain_name=blob_domain_name, + storage_account_id=storage_account_id, + 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 = "2019-08-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_account_operations.py b/src/databoxedge/azext_databoxedge/vendored_sdks/databoxedge/operations/_storage_account_operations.py new file mode 100644 index 00000000000..301ad000ad9 --- /dev/null +++ b/src/databoxedge/azext_databoxedge/vendored_sdks/databoxedge/operations/_storage_account_operations.py @@ -0,0 +1,461 @@ +# 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 StorageAccountOperations(object): + """StorageAccountOperations 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 storage accounts in a Data Box Edge/Data Box Gateway device. + + Lists all the storage accounts 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 = "2019-08-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 = "2019-08-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 + description=None, # type: Optional[str] + storage_account_status=None, # type: Optional[Union[str, "models.StorageAccountStatus"]] + data_policy=None, # type: Optional[Union[str, "models.DataPolicy"]] + storage_account_credential_id=None, # type: Optional[str] + **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', {})) + + storage_account = models.StorageAccount(description=description, storage_account_status=storage_account_status, data_policy=data_policy, storage_account_credential_id=storage_account_credential_id) + api_version = "2019-08-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 + description=None, # type: Optional[str] + storage_account_status=None, # type: Optional[Union[str, "models.StorageAccountStatus"]] + data_policy=None, # type: Optional[Union[str, "models.DataPolicy"]] + storage_account_credential_id=None, # type: Optional[str] + **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 description: Description for the storage Account. + :type description: str + :param storage_account_status: Current status of the storage account. + :type storage_account_status: str or ~data_box_edge_management_client.models.StorageAccountStatus + :param data_policy: Data policy of the storage Account. + :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 + :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, + description=description, + storage_account_status=storage_account_status, + data_policy=data_policy, + storage_account_credential_id=storage_account_credential_id, + 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 = "2019-08-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/_trigger_operations.py b/src/databoxedge/azext_databoxedge/vendored_sdks/databoxedge/operations/_trigger_operations.py new file mode 100644 index 00000000000..d57792bdd30 --- /dev/null +++ b/src/databoxedge/azext_databoxedge/vendored_sdks/databoxedge/operations/_trigger_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 TriggerOperations(object): + """TriggerOperations 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 = "2019-08-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 = "2019-08-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 = "2019-08-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 = "2019-08-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/_user_operations.py b/src/databoxedge/azext_databoxedge/vendored_sdks/databoxedge/operations/_user_operations.py new file mode 100644 index 00000000000..b809c1a8228 --- /dev/null +++ b/src/databoxedge/azext_databoxedge/vendored_sdks/databoxedge/operations/_user_operations.py @@ -0,0 +1,457 @@ +# 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, List, Optional, TypeVar, Union + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class UserOperations(object): + """UserOperations 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='UserType 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 = "2019-08-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 = "2019-08-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, # type: Union[str, "models.UserType"] + encrypted_password=None, # type: Optional["models.AsymmetricEncryptedSecret"] + share_access_rights=None, # type: Optional[List["models.ShareAccessRight"]] + **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', {})) + + user = models.User(encrypted_password=encrypted_password, share_access_rights=share_access_rights, user_type=user_type) + api_version = "2019-08-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, # type: Union[str, "models.UserType"] + encrypted_password=None, # type: Optional["models.AsymmetricEncryptedSecret"] + share_access_rights=None, # type: Optional[List["models.ShareAccessRight"]] + **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_type: Type of the user. + :type user_type: str or ~data_box_edge_management_client.models.UserType + :param encrypted_password: The password details. + :type encrypted_password: ~data_box_edge_management_client.models.AsymmetricEncryptedSecret + :param share_access_rights: List of shares that the user has rights on. This field should not + be specified during user creation. + :type share_access_rights: list[~data_box_edge_management_client.models.ShareAccessRight] + :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_type=user_type, + encrypted_password=encrypted_password, + share_access_rights=share_access_rights, + 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 = "2019-08-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..7eea70e3eed --- /dev/null +++ b/src/databoxedge/report.md @@ -0,0 +1,1128 @@ +# Azure CLI Module Creation Report + +## EXTENSION +|CLI Extension|Command Groups| +|---------|------------| +|az databoxedge|[groups](#CommandGroups) + +## GROUPS +### Command groups in `az databoxedge` extension +|CLI Command Group|Group Swagger name|Commands| +|---------|------------|--------| +|az databoxedge device|Devices|[commands](#CommandsInDevices)| +|az databoxedge alert|Alerts|[commands](#CommandsInAlerts)| +|az databoxedge bandwidth-schedule|BandwidthSchedules|[commands](#CommandsInBandwidthSchedules)| +|az databoxedge 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 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 user|Users|[commands](#CommandsInUsers)| +|az databoxedge sku|Skus|[commands](#CommandsInSkus)| + +## COMMANDS +### Commands in `az databoxedge alert` group +|CLI Command|Operation Swagger name|Parameters|Examples| +|---------|------------|--------|-----------| +|[az databoxedge alert list](#AlertsListByDataBoxEdgeDevice)|ListByDataBoxEdgeDevice|[Parameters](#ParametersAlertsListByDataBoxEdgeDevice)|[Example](#ExamplesAlertsListByDataBoxEdgeDevice)| +|[az databoxedge alert show](#AlertsGet)|Get|[Parameters](#ParametersAlertsGet)|[Example](#ExamplesAlertsGet)| + +### Commands in `az databoxedge bandwidth-schedule` group +|CLI Command|Operation Swagger name|Parameters|Examples| +|---------|------------|--------|-----------| +|[az databoxedge bandwidth-schedule list](#BandwidthSchedulesListByDataBoxEdgeDevice)|ListByDataBoxEdgeDevice|[Parameters](#ParametersBandwidthSchedulesListByDataBoxEdgeDevice)|[Example](#ExamplesBandwidthSchedulesListByDataBoxEdgeDevice)| +|[az databoxedge bandwidth-schedule show](#BandwidthSchedulesGet)|Get|[Parameters](#ParametersBandwidthSchedulesGet)|[Example](#ExamplesBandwidthSchedulesGet)| +|[az databoxedge bandwidth-schedule create](#BandwidthSchedulesCreateOrUpdate#Create)|CreateOrUpdate#Create|[Parameters](#ParametersBandwidthSchedulesCreateOrUpdate#Create)|[Example](#ExamplesBandwidthSchedulesCreateOrUpdate#Create)| +|[az databoxedge bandwidth-schedule update](#BandwidthSchedulesCreateOrUpdate#Update)|CreateOrUpdate#Update|[Parameters](#ParametersBandwidthSchedulesCreateOrUpdate#Update)|Not Found| +|[az databoxedge bandwidth-schedule delete](#BandwidthSchedulesDelete)|Delete|[Parameters](#ParametersBandwidthSchedulesDelete)|[Example](#ExamplesBandwidthSchedulesDelete)| + +### Commands in `az databoxedge 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 get-extended-information](#DevicesGetExtendedInformation)|GetExtendedInformation|[Parameters](#ParametersDevicesGetExtendedInformation)|[Example](#ExamplesDevicesGetExtendedInformation)| +|[az databoxedge device get-network-setting](#DevicesGetNetworkSettings)|GetNetworkSettings|[Parameters](#ParametersDevicesGetNetworkSettings)|[Example](#ExamplesDevicesGetNetworkSettings)| +|[az databoxedge device get-update-summary](#DevicesGetUpdateSummary)|GetUpdateSummary|[Parameters](#ParametersDevicesGetUpdateSummary)|[Example](#ExamplesDevicesGetUpdateSummary)| +|[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 upload-certificate](#DevicesUploadCertificate)|UploadCertificate|[Parameters](#ParametersDevicesUploadCertificate)|[Example](#ExamplesDevicesUploadCertificate)| + +### 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 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)| + +### 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 sku` group +|CLI Command|Operation Swagger name|Parameters|Examples| +|---------|------------|--------|-----------| +|[az databoxedge sku list](#SkusList)|List|[Parameters](#ParametersSkusList)|[Example](#ExamplesSkusList)| + +### 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 create](#StorageAccountsCreateOrUpdate#Create)|CreateOrUpdate#Create|[Parameters](#ParametersStorageAccountsCreateOrUpdate#Create)|[Example](#ExamplesStorageAccountsCreateOrUpdate#Create)| +|[az databoxedge storage-account update](#StorageAccountsCreateOrUpdate#Update)|CreateOrUpdate#Update|[Parameters](#ParametersStorageAccountsCreateOrUpdate#Update)|Not Found| +|[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 create](#StorageAccountCredentialsCreateOrUpdate#Create)|CreateOrUpdate#Create|[Parameters](#ParametersStorageAccountCredentialsCreateOrUpdate#Create)|[Example](#ExamplesStorageAccountCredentialsCreateOrUpdate#Create)| +|[az databoxedge storage-account-credentials update](#StorageAccountCredentialsCreateOrUpdate#Update)|CreateOrUpdate#Update|[Parameters](#ParametersStorageAccountCredentialsCreateOrUpdate#Update)|Not Found| +|[az databoxedge storage-account-credentials delete](#StorageAccountCredentialsDelete)|Delete|[Parameters](#ParametersStorageAccountCredentialsDelete)|[Example](#ExamplesStorageAccountCredentialsDelete)| + +### 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 alert` +#### Command `az databoxedge alert list` + +##### Example +``` +az databoxedge alert list --device-name "testedgedevice" --resource-group "GroupForEdgeAutomation" +``` +##### Parameters +|Option|Type|Description|Path (SDK)|Swagger name| +|------|----|-----------|----------|------------| +|**--device-name**|string|The device name.|device_name|deviceName| +|**--resource-group-name**|string|The resource group name.|resource_group_name|resourceGroupName| + +#### Command `az databoxedge alert show` + +##### Example +``` +az databoxedge alert show --name "159a00c7-8543-4343-9435-263ac87df3bb" --device-name "testedgedevice" \ +--resource-group "GroupForEdgeAutomation" +``` +##### Parameters +|Option|Type|Description|Path (SDK)|Swagger name| +|------|----|-----------|----------|------------| +|**--device-name**|string|The device name.|device_name|deviceName| +|**--name**|string|The alert name.|name|name| +|**--resource-group-name**|string|The resource group name.|resource_group_name|resourceGroupName| + +### group `az databoxedge bandwidth-schedule` +#### Command `az databoxedge bandwidth-schedule list` + +##### Example +``` +az databoxedge bandwidth-schedule list --device-name "testedgedevice" --resource-group "GroupForEdgeAutomation" +``` +##### Parameters +|Option|Type|Description|Path (SDK)|Swagger name| +|------|----|-----------|----------|------------| +|**--device-name**|string|The device name.|device_name|deviceName| +|**--resource-group-name**|string|The resource group name.|resource_group_name|resourceGroupName| + +#### Command `az databoxedge bandwidth-schedule show` + +##### Example +``` +az databoxedge bandwidth-schedule show --name "bandwidth-1" --device-name "testedgedevice" --resource-group \ +"GroupForEdgeAutomation" +``` +##### Parameters +|Option|Type|Description|Path (SDK)|Swagger name| +|------|----|-----------|----------|------------| +|**--device-name**|string|The device name.|device_name|deviceName| +|**--name**|string|The bandwidth schedule name.|name|name| +|**--resource-group-name**|string|The resource group name.|resource_group_name|resourceGroupName| + +#### Command `az databoxedge bandwidth-schedule create` + +##### Example +``` +az databoxedge bandwidth-schedule create --name "bandwidth-1" --device-name "testedgedevice" --days "Sunday" --days \ +"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=:code:`` to populate the next page in the list.|expand|$expand| + +#### Command `az databoxedge device list` + +##### Example +``` +az databoxedge device list +``` +##### Parameters +|Option|Type|Description|Path (SDK)|Swagger name| +|------|----|-----------|----------|------------| +#### Command `az databoxedge device show` + +##### Example +``` +az databoxedge device show --name "testedgedevice" --resource-group "GroupForEdgeAutomation" +``` +##### Parameters +|Option|Type|Description|Path (SDK)|Swagger name| +|------|----|-----------|----------|------------| +|**--device-name**|string|The device name.|device_name|deviceName| +|**--resource-group-name**|string|The resource group name.|resource_group_name|resourceGroupName| + +#### Command `az databoxedge device create` + +##### Example +``` +az databoxedge device create --location "eastus" --sku name="Edge" tier="Standard" --name "testedgedevice" \ +--resource-group "GroupForEdgeAutomation" +``` +##### Parameters +|Option|Type|Description|Path (SDK)|Swagger name| +|------|----|-----------|----------|------------| +|**--device-name**|string|The device name.|device_name|deviceName| +|**--resource-group-name**|string|The resource group name.|resource_group_name|resourceGroupName| +|**--location**|string|The location of the device. This is a supported and registered Azure geographical region (for example, West US, East US, or Southeast Asia). The geographical region of a device cannot be changed once it is created, but if an identical geographical region is specified on update, the request will succeed.|location|location| +|**--tags**|dictionary|The list of tags that describe the device. These tags can be used to view and group this device (across resource groups).|tags|tags| +|**--sku**|object|The SKU type.|sku|sku| +|**--etag**|string|The etag for the devices.|etag|etag| +|**--data-box-edge-device-status**|choice|The status of the Data Box Edge/Gateway device.|data_box_edge_device_status|dataBoxEdgeDeviceStatus| +|**--description**|string|The Description of the Data Box Edge/Gateway device.|description|description| +|**--model-description**|string|The description of the Data Box Edge/Gateway device model.|model_description|modelDescription| +|**--friendly-name**|string|The Data Box Edge/Gateway device name.|friendly_name|friendlyName| + +#### Command `az databoxedge device update` + +##### Example +``` +az databoxedge device update --name "testedgedevice" --tags Key1="value1" Key2="value2" --resource-group \ +"GroupForEdgeAutomation" +``` +##### Parameters +|Option|Type|Description|Path (SDK)|Swagger name| +|------|----|-----------|----------|------------| +|**--device-name**|string|The device name.|device_name|deviceName| +|**--resource-group-name**|string|The resource group name.|resource_group_name|resourceGroupName| +|**--tags**|dictionary|The tags attached to the Data Box Edge/Gateway resource.|tags|tags| + +#### Command `az databoxedge device delete` + +##### Example +``` +az databoxedge device delete --name "testedgedevice" --resource-group "GroupForEdgeAutomation" +``` +##### Parameters +|Option|Type|Description|Path (SDK)|Swagger name| +|------|----|-----------|----------|------------| +|**--device-name**|string|The device name.|device_name|deviceName| +|**--resource-group-name**|string|The resource group name.|resource_group_name|resourceGroupName| + +#### Command `az databoxedge device 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="7DCBDFC44ED968D232C9A998FC105B5C70E84\ +BE0" value="jJ5MvXa/AEWvwxviS92uCjatCXeyLYTy8jx/k105MjQRXT7i6Do8qpEcQ8d+OBbwmQTnwKW0CYyzzVRCc0uZcPCf6PsWtP4l6wvcKGAP66P\ +wK68eEkTUOmp+wUHc4hk02kWmTWeAjBZkuDBP3xK1RnZo95g2RE4i1UgKNP5BEKCLd71O104DW3AWW41mh9XLWNOaxw+VjQY7wmvlE6XkvpkMhcGuha2u7l\ +x8zi9ZkcMvJVYDYK36Fb/K3KhBAmDjjDmVq04jtBlcSTXQObt0nlj4BwGGtdrpeIpr67zqr5i3cPm6e6AleIaIhp6sI/uyGSMiT3oev2eg49u2ii7kVA==" +``` +##### 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 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 get-network-setting` + +##### Example +``` +az databoxedge device get-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 get-update-summary` + +##### Example +``` +az databoxedge device get-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 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 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 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 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| +|**--current-status-status**|choice|Status of the order as per the allowed status types.|status|status| +|**--current-status-comments**|string|Comments related to this status change.|comments|comments| + +#### 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| +|**--current-status-status**|choice|Status of the order as per the allowed status types.|status|status| +|**--current-status-comments**|string|Comments related to this status change.|comments|comments| + +#### 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| + +### 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 sku` +#### Command `az databoxedge sku list` + +##### Example +``` +az databoxedge sku list +``` +##### Parameters +|Option|Type|Description|Path (SDK)|Swagger name| +|------|----|-----------|----------|------------| +|**--filter**|string|Specify $filter='location eq :code:``' to filter on location.|filter|$filter| + +### 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 create` + +##### Example +``` +az databoxedge storage-account create --device-name "testedgedevice" --resource-group "GroupForEdgeAutomation" \ +--description "It\'s an awesome storage account" --data-policy "Cloud" --storage-account-credential-id \ +"/subscriptions/4385cf00-2d3a-425a-832f-f4285b1c9dce/resourceGroups/GroupForDataBoxEdgeAutomation/providers/Microsoft.D\ +ataBoxEdge/dataBoxEdgeDevices/testedgedevice/storageAccountCredentials/cisbvt" --storage-account-status "OK" --name \ +"blobstorageaccount1" +``` +##### 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| +|**--description**|string|Description for the storage Account.|description|description| +|**--storage-account-status**|choice|Current status of the storage account|storage_account_status|storageAccountStatus| +|**--data-policy**|choice|Data policy of the storage Account.|data_policy|dataPolicy| +|**--storage-account-credential-id**|string|Storage Account Credential Id|storage_account_credential_id|storageAccountCredentialId| + +#### Command `az databoxedge storage-account update` + +##### 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| +|**--description**|string|Description for the storage Account.|description|description| +|**--storage-account-status**|choice|Current status of the storage account|storage_account_status|storageAccountStatus| +|**--data-policy**|choice|Data policy of the storage Account.|data_policy|dataPolicy| +|**--storage-account-credential-id**|string|Storage Account Credential Id|storage_account_credential_id|storageAccountCredentialId| + +#### 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 create` + +##### Example +``` +az databoxedge storage-account-credentials create --name "sac1" --device-name "testedgedevice" --resource-group \ +"GroupForEdgeAutomation" --account-key encryption-algorithm="AES256" encryption-cert-thumbprint="2A9D8D6BE51574B5461230\ +AEF02F162C5F01AD31" value="lAeZEYi6rNP1/EyNaVUYmTSZEYyaIaWmwUsGwek0+xiZj54GM9Ue9/UA2ed/ClC03wuSit2XzM/cLRU5eYiFBwks23rG\ +wiQOr3sruEL2a74EjPD050xYjA6M1I2hu/w2yjVHhn5j+DbXS4Xzi+rHHNZK3DgfDO3PkbECjPck+PbpSBjy9+6Mrjcld5DIZhUAeMlMHrFlg+WKRKB14o/\ +og56u5/xX6WKlrMLEQ+y6E18dUwvWs2elTNoVO8PBE8SM/CfooX4AMNvaNdSObNBPdP+F6Lzc556nFNWXrBLRt0vC7s9qTiVRO4x/qCNaK/B4y7IqXMllwQ\ +Ff4Np9UQ2ECA==" --account-type "BlobStorage" --alias "sac1" --ssl-status "Disabled" --user-name "cisbvt" +``` +##### 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| +|**--alias**|string|Alias for the storage account.|alias|alias| +|**--ssl-status**|choice|Signifies whether SSL needs to be enabled or not.|ssl_status|sslStatus| +|**--account-type**|choice|Type of storage accessed on the storage account.|account_type|accountType| +|**--user-name**|string|Username for the storage account.|user_name|userName| +|**--account-key**|object|Encrypted storage key.|account_key|accountKey| +|**--connection-string**|string|Connection string for the storage account. Use this string if username and account key are not specified.|connection_string|connectionString| +|**--blob-domain-name**|string|Blob end point for private clouds.|blob_domain_name|blobDomainName| +|**--storage-account-id**|string|Id of the storage account.|storage_account_id|storageAccountId| + +#### Command `az databoxedge storage-account-credentials update` + +##### 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| +|**--alias**|string|Alias for the storage account.|alias|alias| +|**--ssl-status**|choice|Signifies whether SSL needs to be enabled or not.|ssl_status|sslStatus| +|**--account-type**|choice|Type of storage accessed on the storage account.|account_type|accountType| +|**--user-name**|string|Username for the storage account.|user_name|userName| +|**--account-key**|object|Encrypted storage key.|account_key|accountKey| +|**--connection-string**|string|Connection string for the storage account. Use this string if username and account key are not specified.|connection_string|connectionString| +|**--blob-domain-name**|string|Blob end point for private clouds.|blob_domain_name|blobDomainName| +|**--storage-account-id**|string|Id of the storage account.|storage_account_id|storageAccountId| + +#### 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 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 :code:``' 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" +``` +##### 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='UserType eq :code:``' 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="Password@1" --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| +|**--share-access-rights**|array|List of shares that the user has rights on. This field should not be specified during user creation.|share_access_rights|shareAccessRights| + +#### 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| +|**--share-access-rights**|array|List of shares that the user has rights on. This field should not be specified during user creation.|share_access_rights|shareAccessRights| + +#### 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']}, +)