From ea7182197b41c68315509c45315bdf915c33dc0e Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Thu, 22 Apr 2021 08:26:19 +0000 Subject: [PATCH] CodeGen from PR 14063 in Azure/azure-rest-api-specs databoxedge readme modification (#14063) Co-authored-by: Yan Zhang (WICRESOFT NORTH AMERICA LTD) --- .../azure-mgmt-databoxedge/MANIFEST.in | 1 + .../azure-mgmt-databoxedge/_meta.json | 8 + .../azure/mgmt/datab/__init__.py | 16 + .../azure/mgmt/datab/_configuration.py | 70 + .../datab/_data_box_edge_management_client.py | 174 + .../azure/mgmt/datab/_metadata.json | 120 + .../azure/mgmt/datab/aio/__init__.py | 10 + .../azure/mgmt/datab/aio/_configuration.py | 66 + .../aio/_data_box_edge_management_client.py | 167 + .../mgmt/datab/aio/operations/__init__.py | 47 + .../aio/operations/_addons_operations.py | 450 ++ .../aio/operations/_alerts_operations.py | 180 + .../operations/_available_skus_operations.py | 110 + .../_bandwidth_schedules_operations.py | 428 ++ .../aio/operations/_containers_operations.py | 580 ++ .../aio/operations/_devices_operations.py | 1363 ++++ .../datab/aio/operations/_jobs_operations.py | 105 + .../_monitoring_config_operations.py | 440 ++ .../datab/aio/operations/_nodes_operations.py | 116 + .../mgmt/datab/aio/operations/_operations.py | 106 + .../_operations_status_operations.py | 105 + .../aio/operations/_orders_operations.py | 478 ++ .../datab/aio/operations/_roles_operations.py | 428 ++ .../aio/operations/_shares_operations.py | 551 ++ ..._storage_account_credentials_operations.py | 430 ++ .../_storage_accounts_operations.py | 434 ++ .../aio/operations/_triggers_operations.py | 434 ++ .../datab/aio/operations/_users_operations.py | 434 ++ .../azure/mgmt/datab/models/__init__.py | 487 ++ .../_data_box_edge_management_client_enums.py | 557 ++ .../azure/mgmt/datab/models/_models.py | 5119 +++++++++++++++ .../azure/mgmt/datab/models/_models_py3.py | 5435 ++++++++++++++++ .../azure/mgmt/datab/operations/__init__.py | 47 + .../datab/operations/_addons_operations.py | 460 ++ .../datab/operations/_alerts_operations.py | 186 + .../operations/_available_skus_operations.py | 115 + .../_bandwidth_schedules_operations.py | 438 ++ .../operations/_containers_operations.py | 592 ++ .../datab/operations/_devices_operations.py | 1389 +++++ .../mgmt/datab/operations/_jobs_operations.py | 110 + .../_monitoring_config_operations.py | 450 ++ .../datab/operations/_nodes_operations.py | 121 + .../mgmt/datab/operations/_operations.py | 111 + .../_operations_status_operations.py | 110 + .../datab/operations/_orders_operations.py | 489 ++ .../datab/operations/_roles_operations.py | 438 ++ .../datab/operations/_shares_operations.py | 563 ++ ..._storage_account_credentials_operations.py | 440 ++ .../_storage_accounts_operations.py | 444 ++ .../datab/operations/_triggers_operations.py | 444 ++ .../datab/operations/_users_operations.py | 444 ++ .../azure/mgmt/datab/py.typed | 1 + .../azure/mgmt/databoxedge/_configuration.py | 7 +- .../_data_box_edge_management_client.py | 223 +- .../mgmt/databoxedge/aio/_configuration.py | 9 +- .../aio/_data_box_edge_management_client.py | 225 +- .../azure/mgmt/databoxedge/models.py | 1 + .../_data_box_edge_management_client.py | 43 +- .../databoxedge/v2019_03_01/_metadata.json | 62 +- .../aio/_data_box_edge_management_client.py | 42 +- .../aio/operations/_alerts_operations.py | 6 +- .../_bandwidth_schedules_operations.py | 18 +- .../aio/operations/_devices_operations.py | 52 +- .../aio/operations/_jobs_operations.py | 4 +- .../v2019_03_01/aio/operations/_operations.py | 4 +- .../_operations_status_operations.py | 4 +- .../aio/operations/_orders_operations.py | 18 +- .../aio/operations/_roles_operations.py | 18 +- .../aio/operations/_shares_operations.py | 22 +- ..._storage_account_credentials_operations.py | 18 +- .../aio/operations/_triggers_operations.py | 18 +- .../aio/operations/_users_operations.py | 18 +- .../databoxedge/v2019_03_01/models/_models.py | 195 +- .../v2019_03_01/models/_models_py3.py | 195 +- .../operations/_alerts_operations.py | 6 +- .../_bandwidth_schedules_operations.py | 18 +- .../operations/_devices_operations.py | 52 +- .../operations/_jobs_operations.py | 4 +- .../v2019_03_01/operations/_operations.py | 4 +- .../_operations_status_operations.py | 4 +- .../operations/_orders_operations.py | 18 +- .../operations/_roles_operations.py | 18 +- .../operations/_shares_operations.py | 22 +- ..._storage_account_credentials_operations.py | 18 +- .../operations/_triggers_operations.py | 18 +- .../operations/_users_operations.py | 18 +- .../_data_box_edge_management_client.py | 45 +- .../databoxedge/v2019_07_01/_metadata.json | 62 +- .../aio/_data_box_edge_management_client.py | 44 +- .../aio/operations/_alerts_operations.py | 6 +- .../_bandwidth_schedules_operations.py | 18 +- .../aio/operations/_devices_operations.py | 52 +- .../aio/operations/_jobs_operations.py | 4 +- .../aio/operations/_nodes_operations.py | 4 +- .../v2019_07_01/aio/operations/_operations.py | 4 +- .../_operations_status_operations.py | 4 +- .../aio/operations/_orders_operations.py | 18 +- .../aio/operations/_roles_operations.py | 18 +- .../aio/operations/_shares_operations.py | 22 +- ..._storage_account_credentials_operations.py | 18 +- .../aio/operations/_triggers_operations.py | 18 +- .../aio/operations/_users_operations.py | 18 +- .../databoxedge/v2019_07_01/models/_models.py | 199 +- .../v2019_07_01/models/_models_py3.py | 199 +- .../operations/_alerts_operations.py | 6 +- .../_bandwidth_schedules_operations.py | 18 +- .../operations/_devices_operations.py | 52 +- .../operations/_jobs_operations.py | 4 +- .../operations/_nodes_operations.py | 4 +- .../v2019_07_01/operations/_operations.py | 4 +- .../_operations_status_operations.py | 4 +- .../operations/_orders_operations.py | 18 +- .../operations/_roles_operations.py | 18 +- .../operations/_shares_operations.py | 22 +- ..._storage_account_credentials_operations.py | 18 +- .../operations/_triggers_operations.py | 18 +- .../operations/_users_operations.py | 18 +- .../_data_box_edge_management_client.py | 51 +- .../databoxedge/v2019_08_01/_metadata.json | 62 +- .../aio/_data_box_edge_management_client.py | 50 +- .../aio/operations/_alerts_operations.py | 6 +- .../_bandwidth_schedules_operations.py | 18 +- .../aio/operations/_containers_operations.py | 22 +- .../aio/operations/_devices_operations.py | 52 +- .../aio/operations/_jobs_operations.py | 4 +- .../aio/operations/_nodes_operations.py | 4 +- .../v2019_08_01/aio/operations/_operations.py | 4 +- .../_operations_status_operations.py | 4 +- .../aio/operations/_orders_operations.py | 18 +- .../aio/operations/_roles_operations.py | 18 +- .../aio/operations/_shares_operations.py | 22 +- .../aio/operations/_skus_operations.py | 4 +- ..._storage_account_credentials_operations.py | 18 +- .../_storage_accounts_operations.py | 18 +- .../aio/operations/_triggers_operations.py | 18 +- .../aio/operations/_users_operations.py | 18 +- .../databoxedge/v2019_08_01/models/_models.py | 233 +- .../v2019_08_01/models/_models_py3.py | 233 +- .../operations/_alerts_operations.py | 6 +- .../_bandwidth_schedules_operations.py | 18 +- .../operations/_containers_operations.py | 22 +- .../operations/_devices_operations.py | 52 +- .../operations/_jobs_operations.py | 4 +- .../operations/_nodes_operations.py | 4 +- .../v2019_08_01/operations/_operations.py | 4 +- .../_operations_status_operations.py | 4 +- .../operations/_orders_operations.py | 18 +- .../operations/_roles_operations.py | 18 +- .../operations/_shares_operations.py | 22 +- .../operations/_skus_operations.py | 4 +- ..._storage_account_credentials_operations.py | 18 +- .../_storage_accounts_operations.py | 18 +- .../operations/_triggers_operations.py | 18 +- .../operations/_users_operations.py | 18 +- .../_data_box_edge_management_client.py | 53 +- .../v2020_05_01_preview/_metadata.json | 62 +- .../aio/_data_box_edge_management_client.py | 52 +- .../aio/operations/_alerts_operations.py | 6 +- .../operations/_available_skus_operations.py | 4 +- .../_bandwidth_schedules_operations.py | 18 +- .../aio/operations/_containers_operations.py | 22 +- .../aio/operations/_devices_operations.py | 52 +- .../aio/operations/_jobs_operations.py | 4 +- .../aio/operations/_nodes_operations.py | 4 +- .../aio/operations/_operations.py | 4 +- .../_operations_status_operations.py | 4 +- .../aio/operations/_orders_operations.py | 18 +- .../aio/operations/_roles_operations.py | 18 +- .../aio/operations/_shares_operations.py | 22 +- .../aio/operations/_skus_operations.py | 4 +- ..._storage_account_credentials_operations.py | 18 +- .../_storage_accounts_operations.py | 18 +- .../aio/operations/_triggers_operations.py | 18 +- .../aio/operations/_users_operations.py | 18 +- .../v2020_05_01_preview/models/_models.py | 302 +- .../v2020_05_01_preview/models/_models_py3.py | 302 +- .../operations/_alerts_operations.py | 6 +- .../operations/_available_skus_operations.py | 4 +- .../_bandwidth_schedules_operations.py | 18 +- .../operations/_containers_operations.py | 22 +- .../operations/_devices_operations.py | 52 +- .../operations/_jobs_operations.py | 4 +- .../operations/_nodes_operations.py | 4 +- .../operations/_operations.py | 4 +- .../_operations_status_operations.py | 4 +- .../operations/_orders_operations.py | 18 +- .../operations/_roles_operations.py | 18 +- .../operations/_shares_operations.py | 22 +- .../operations/_skus_operations.py | 4 +- ..._storage_account_credentials_operations.py | 18 +- .../_storage_accounts_operations.py | 18 +- .../operations/_triggers_operations.py | 18 +- .../operations/_users_operations.py | 18 +- .../mgmt/databoxedge/v2020_09_01/__init__.py | 16 + .../databoxedge/v2020_09_01/_configuration.py | 70 + .../_data_box_edge_management_client.py | 174 + .../databoxedge/v2020_09_01/_metadata.json | 120 + .../databoxedge/v2020_09_01/aio/__init__.py | 10 + .../v2020_09_01/aio/_configuration.py | 66 + .../aio/_data_box_edge_management_client.py | 167 + .../v2020_09_01/aio/operations/__init__.py | 47 + .../aio/operations/_addons_operations.py | 450 ++ .../aio/operations/_alerts_operations.py | 180 + .../operations/_available_skus_operations.py | 110 + .../_bandwidth_schedules_operations.py | 428 ++ .../aio/operations/_containers_operations.py | 580 ++ .../aio/operations/_devices_operations.py | 1363 ++++ .../aio/operations/_jobs_operations.py | 105 + .../_monitoring_config_operations.py | 440 ++ .../aio/operations/_nodes_operations.py | 116 + .../v2020_09_01/aio/operations/_operations.py | 106 + .../_operations_status_operations.py | 105 + .../aio/operations/_orders_operations.py | 478 ++ .../aio/operations/_roles_operations.py | 428 ++ .../aio/operations/_shares_operations.py | 551 ++ ..._storage_account_credentials_operations.py | 430 ++ .../_storage_accounts_operations.py | 434 ++ .../aio/operations/_triggers_operations.py | 434 ++ .../aio/operations/_users_operations.py | 435 ++ .../v2020_09_01/models/__init__.py | 476 ++ .../_data_box_edge_management_client_enums.py | 546 ++ .../databoxedge/v2020_09_01/models/_models.py | 4986 +++++++++++++++ .../v2020_09_01/models/_models_py3.py | 5288 ++++++++++++++++ .../v2020_09_01/operations/__init__.py | 47 + .../operations/_addons_operations.py | 460 ++ .../operations/_alerts_operations.py | 186 + .../operations/_available_skus_operations.py | 115 + .../_bandwidth_schedules_operations.py | 438 ++ .../operations/_containers_operations.py | 592 ++ .../operations/_devices_operations.py | 1389 +++++ .../operations/_jobs_operations.py | 110 + .../_monitoring_config_operations.py | 450 ++ .../operations/_nodes_operations.py | 121 + .../v2020_09_01/operations/_operations.py | 111 + .../_operations_status_operations.py | 110 + .../operations/_orders_operations.py | 489 ++ .../operations/_roles_operations.py | 438 ++ .../operations/_shares_operations.py | 563 ++ ..._storage_account_credentials_operations.py | 440 ++ .../_storage_accounts_operations.py | 444 ++ .../operations/_triggers_operations.py | 444 ++ .../operations/_users_operations.py | 445 ++ .../mgmt/databoxedge/v2020_09_01/py.typed | 1 + .../v2020_09_01_preview/__init__.py | 16 + .../v2020_09_01_preview/_configuration.py | 70 + .../_data_box_edge_management_client.py | 174 + .../v2020_09_01_preview/_metadata.json | 120 + .../v2020_09_01_preview/aio/__init__.py | 10 + .../v2020_09_01_preview/aio/_configuration.py | 66 + .../aio/_data_box_edge_management_client.py | 167 + .../aio/operations/__init__.py | 47 + .../aio/operations/_addons_operations.py | 450 ++ .../aio/operations/_alerts_operations.py | 180 + .../operations/_available_skus_operations.py | 110 + .../_bandwidth_schedules_operations.py | 428 ++ .../aio/operations/_containers_operations.py | 580 ++ .../aio/operations/_devices_operations.py | 1363 ++++ .../aio/operations/_jobs_operations.py | 105 + .../_monitoring_config_operations.py | 440 ++ .../aio/operations/_nodes_operations.py | 116 + .../aio/operations/_operations.py | 106 + .../_operations_status_operations.py | 105 + .../aio/operations/_orders_operations.py | 478 ++ .../aio/operations/_roles_operations.py | 428 ++ .../aio/operations/_shares_operations.py | 551 ++ ..._storage_account_credentials_operations.py | 430 ++ .../_storage_accounts_operations.py | 434 ++ .../aio/operations/_triggers_operations.py | 434 ++ .../aio/operations/_users_operations.py | 435 ++ .../v2020_09_01_preview/models/__init__.py | 476 ++ .../_data_box_edge_management_client_enums.py | 546 ++ .../v2020_09_01_preview/models/_models.py | 5037 +++++++++++++++ .../v2020_09_01_preview/models/_models_py3.py | 5339 ++++++++++++++++ .../operations/__init__.py | 47 + .../operations/_addons_operations.py | 460 ++ .../operations/_alerts_operations.py | 186 + .../operations/_available_skus_operations.py | 115 + .../_bandwidth_schedules_operations.py | 438 ++ .../operations/_containers_operations.py | 592 ++ .../operations/_devices_operations.py | 1389 +++++ .../operations/_jobs_operations.py | 110 + .../_monitoring_config_operations.py | 450 ++ .../operations/_nodes_operations.py | 121 + .../operations/_operations.py | 111 + .../_operations_status_operations.py | 110 + .../operations/_orders_operations.py | 489 ++ .../operations/_roles_operations.py | 438 ++ .../operations/_shares_operations.py | 563 ++ ..._storage_account_credentials_operations.py | 440 ++ .../_storage_accounts_operations.py | 444 ++ .../operations/_triggers_operations.py | 444 ++ .../operations/_users_operations.py | 445 ++ .../databoxedge/v2020_09_01_preview/py.typed | 1 + .../v2021_02_01_preview/__init__.py | 16 + .../v2021_02_01_preview/_configuration.py | 70 + .../_data_box_edge_management_client.py | 174 + .../v2021_02_01_preview/_metadata.json | 120 + .../v2021_02_01_preview/aio/__init__.py | 10 + .../v2021_02_01_preview/aio/_configuration.py | 66 + .../aio/_data_box_edge_management_client.py | 167 + .../aio/operations/__init__.py | 47 + .../aio/operations/_addons_operations.py | 450 ++ .../aio/operations/_alerts_operations.py | 180 + .../operations/_available_skus_operations.py | 110 + .../_bandwidth_schedules_operations.py | 428 ++ .../aio/operations/_containers_operations.py | 580 ++ .../aio/operations/_devices_operations.py | 1363 ++++ .../aio/operations/_jobs_operations.py | 105 + .../_monitoring_config_operations.py | 440 ++ .../aio/operations/_nodes_operations.py | 116 + .../aio/operations/_operations.py | 106 + .../_operations_status_operations.py | 105 + .../aio/operations/_orders_operations.py | 478 ++ .../aio/operations/_roles_operations.py | 428 ++ .../aio/operations/_shares_operations.py | 551 ++ ..._storage_account_credentials_operations.py | 430 ++ .../_storage_accounts_operations.py | 434 ++ .../aio/operations/_triggers_operations.py | 434 ++ .../aio/operations/_users_operations.py | 435 ++ .../v2021_02_01_preview/models/__init__.py | 488 ++ .../_data_box_edge_management_client_enums.py | 580 ++ .../v2021_02_01_preview/models/_models.py | 5195 ++++++++++++++++ .../v2021_02_01_preview/models/_models_py3.py | 5512 +++++++++++++++++ .../operations/__init__.py | 47 + .../operations/_addons_operations.py | 460 ++ .../operations/_alerts_operations.py | 186 + .../operations/_available_skus_operations.py | 115 + .../_bandwidth_schedules_operations.py | 438 ++ .../operations/_containers_operations.py | 592 ++ .../operations/_devices_operations.py | 1389 +++++ .../operations/_jobs_operations.py | 110 + .../_monitoring_config_operations.py | 450 ++ .../operations/_nodes_operations.py | 121 + .../operations/_operations.py | 111 + .../_operations_status_operations.py | 110 + .../operations/_orders_operations.py | 489 ++ .../operations/_roles_operations.py | 438 ++ .../operations/_shares_operations.py | 563 ++ ..._storage_account_credentials_operations.py | 440 ++ .../_storage_accounts_operations.py | 444 ++ .../operations/_triggers_operations.py | 444 ++ .../operations/_users_operations.py | 445 ++ .../databoxedge/v2021_02_01_preview/py.typed | 1 + 343 files changed, 109831 insertions(+), 1946 deletions(-) create mode 100644 sdk/databoxedge/azure-mgmt-databoxedge/_meta.json create mode 100644 sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/datab/__init__.py create mode 100644 sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/datab/_configuration.py create mode 100644 sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/datab/_data_box_edge_management_client.py create mode 100644 sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/datab/_metadata.json create mode 100644 sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/datab/aio/__init__.py create mode 100644 sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/datab/aio/_configuration.py create mode 100644 sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/datab/aio/_data_box_edge_management_client.py create mode 100644 sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/datab/aio/operations/__init__.py create mode 100644 sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/datab/aio/operations/_addons_operations.py create mode 100644 sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/datab/aio/operations/_alerts_operations.py create mode 100644 sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/datab/aio/operations/_available_skus_operations.py create mode 100644 sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/datab/aio/operations/_bandwidth_schedules_operations.py create mode 100644 sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/datab/aio/operations/_containers_operations.py create mode 100644 sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/datab/aio/operations/_devices_operations.py create mode 100644 sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/datab/aio/operations/_jobs_operations.py create mode 100644 sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/datab/aio/operations/_monitoring_config_operations.py create mode 100644 sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/datab/aio/operations/_nodes_operations.py create mode 100644 sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/datab/aio/operations/_operations.py create mode 100644 sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/datab/aio/operations/_operations_status_operations.py create mode 100644 sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/datab/aio/operations/_orders_operations.py create mode 100644 sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/datab/aio/operations/_roles_operations.py create mode 100644 sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/datab/aio/operations/_shares_operations.py create mode 100644 sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/datab/aio/operations/_storage_account_credentials_operations.py create mode 100644 sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/datab/aio/operations/_storage_accounts_operations.py create mode 100644 sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/datab/aio/operations/_triggers_operations.py create mode 100644 sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/datab/aio/operations/_users_operations.py create mode 100644 sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/datab/models/__init__.py create mode 100644 sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/datab/models/_data_box_edge_management_client_enums.py create mode 100644 sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/datab/models/_models.py create mode 100644 sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/datab/models/_models_py3.py create mode 100644 sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/datab/operations/__init__.py create mode 100644 sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/datab/operations/_addons_operations.py create mode 100644 sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/datab/operations/_alerts_operations.py create mode 100644 sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/datab/operations/_available_skus_operations.py create mode 100644 sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/datab/operations/_bandwidth_schedules_operations.py create mode 100644 sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/datab/operations/_containers_operations.py create mode 100644 sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/datab/operations/_devices_operations.py create mode 100644 sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/datab/operations/_jobs_operations.py create mode 100644 sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/datab/operations/_monitoring_config_operations.py create mode 100644 sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/datab/operations/_nodes_operations.py create mode 100644 sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/datab/operations/_operations.py create mode 100644 sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/datab/operations/_operations_status_operations.py create mode 100644 sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/datab/operations/_orders_operations.py create mode 100644 sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/datab/operations/_roles_operations.py create mode 100644 sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/datab/operations/_shares_operations.py create mode 100644 sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/datab/operations/_storage_account_credentials_operations.py create mode 100644 sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/datab/operations/_storage_accounts_operations.py create mode 100644 sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/datab/operations/_triggers_operations.py create mode 100644 sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/datab/operations/_users_operations.py create mode 100644 sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/datab/py.typed create mode 100644 sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_09_01/__init__.py create mode 100644 sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_09_01/_configuration.py create mode 100644 sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_09_01/_data_box_edge_management_client.py create mode 100644 sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_09_01/_metadata.json create mode 100644 sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_09_01/aio/__init__.py create mode 100644 sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_09_01/aio/_configuration.py create mode 100644 sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_09_01/aio/_data_box_edge_management_client.py create mode 100644 sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_09_01/aio/operations/__init__.py create mode 100644 sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_09_01/aio/operations/_addons_operations.py create mode 100644 sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_09_01/aio/operations/_alerts_operations.py create mode 100644 sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_09_01/aio/operations/_available_skus_operations.py create mode 100644 sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_09_01/aio/operations/_bandwidth_schedules_operations.py create mode 100644 sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_09_01/aio/operations/_containers_operations.py create mode 100644 sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_09_01/aio/operations/_devices_operations.py create mode 100644 sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_09_01/aio/operations/_jobs_operations.py create mode 100644 sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_09_01/aio/operations/_monitoring_config_operations.py create mode 100644 sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_09_01/aio/operations/_nodes_operations.py create mode 100644 sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_09_01/aio/operations/_operations.py create mode 100644 sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_09_01/aio/operations/_operations_status_operations.py create mode 100644 sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_09_01/aio/operations/_orders_operations.py create mode 100644 sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_09_01/aio/operations/_roles_operations.py create mode 100644 sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_09_01/aio/operations/_shares_operations.py create mode 100644 sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_09_01/aio/operations/_storage_account_credentials_operations.py create mode 100644 sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_09_01/aio/operations/_storage_accounts_operations.py create mode 100644 sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_09_01/aio/operations/_triggers_operations.py create mode 100644 sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_09_01/aio/operations/_users_operations.py create mode 100644 sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_09_01/models/__init__.py create mode 100644 sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_09_01/models/_data_box_edge_management_client_enums.py create mode 100644 sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_09_01/models/_models.py create mode 100644 sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_09_01/models/_models_py3.py create mode 100644 sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_09_01/operations/__init__.py create mode 100644 sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_09_01/operations/_addons_operations.py create mode 100644 sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_09_01/operations/_alerts_operations.py create mode 100644 sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_09_01/operations/_available_skus_operations.py create mode 100644 sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_09_01/operations/_bandwidth_schedules_operations.py create mode 100644 sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_09_01/operations/_containers_operations.py create mode 100644 sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_09_01/operations/_devices_operations.py create mode 100644 sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_09_01/operations/_jobs_operations.py create mode 100644 sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_09_01/operations/_monitoring_config_operations.py create mode 100644 sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_09_01/operations/_nodes_operations.py create mode 100644 sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_09_01/operations/_operations.py create mode 100644 sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_09_01/operations/_operations_status_operations.py create mode 100644 sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_09_01/operations/_orders_operations.py create mode 100644 sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_09_01/operations/_roles_operations.py create mode 100644 sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_09_01/operations/_shares_operations.py create mode 100644 sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_09_01/operations/_storage_account_credentials_operations.py create mode 100644 sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_09_01/operations/_storage_accounts_operations.py create mode 100644 sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_09_01/operations/_triggers_operations.py create mode 100644 sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_09_01/operations/_users_operations.py create mode 100644 sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_09_01/py.typed create mode 100644 sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_09_01_preview/__init__.py create mode 100644 sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_09_01_preview/_configuration.py create mode 100644 sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_09_01_preview/_data_box_edge_management_client.py create mode 100644 sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_09_01_preview/_metadata.json create mode 100644 sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_09_01_preview/aio/__init__.py create mode 100644 sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_09_01_preview/aio/_configuration.py create mode 100644 sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_09_01_preview/aio/_data_box_edge_management_client.py create mode 100644 sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_09_01_preview/aio/operations/__init__.py create mode 100644 sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_09_01_preview/aio/operations/_addons_operations.py create mode 100644 sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_09_01_preview/aio/operations/_alerts_operations.py create mode 100644 sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_09_01_preview/aio/operations/_available_skus_operations.py create mode 100644 sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_09_01_preview/aio/operations/_bandwidth_schedules_operations.py create mode 100644 sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_09_01_preview/aio/operations/_containers_operations.py create mode 100644 sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_09_01_preview/aio/operations/_devices_operations.py create mode 100644 sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_09_01_preview/aio/operations/_jobs_operations.py create mode 100644 sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_09_01_preview/aio/operations/_monitoring_config_operations.py create mode 100644 sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_09_01_preview/aio/operations/_nodes_operations.py create mode 100644 sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_09_01_preview/aio/operations/_operations.py create mode 100644 sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_09_01_preview/aio/operations/_operations_status_operations.py create mode 100644 sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_09_01_preview/aio/operations/_orders_operations.py create mode 100644 sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_09_01_preview/aio/operations/_roles_operations.py create mode 100644 sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_09_01_preview/aio/operations/_shares_operations.py create mode 100644 sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_09_01_preview/aio/operations/_storage_account_credentials_operations.py create mode 100644 sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_09_01_preview/aio/operations/_storage_accounts_operations.py create mode 100644 sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_09_01_preview/aio/operations/_triggers_operations.py create mode 100644 sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_09_01_preview/aio/operations/_users_operations.py create mode 100644 sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_09_01_preview/models/__init__.py create mode 100644 sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_09_01_preview/models/_data_box_edge_management_client_enums.py create mode 100644 sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_09_01_preview/models/_models.py create mode 100644 sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_09_01_preview/models/_models_py3.py create mode 100644 sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_09_01_preview/operations/__init__.py create mode 100644 sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_09_01_preview/operations/_addons_operations.py create mode 100644 sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_09_01_preview/operations/_alerts_operations.py create mode 100644 sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_09_01_preview/operations/_available_skus_operations.py create mode 100644 sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_09_01_preview/operations/_bandwidth_schedules_operations.py create mode 100644 sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_09_01_preview/operations/_containers_operations.py create mode 100644 sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_09_01_preview/operations/_devices_operations.py create mode 100644 sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_09_01_preview/operations/_jobs_operations.py create mode 100644 sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_09_01_preview/operations/_monitoring_config_operations.py create mode 100644 sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_09_01_preview/operations/_nodes_operations.py create mode 100644 sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_09_01_preview/operations/_operations.py create mode 100644 sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_09_01_preview/operations/_operations_status_operations.py create mode 100644 sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_09_01_preview/operations/_orders_operations.py create mode 100644 sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_09_01_preview/operations/_roles_operations.py create mode 100644 sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_09_01_preview/operations/_shares_operations.py create mode 100644 sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_09_01_preview/operations/_storage_account_credentials_operations.py create mode 100644 sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_09_01_preview/operations/_storage_accounts_operations.py create mode 100644 sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_09_01_preview/operations/_triggers_operations.py create mode 100644 sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_09_01_preview/operations/_users_operations.py create mode 100644 sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_09_01_preview/py.typed create mode 100644 sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2021_02_01_preview/__init__.py create mode 100644 sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2021_02_01_preview/_configuration.py create mode 100644 sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2021_02_01_preview/_data_box_edge_management_client.py create mode 100644 sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2021_02_01_preview/_metadata.json create mode 100644 sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2021_02_01_preview/aio/__init__.py create mode 100644 sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2021_02_01_preview/aio/_configuration.py create mode 100644 sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2021_02_01_preview/aio/_data_box_edge_management_client.py create mode 100644 sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2021_02_01_preview/aio/operations/__init__.py create mode 100644 sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2021_02_01_preview/aio/operations/_addons_operations.py create mode 100644 sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2021_02_01_preview/aio/operations/_alerts_operations.py create mode 100644 sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2021_02_01_preview/aio/operations/_available_skus_operations.py create mode 100644 sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2021_02_01_preview/aio/operations/_bandwidth_schedules_operations.py create mode 100644 sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2021_02_01_preview/aio/operations/_containers_operations.py create mode 100644 sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2021_02_01_preview/aio/operations/_devices_operations.py create mode 100644 sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2021_02_01_preview/aio/operations/_jobs_operations.py create mode 100644 sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2021_02_01_preview/aio/operations/_monitoring_config_operations.py create mode 100644 sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2021_02_01_preview/aio/operations/_nodes_operations.py create mode 100644 sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2021_02_01_preview/aio/operations/_operations.py create mode 100644 sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2021_02_01_preview/aio/operations/_operations_status_operations.py create mode 100644 sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2021_02_01_preview/aio/operations/_orders_operations.py create mode 100644 sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2021_02_01_preview/aio/operations/_roles_operations.py create mode 100644 sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2021_02_01_preview/aio/operations/_shares_operations.py create mode 100644 sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2021_02_01_preview/aio/operations/_storage_account_credentials_operations.py create mode 100644 sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2021_02_01_preview/aio/operations/_storage_accounts_operations.py create mode 100644 sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2021_02_01_preview/aio/operations/_triggers_operations.py create mode 100644 sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2021_02_01_preview/aio/operations/_users_operations.py create mode 100644 sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2021_02_01_preview/models/__init__.py create mode 100644 sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2021_02_01_preview/models/_data_box_edge_management_client_enums.py create mode 100644 sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2021_02_01_preview/models/_models.py create mode 100644 sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2021_02_01_preview/models/_models_py3.py create mode 100644 sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2021_02_01_preview/operations/__init__.py create mode 100644 sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2021_02_01_preview/operations/_addons_operations.py create mode 100644 sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2021_02_01_preview/operations/_alerts_operations.py create mode 100644 sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2021_02_01_preview/operations/_available_skus_operations.py create mode 100644 sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2021_02_01_preview/operations/_bandwidth_schedules_operations.py create mode 100644 sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2021_02_01_preview/operations/_containers_operations.py create mode 100644 sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2021_02_01_preview/operations/_devices_operations.py create mode 100644 sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2021_02_01_preview/operations/_jobs_operations.py create mode 100644 sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2021_02_01_preview/operations/_monitoring_config_operations.py create mode 100644 sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2021_02_01_preview/operations/_nodes_operations.py create mode 100644 sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2021_02_01_preview/operations/_operations.py create mode 100644 sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2021_02_01_preview/operations/_operations_status_operations.py create mode 100644 sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2021_02_01_preview/operations/_orders_operations.py create mode 100644 sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2021_02_01_preview/operations/_roles_operations.py create mode 100644 sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2021_02_01_preview/operations/_shares_operations.py create mode 100644 sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2021_02_01_preview/operations/_storage_account_credentials_operations.py create mode 100644 sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2021_02_01_preview/operations/_storage_accounts_operations.py create mode 100644 sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2021_02_01_preview/operations/_triggers_operations.py create mode 100644 sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2021_02_01_preview/operations/_users_operations.py create mode 100644 sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2021_02_01_preview/py.typed diff --git a/sdk/databoxedge/azure-mgmt-databoxedge/MANIFEST.in b/sdk/databoxedge/azure-mgmt-databoxedge/MANIFEST.in index a3cb07df8765..3a9b6517412b 100644 --- a/sdk/databoxedge/azure-mgmt-databoxedge/MANIFEST.in +++ b/sdk/databoxedge/azure-mgmt-databoxedge/MANIFEST.in @@ -1,3 +1,4 @@ +include _meta.json recursive-include tests *.py *.yaml include *.md include azure/__init__.py diff --git a/sdk/databoxedge/azure-mgmt-databoxedge/_meta.json b/sdk/databoxedge/azure-mgmt-databoxedge/_meta.json new file mode 100644 index 000000000000..2527cb55f4a7 --- /dev/null +++ b/sdk/databoxedge/azure-mgmt-databoxedge/_meta.json @@ -0,0 +1,8 @@ +{ + "autorest": "3.3.0", + "use": "@autorest/python@5.6.6", + "commit": "cc247b28bd6dc94786fb18e691d6331a168985f6", + "repository_url": "https://github.com/Azure/azure-rest-api-specs", + "autorest_command": "autorest specification/databoxedge/resource-manager/readme.md --multiapi --python --python-mode=update --python-sdks-folder=/home/vsts/work/1/s/azure-sdk-for-python/sdk --track2 --use=@autorest/python@5.6.6 --version=3.3.0", + "readme": "specification/databoxedge/resource-manager/readme.md" +} \ No newline at end of file diff --git a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/datab/__init__.py b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/datab/__init__.py new file mode 100644 index 000000000000..e63196b6b98f --- /dev/null +++ b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/datab/__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/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/datab/_configuration.py b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/datab/_configuration.py new file mode 100644 index 000000000000..70492096ac98 --- /dev/null +++ b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/datab/_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 = "2020-12-01" + self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default']) + kwargs.setdefault('sdk_moniker', 'mgmt-databoxedge/{}'.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/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/datab/_data_box_edge_management_client.py b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/datab/_data_box_edge_management_client.py new file mode 100644 index 000000000000..0e619b3c6ee6 --- /dev/null +++ b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/datab/_data_box_edge_management_client.py @@ -0,0 +1,174 @@ +# 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 azure.core.pipeline.transport import HttpRequest, HttpResponse + +from ._configuration import DataBoxEdgeManagementClientConfiguration +from .operations import Operations +from .operations import AvailableSkusOperations +from .operations import DevicesOperations +from .operations import AlertsOperations +from .operations import BandwidthSchedulesOperations +from .operations import JobsOperations +from .operations import NodesOperations +from .operations import OperationsStatusOperations +from .operations import OrdersOperations +from .operations import RolesOperations +from .operations import AddonsOperations +from .operations import MonitoringConfigOperations +from .operations import SharesOperations +from .operations import StorageAccountCredentialsOperations +from .operations import StorageAccountsOperations +from .operations import ContainersOperations +from .operations import TriggersOperations +from .operations import UsersOperations +from . import models + + +class DataBoxEdgeManagementClient(object): + """The DataBoxEdge Client. + + :ivar operations: Operations operations + :vartype operations: azure.mgmt.databoxedge.v2020_12_01.operations.Operations + :ivar available_skus: AvailableSkusOperations operations + :vartype available_skus: azure.mgmt.databoxedge.v2020_12_01.operations.AvailableSkusOperations + :ivar devices: DevicesOperations operations + :vartype devices: azure.mgmt.databoxedge.v2020_12_01.operations.DevicesOperations + :ivar alerts: AlertsOperations operations + :vartype alerts: azure.mgmt.databoxedge.v2020_12_01.operations.AlertsOperations + :ivar bandwidth_schedules: BandwidthSchedulesOperations operations + :vartype bandwidth_schedules: azure.mgmt.databoxedge.v2020_12_01.operations.BandwidthSchedulesOperations + :ivar jobs: JobsOperations operations + :vartype jobs: azure.mgmt.databoxedge.v2020_12_01.operations.JobsOperations + :ivar nodes: NodesOperations operations + :vartype nodes: azure.mgmt.databoxedge.v2020_12_01.operations.NodesOperations + :ivar operations_status: OperationsStatusOperations operations + :vartype operations_status: azure.mgmt.databoxedge.v2020_12_01.operations.OperationsStatusOperations + :ivar orders: OrdersOperations operations + :vartype orders: azure.mgmt.databoxedge.v2020_12_01.operations.OrdersOperations + :ivar roles: RolesOperations operations + :vartype roles: azure.mgmt.databoxedge.v2020_12_01.operations.RolesOperations + :ivar addons: AddonsOperations operations + :vartype addons: azure.mgmt.databoxedge.v2020_12_01.operations.AddonsOperations + :ivar monitoring_config: MonitoringConfigOperations operations + :vartype monitoring_config: azure.mgmt.databoxedge.v2020_12_01.operations.MonitoringConfigOperations + :ivar shares: SharesOperations operations + :vartype shares: azure.mgmt.databoxedge.v2020_12_01.operations.SharesOperations + :ivar storage_account_credentials: StorageAccountCredentialsOperations operations + :vartype storage_account_credentials: azure.mgmt.databoxedge.v2020_12_01.operations.StorageAccountCredentialsOperations + :ivar storage_accounts: StorageAccountsOperations operations + :vartype storage_accounts: azure.mgmt.databoxedge.v2020_12_01.operations.StorageAccountsOperations + :ivar containers: ContainersOperations operations + :vartype containers: azure.mgmt.databoxedge.v2020_12_01.operations.ContainersOperations + :ivar triggers: TriggersOperations operations + :vartype triggers: azure.mgmt.databoxedge.v2020_12_01.operations.TriggersOperations + :ivar users: UsersOperations operations + :vartype users: azure.mgmt.databoxedge.v2020_12_01.operations.UsersOperations + :param credential: Credential needed for the client to connect to Azure. + :type credential: ~azure.core.credentials.TokenCredential + :param subscription_id: The subscription ID. + :type subscription_id: str + :param str base_url: Service URL + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + """ + + def __init__( + self, + credential, # type: "TokenCredential" + subscription_id, # type: str + base_url=None, # type: Optional[str] + **kwargs # type: Any + ): + # type: (...) -> None + if not base_url: + base_url = 'https://management.azure.com' + self._config = DataBoxEdgeManagementClientConfiguration(credential, subscription_id, **kwargs) + self._client = ARMPipelineClient(base_url=base_url, config=self._config, **kwargs) + + client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} + self._serialize = Serializer(client_models) + self._serialize.client_side_validation = False + self._deserialize = Deserializer(client_models) + + self.operations = Operations( + self._client, self._config, self._serialize, self._deserialize) + self.available_skus = AvailableSkusOperations( + self._client, self._config, self._serialize, self._deserialize) + self.devices = DevicesOperations( + self._client, self._config, self._serialize, self._deserialize) + self.alerts = AlertsOperations( + self._client, self._config, self._serialize, self._deserialize) + self.bandwidth_schedules = BandwidthSchedulesOperations( + self._client, self._config, self._serialize, self._deserialize) + self.jobs = JobsOperations( + self._client, self._config, self._serialize, self._deserialize) + self.nodes = NodesOperations( + self._client, self._config, self._serialize, self._deserialize) + self.operations_status = OperationsStatusOperations( + self._client, self._config, self._serialize, self._deserialize) + self.orders = OrdersOperations( + self._client, self._config, self._serialize, self._deserialize) + self.roles = RolesOperations( + self._client, self._config, self._serialize, self._deserialize) + self.addons = AddonsOperations( + self._client, self._config, self._serialize, self._deserialize) + self.monitoring_config = MonitoringConfigOperations( + self._client, self._config, self._serialize, self._deserialize) + self.shares = SharesOperations( + self._client, self._config, self._serialize, self._deserialize) + self.storage_account_credentials = StorageAccountCredentialsOperations( + self._client, self._config, self._serialize, self._deserialize) + self.storage_accounts = StorageAccountsOperations( + self._client, self._config, self._serialize, self._deserialize) + self.containers = ContainersOperations( + self._client, self._config, self._serialize, self._deserialize) + self.triggers = TriggersOperations( + self._client, self._config, self._serialize, self._deserialize) + self.users = UsersOperations( + self._client, self._config, self._serialize, self._deserialize) + + def _send_request(self, http_request, **kwargs): + # type: (HttpRequest, Any) -> HttpResponse + """Runs the network request through the client's chained policies. + + :param http_request: The network request you want to make. Required. + :type http_request: ~azure.core.pipeline.transport.HttpRequest + :keyword bool stream: Whether the response payload will be streamed. Defaults to True. + :return: The response of your network call. Does not do error handling on your response. + :rtype: ~azure.core.pipeline.transport.HttpResponse + """ + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + http_request.url = self._client.format_url(http_request.url, **path_format_arguments) + stream = kwargs.pop("stream", True) + pipeline_response = self._client._pipeline.run(http_request, stream=stream, **kwargs) + return pipeline_response.http_response + + 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/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/datab/_metadata.json b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/datab/_metadata.json new file mode 100644 index 000000000000..f677ec50bfde --- /dev/null +++ b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/datab/_metadata.json @@ -0,0 +1,120 @@ +{ + "chosen_version": "2020-12-01", + "total_api_version_list": ["2020-12-01"], + "client": { + "name": "DataBoxEdgeManagementClient", + "filename": "_data_box_edge_management_client", + "description": "The DataBoxEdge Client.", + "base_url": "\u0027https://management.azure.com\u0027", + "custom_base_url": null, + "azure_arm": true, + "has_lro_operations": true, + "client_side_validation": false, + "sync_imports": "{\"typing\": {\"azurecore\": {\"azure.core.credentials\": [\"TokenCredential\"]}}, \"regular\": {\"azurecore\": {\"azure.profiles\": [\"KnownProfiles\", \"ProfileDefinition\"], \"azure.profiles.multiapiclient\": [\"MultiApiClientMixin\"], \"msrest\": [\"Deserializer\", \"Serializer\"], \"azure.mgmt.core\": [\"ARMPipelineClient\"]}, \"local\": {\"._configuration\": [\"DataBoxEdgeManagementClientConfiguration\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}, \"azurecore\": {\"azure.core.pipeline.transport\": [\"HttpRequest\", \"HttpResponse\"]}}}", + "async_imports": "{\"typing\": {\"azurecore\": {\"azure.core.credentials_async\": [\"AsyncTokenCredential\"]}}, \"regular\": {\"azurecore\": {\"azure.profiles\": [\"KnownProfiles\", \"ProfileDefinition\"], \"azure.profiles.multiapiclient\": [\"MultiApiClientMixin\"], \"msrest\": [\"Deserializer\", \"Serializer\"], \"azure.mgmt.core\": [\"AsyncARMPipelineClient\"]}, \"local\": {\"._configuration\": [\"DataBoxEdgeManagementClientConfiguration\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}, \"azurecore\": {\"azure.core.pipeline.transport\": [\"AsyncHttpResponse\", \"HttpRequest\"]}}}" + }, + "global_parameters": { + "sync": { + "credential": { + "signature": "credential, # type: \"TokenCredential\"", + "description": "Credential needed for the client to connect to Azure.", + "docstring_type": "~azure.core.credentials.TokenCredential", + "required": true + }, + "subscription_id": { + "signature": "subscription_id, # type: str", + "description": "The subscription ID.", + "docstring_type": "str", + "required": true + } + }, + "async": { + "credential": { + "signature": "credential: \"AsyncTokenCredential\",", + "description": "Credential needed for the client to connect to Azure.", + "docstring_type": "~azure.core.credentials_async.AsyncTokenCredential", + "required": true + }, + "subscription_id": { + "signature": "subscription_id: str,", + "description": "The subscription ID.", + "docstring_type": "str", + "required": true + } + }, + "constant": { + }, + "call": "credential, subscription_id", + "service_client_specific": { + "sync": { + "api_version": { + "signature": "api_version=None, # type: Optional[str]", + "description": "API version to use if no profile is provided, or if missing in profile.", + "docstring_type": "str", + "required": false + }, + "base_url": { + "signature": "base_url=None, # type: Optional[str]", + "description": "Service URL", + "docstring_type": "str", + "required": false + }, + "profile": { + "signature": "profile=KnownProfiles.default, # type: KnownProfiles", + "description": "A profile definition, from KnownProfiles to dict.", + "docstring_type": "azure.profiles.KnownProfiles", + "required": false + } + }, + "async": { + "api_version": { + "signature": "api_version: Optional[str] = None,", + "description": "API version to use if no profile is provided, or if missing in profile.", + "docstring_type": "str", + "required": false + }, + "base_url": { + "signature": "base_url: Optional[str] = None,", + "description": "Service URL", + "docstring_type": "str", + "required": false + }, + "profile": { + "signature": "profile: KnownProfiles = KnownProfiles.default,", + "description": "A profile definition, from KnownProfiles to dict.", + "docstring_type": "azure.profiles.KnownProfiles", + "required": false + } + } + } + }, + "config": { + "credential": true, + "credential_scopes": ["https://management.azure.com/.default"], + "credential_default_policy_type": "BearerTokenCredentialPolicy", + "credential_default_policy_type_has_async_version": true, + "credential_key_header_name": null, + "sync_imports": "{\"regular\": {\"azurecore\": {\"azure.core.configuration\": [\"Configuration\"], \"azure.core.pipeline\": [\"policies\"], \"azure.mgmt.core.policies\": [\"ARMHttpLoggingPolicy\"]}, \"local\": {\"._version\": [\"VERSION\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\"]}}, \"typing\": {\"azurecore\": {\"azure.core.credentials\": [\"TokenCredential\"]}}}", + "async_imports": "{\"regular\": {\"azurecore\": {\"azure.core.configuration\": [\"Configuration\"], \"azure.core.pipeline\": [\"policies\"], \"azure.mgmt.core.policies\": [\"ARMHttpLoggingPolicy\"]}, \"local\": {\".._version\": [\"VERSION\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\"]}}, \"typing\": {\"azurecore\": {\"azure.core.credentials_async\": [\"AsyncTokenCredential\"]}}}" + }, + "operation_groups": { + "operations": "Operations", + "available_skus": "AvailableSkusOperations", + "devices": "DevicesOperations", + "alerts": "AlertsOperations", + "bandwidth_schedules": "BandwidthSchedulesOperations", + "jobs": "JobsOperations", + "nodes": "NodesOperations", + "operations_status": "OperationsStatusOperations", + "orders": "OrdersOperations", + "roles": "RolesOperations", + "addons": "AddonsOperations", + "monitoring_config": "MonitoringConfigOperations", + "shares": "SharesOperations", + "storage_account_credentials": "StorageAccountCredentialsOperations", + "storage_accounts": "StorageAccountsOperations", + "containers": "ContainersOperations", + "triggers": "TriggersOperations", + "users": "UsersOperations" + } +} \ No newline at end of file diff --git a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/datab/aio/__init__.py b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/datab/aio/__init__.py new file mode 100644 index 000000000000..c33d46ee91d8 --- /dev/null +++ b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/datab/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/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/datab/aio/_configuration.py b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/datab/aio/_configuration.py new file mode 100644 index 000000000000..52416ed19fd9 --- /dev/null +++ b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/datab/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 = "2020-12-01" + self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default']) + kwargs.setdefault('sdk_moniker', 'mgmt-databoxedge/{}'.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/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/datab/aio/_data_box_edge_management_client.py b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/datab/aio/_data_box_edge_management_client.py new file mode 100644 index 000000000000..0cb209c359c9 --- /dev/null +++ b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/datab/aio/_data_box_edge_management_client.py @@ -0,0 +1,167 @@ +# 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.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.mgmt.core import AsyncARMPipelineClient +from msrest import Deserializer, Serializer + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from azure.core.credentials_async import AsyncTokenCredential + +from ._configuration import DataBoxEdgeManagementClientConfiguration +from .operations import Operations +from .operations import AvailableSkusOperations +from .operations import DevicesOperations +from .operations import AlertsOperations +from .operations import BandwidthSchedulesOperations +from .operations import JobsOperations +from .operations import NodesOperations +from .operations import OperationsStatusOperations +from .operations import OrdersOperations +from .operations import RolesOperations +from .operations import AddonsOperations +from .operations import MonitoringConfigOperations +from .operations import SharesOperations +from .operations import StorageAccountCredentialsOperations +from .operations import StorageAccountsOperations +from .operations import ContainersOperations +from .operations import TriggersOperations +from .operations import UsersOperations +from .. import models + + +class DataBoxEdgeManagementClient(object): + """The DataBoxEdge Client. + + :ivar operations: Operations operations + :vartype operations: azure.mgmt.databoxedge.v2020_12_01.aio.operations.Operations + :ivar available_skus: AvailableSkusOperations operations + :vartype available_skus: azure.mgmt.databoxedge.v2020_12_01.aio.operations.AvailableSkusOperations + :ivar devices: DevicesOperations operations + :vartype devices: azure.mgmt.databoxedge.v2020_12_01.aio.operations.DevicesOperations + :ivar alerts: AlertsOperations operations + :vartype alerts: azure.mgmt.databoxedge.v2020_12_01.aio.operations.AlertsOperations + :ivar bandwidth_schedules: BandwidthSchedulesOperations operations + :vartype bandwidth_schedules: azure.mgmt.databoxedge.v2020_12_01.aio.operations.BandwidthSchedulesOperations + :ivar jobs: JobsOperations operations + :vartype jobs: azure.mgmt.databoxedge.v2020_12_01.aio.operations.JobsOperations + :ivar nodes: NodesOperations operations + :vartype nodes: azure.mgmt.databoxedge.v2020_12_01.aio.operations.NodesOperations + :ivar operations_status: OperationsStatusOperations operations + :vartype operations_status: azure.mgmt.databoxedge.v2020_12_01.aio.operations.OperationsStatusOperations + :ivar orders: OrdersOperations operations + :vartype orders: azure.mgmt.databoxedge.v2020_12_01.aio.operations.OrdersOperations + :ivar roles: RolesOperations operations + :vartype roles: azure.mgmt.databoxedge.v2020_12_01.aio.operations.RolesOperations + :ivar addons: AddonsOperations operations + :vartype addons: azure.mgmt.databoxedge.v2020_12_01.aio.operations.AddonsOperations + :ivar monitoring_config: MonitoringConfigOperations operations + :vartype monitoring_config: azure.mgmt.databoxedge.v2020_12_01.aio.operations.MonitoringConfigOperations + :ivar shares: SharesOperations operations + :vartype shares: azure.mgmt.databoxedge.v2020_12_01.aio.operations.SharesOperations + :ivar storage_account_credentials: StorageAccountCredentialsOperations operations + :vartype storage_account_credentials: azure.mgmt.databoxedge.v2020_12_01.aio.operations.StorageAccountCredentialsOperations + :ivar storage_accounts: StorageAccountsOperations operations + :vartype storage_accounts: azure.mgmt.databoxedge.v2020_12_01.aio.operations.StorageAccountsOperations + :ivar containers: ContainersOperations operations + :vartype containers: azure.mgmt.databoxedge.v2020_12_01.aio.operations.ContainersOperations + :ivar triggers: TriggersOperations operations + :vartype triggers: azure.mgmt.databoxedge.v2020_12_01.aio.operations.TriggersOperations + :ivar users: UsersOperations operations + :vartype users: azure.mgmt.databoxedge.v2020_12_01.aio.operations.UsersOperations + :param credential: Credential needed for the client to connect to Azure. + :type credential: ~azure.core.credentials_async.AsyncTokenCredential + :param subscription_id: The subscription ID. + :type subscription_id: str + :param str base_url: Service URL + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + """ + + def __init__( + self, + credential: "AsyncTokenCredential", + subscription_id: str, + base_url: Optional[str] = None, + **kwargs: Any + ) -> None: + if not base_url: + base_url = 'https://management.azure.com' + self._config = DataBoxEdgeManagementClientConfiguration(credential, subscription_id, **kwargs) + self._client = AsyncARMPipelineClient(base_url=base_url, config=self._config, **kwargs) + + client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} + self._serialize = Serializer(client_models) + self._serialize.client_side_validation = False + self._deserialize = Deserializer(client_models) + + self.operations = Operations( + self._client, self._config, self._serialize, self._deserialize) + self.available_skus = AvailableSkusOperations( + self._client, self._config, self._serialize, self._deserialize) + self.devices = DevicesOperations( + self._client, self._config, self._serialize, self._deserialize) + self.alerts = AlertsOperations( + self._client, self._config, self._serialize, self._deserialize) + self.bandwidth_schedules = BandwidthSchedulesOperations( + self._client, self._config, self._serialize, self._deserialize) + self.jobs = JobsOperations( + self._client, self._config, self._serialize, self._deserialize) + self.nodes = NodesOperations( + self._client, self._config, self._serialize, self._deserialize) + self.operations_status = OperationsStatusOperations( + self._client, self._config, self._serialize, self._deserialize) + self.orders = OrdersOperations( + self._client, self._config, self._serialize, self._deserialize) + self.roles = RolesOperations( + self._client, self._config, self._serialize, self._deserialize) + self.addons = AddonsOperations( + self._client, self._config, self._serialize, self._deserialize) + self.monitoring_config = MonitoringConfigOperations( + self._client, self._config, self._serialize, self._deserialize) + self.shares = SharesOperations( + self._client, self._config, self._serialize, self._deserialize) + self.storage_account_credentials = StorageAccountCredentialsOperations( + self._client, self._config, self._serialize, self._deserialize) + self.storage_accounts = StorageAccountsOperations( + self._client, self._config, self._serialize, self._deserialize) + self.containers = ContainersOperations( + self._client, self._config, self._serialize, self._deserialize) + self.triggers = TriggersOperations( + self._client, self._config, self._serialize, self._deserialize) + self.users = UsersOperations( + self._client, self._config, self._serialize, self._deserialize) + + async def _send_request(self, http_request: HttpRequest, **kwargs: Any) -> AsyncHttpResponse: + """Runs the network request through the client's chained policies. + + :param http_request: The network request you want to make. Required. + :type http_request: ~azure.core.pipeline.transport.HttpRequest + :keyword bool stream: Whether the response payload will be streamed. Defaults to True. + :return: The response of your network call. Does not do error handling on your response. + :rtype: ~azure.core.pipeline.transport.AsyncHttpResponse + """ + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + http_request.url = self._client.format_url(http_request.url, **path_format_arguments) + stream = kwargs.pop("stream", True) + pipeline_response = await self._client._pipeline.run(http_request, stream=stream, **kwargs) + return pipeline_response.http_response + + 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/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/datab/aio/operations/__init__.py b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/datab/aio/operations/__init__.py new file mode 100644 index 000000000000..d70057be6458 --- /dev/null +++ b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/datab/aio/operations/__init__.py @@ -0,0 +1,47 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from ._operations import Operations +from ._available_skus_operations import AvailableSkusOperations +from ._devices_operations import DevicesOperations +from ._alerts_operations import AlertsOperations +from ._bandwidth_schedules_operations import BandwidthSchedulesOperations +from ._jobs_operations import JobsOperations +from ._nodes_operations import NodesOperations +from ._operations_status_operations import OperationsStatusOperations +from ._orders_operations import OrdersOperations +from ._roles_operations import RolesOperations +from ._addons_operations import AddonsOperations +from ._monitoring_config_operations import MonitoringConfigOperations +from ._shares_operations import SharesOperations +from ._storage_account_credentials_operations import StorageAccountCredentialsOperations +from ._storage_accounts_operations import StorageAccountsOperations +from ._containers_operations import ContainersOperations +from ._triggers_operations import TriggersOperations +from ._users_operations import UsersOperations + +__all__ = [ + 'Operations', + 'AvailableSkusOperations', + 'DevicesOperations', + 'AlertsOperations', + 'BandwidthSchedulesOperations', + 'JobsOperations', + 'NodesOperations', + 'OperationsStatusOperations', + 'OrdersOperations', + 'RolesOperations', + 'AddonsOperations', + 'MonitoringConfigOperations', + 'SharesOperations', + 'StorageAccountCredentialsOperations', + 'StorageAccountsOperations', + 'ContainersOperations', + 'TriggersOperations', + 'UsersOperations', +] diff --git a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/datab/aio/operations/_addons_operations.py b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/datab/aio/operations/_addons_operations.py new file mode 100644 index 000000000000..7287aec3b494 --- /dev/null +++ b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/datab/aio/operations/_addons_operations.py @@ -0,0 +1,450 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling + +from ... import models as _models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class AddonsOperations: + """AddonsOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.databoxedge.v2020_12_01.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list_by_role( + self, + device_name: str, + role_name: str, + resource_group_name: str, + **kwargs + ) -> AsyncIterable["_models.AddonList"]: + """Lists all the addons configured in the role. + + :param device_name: The device name. + :type device_name: str + :param role_name: The role name. + :type role_name: str + :param resource_group_name: The resource group name. + :type resource_group_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either AddonList or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.databoxedge.v2020_12_01.models.AddonList] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.AddonList"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-12-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_by_role.metadata['url'] # type: ignore + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'roleName': self._serialize.url("role_name", role_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('AddonList', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_by_role.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/roles/{roleName}/addons'} # type: ignore + + async def get( + self, + device_name: str, + role_name: str, + addon_name: str, + resource_group_name: str, + **kwargs + ) -> "_models.Addon": + """Gets a specific addon by name. + + :param device_name: The device name. + :type device_name: str + :param role_name: The role name. + :type role_name: str + :param addon_name: The addon name. + :type addon_name: str + :param resource_group_name: The resource group name. + :type resource_group_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: Addon, or the result of cls(response) + :rtype: ~azure.mgmt.databoxedge.v2020_12_01.models.Addon + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.Addon"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-12-01" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'roleName': self._serialize.url("role_name", role_name, 'str'), + 'addonName': self._serialize.url("addon_name", addon_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('Addon', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/roles/{roleName}/addons/{addonName}'} # type: ignore + + async def _create_or_update_initial( + self, + device_name: str, + role_name: str, + addon_name: str, + resource_group_name: str, + addon: "_models.Addon", + **kwargs + ) -> Optional["_models.Addon"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.Addon"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-12-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._create_or_update_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'roleName': self._serialize.url("role_name", role_name, 'str'), + 'addonName': self._serialize.url("addon_name", addon_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(addon, 'Addon') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('Addon', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/roles/{roleName}/addons/{addonName}'} # type: ignore + + async def begin_create_or_update( + self, + device_name: str, + role_name: str, + addon_name: str, + resource_group_name: str, + addon: "_models.Addon", + **kwargs + ) -> AsyncLROPoller["_models.Addon"]: + """Create or update a addon. + + :param device_name: The device name. + :type device_name: str + :param role_name: The role name. + :type role_name: str + :param addon_name: The addon name. + :type addon_name: str + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param addon: The addon properties. + :type addon: ~azure.mgmt.databoxedge.v2020_12_01.models.Addon + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: Pass in True if you'd like the AsyncARMPolling polling method, + False for no polling, or your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either Addon or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.databoxedge.v2020_12_01.models.Addon] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Addon"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._create_or_update_initial( + device_name=device_name, + role_name=role_name, + addon_name=addon_name, + resource_group_name=resource_group_name, + addon=addon, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('Addon', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'roleName': self._serialize.url("role_name", role_name, 'str'), + 'addonName': self._serialize.url("addon_name", addon_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/roles/{roleName}/addons/{addonName}'} # type: ignore + + async def _delete_initial( + self, + device_name: str, + role_name: str, + addon_name: str, + resource_group_name: str, + **kwargs + ) -> None: + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-12-01" + accept = "application/json" + + # Construct URL + url = self._delete_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'roleName': self._serialize.url("role_name", role_name, 'str'), + 'addonName': self._serialize.url("addon_name", addon_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/roles/{roleName}/addons/{addonName}'} # type: ignore + + async def begin_delete( + self, + device_name: str, + role_name: str, + addon_name: str, + resource_group_name: str, + **kwargs + ) -> AsyncLROPoller[None]: + """Deletes the addon on the device. + + :param device_name: The device name. + :type device_name: str + :param role_name: The role name. + :type role_name: str + :param addon_name: The addon name. + :type addon_name: str + :param resource_group_name: The resource group name. + :type resource_group_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: Pass in True if you'd like the AsyncARMPolling polling method, + False for no polling, or your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._delete_initial( + device_name=device_name, + role_name=role_name, + addon_name=addon_name, + resource_group_name=resource_group_name, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'roleName': self._serialize.url("role_name", role_name, 'str'), + 'addonName': self._serialize.url("addon_name", addon_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/roles/{roleName}/addons/{addonName}'} # type: ignore diff --git a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/datab/aio/operations/_alerts_operations.py b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/datab/aio/operations/_alerts_operations.py new file mode 100644 index 000000000000..bd674460d0ac --- /dev/null +++ b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/datab/aio/operations/_alerts_operations.py @@ -0,0 +1,180 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.mgmt.core.exceptions import ARMErrorFormat + +from ... import models as _models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class AlertsOperations: + """AlertsOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.databoxedge.v2020_12_01.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[~azure.mgmt.databoxedge.v2020_12_01.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 = "2020-12-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: ~azure.mgmt.databoxedge.v2020_12_01.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 = "2020-12-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/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/datab/aio/operations/_available_skus_operations.py b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/datab/aio/operations/_available_skus_operations.py new file mode 100644 index 000000000000..06b8e32035ae --- /dev/null +++ b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/datab/aio/operations/_available_skus_operations.py @@ -0,0 +1,110 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.mgmt.core.exceptions import ARMErrorFormat + +from ... import models as _models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class AvailableSkusOperations: + """AvailableSkusOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.databoxedge.v2020_12_01.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list( + self, + **kwargs + ) -> AsyncIterable["_models.DataBoxEdgeSkuList"]: + """List all the available Skus and information related to them. + + List all the available Skus and information related to them. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either DataBoxEdgeSkuList or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.databoxedge.v2020_12_01.models.DataBoxEdgeSkuList] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.DataBoxEdgeSkuList"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-12-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('DataBoxEdgeSkuList', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.DataBoxEdge/availableSkus'} # type: ignore diff --git a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/datab/aio/operations/_bandwidth_schedules_operations.py b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/datab/aio/operations/_bandwidth_schedules_operations.py new file mode 100644 index 000000000000..3e4bc7a09474 --- /dev/null +++ b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/datab/aio/operations/_bandwidth_schedules_operations.py @@ -0,0 +1,428 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling + +from ... import models as _models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class BandwidthSchedulesOperations: + """BandwidthSchedulesOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.databoxedge.v2020_12_01.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[~azure.mgmt.databoxedge.v2020_12_01.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 = "2020-12-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: ~azure.mgmt.databoxedge.v2020_12_01.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 = "2020-12-01" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('BandwidthSchedule', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/bandwidthSchedules/{name}'} # type: ignore + + async def _create_or_update_initial( + self, + device_name: str, + name: str, + resource_group_name: str, + parameters: "_models.BandwidthSchedule", + **kwargs + ) -> Optional["_models.BandwidthSchedule"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.BandwidthSchedule"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-12-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._create_or_update_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, 'BandwidthSchedule') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('BandwidthSchedule', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/bandwidthSchedules/{name}'} # type: ignore + + async def begin_create_or_update( + self, + device_name: str, + name: str, + resource_group_name: str, + parameters: "_models.BandwidthSchedule", + **kwargs + ) -> AsyncLROPoller["_models.BandwidthSchedule"]: + """Creates or updates a bandwidth schedule. + + :param device_name: The device name. + :type device_name: str + :param name: The bandwidth schedule name which needs to be added/updated. + :type name: str + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param parameters: The bandwidth schedule to be added or updated. + :type parameters: ~azure.mgmt.databoxedge.v2020_12_01.models.BandwidthSchedule + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: Pass in True if you'd like the AsyncARMPolling polling method, + False for no polling, or your own initialized polling object for a 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[~azure.mgmt.databoxedge.v2020_12_01.models.BandwidthSchedule] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.BandwidthSchedule"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._create_or_update_initial( + device_name=device_name, + name=name, + resource_group_name=resource_group_name, + parameters=parameters, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('BandwidthSchedule', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/bandwidthSchedules/{name}'} # type: ignore + + async def _delete_initial( + self, + device_name: str, + name: str, + resource_group_name: str, + **kwargs + ) -> None: + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-12-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: Pass in True if you'd like the AsyncARMPolling polling method, + False for no polling, or your own initialized polling object for a 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/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/datab/aio/operations/_containers_operations.py b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/datab/aio/operations/_containers_operations.py new file mode 100644 index 000000000000..31fc7b531c68 --- /dev/null +++ b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/datab/aio/operations/_containers_operations.py @@ -0,0 +1,580 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling + +from ... import models as _models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class ContainersOperations: + """ContainersOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.databoxedge.v2020_12_01.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[~azure.mgmt.databoxedge.v2020_12_01.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 = "2020-12-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: ~azure.mgmt.databoxedge.v2020_12_01.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 = "2020-12-01" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'storageAccountName': self._serialize.url("storage_account_name", storage_account_name, 'str'), + 'containerName': self._serialize.url("container_name", container_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('Container', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/storageAccounts/{storageAccountName}/containers/{containerName}'} # type: ignore + + async def _create_or_update_initial( + self, + device_name: str, + storage_account_name: str, + container_name: str, + resource_group_name: str, + container: "_models.Container", + **kwargs + ) -> Optional["_models.Container"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.Container"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-12-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._create_or_update_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'storageAccountName': self._serialize.url("storage_account_name", storage_account_name, 'str'), + 'containerName': self._serialize.url("container_name", container_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(container, 'Container') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('Container', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/storageAccounts/{storageAccountName}/containers/{containerName}'} # type: ignore + + async def begin_create_or_update( + self, + device_name: str, + storage_account_name: str, + container_name: str, + resource_group_name: str, + container: "_models.Container", + **kwargs + ) -> AsyncLROPoller["_models.Container"]: + """Creates a new container or updates an existing container on the device. + + Creates a new container or updates an existing container on the device. + + :param device_name: The device name. + :type device_name: str + :param storage_account_name: The Storage Account Name. + :type storage_account_name: str + :param container_name: The container name. + :type container_name: str + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param container: The container properties. + :type container: ~azure.mgmt.databoxedge.v2020_12_01.models.Container + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: Pass in True if you'd like the AsyncARMPolling polling method, + False for no polling, or your own initialized polling object for a 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[~azure.mgmt.databoxedge.v2020_12_01.models.Container] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Container"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._create_or_update_initial( + device_name=device_name, + storage_account_name=storage_account_name, + container_name=container_name, + resource_group_name=resource_group_name, + container=container, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('Container', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'storageAccountName': self._serialize.url("storage_account_name", storage_account_name, 'str'), + 'containerName': self._serialize.url("container_name", container_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/storageAccounts/{storageAccountName}/containers/{containerName}'} # type: ignore + + async def _delete_initial( + self, + device_name: str, + storage_account_name: str, + container_name: str, + resource_group_name: str, + **kwargs + ) -> None: + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-12-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: Pass in True if you'd like the AsyncARMPolling polling method, + False for no polling, or your own initialized polling object for a 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 = "2020-12-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: Pass in True if you'd like the AsyncARMPolling polling method, + False for no polling, or your own initialized polling object for a 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/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/datab/aio/operations/_devices_operations.py b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/datab/aio/operations/_devices_operations.py new file mode 100644 index 000000000000..f3bc67df017d --- /dev/null +++ b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/datab/aio/operations/_devices_operations.py @@ -0,0 +1,1363 @@ +# 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 as _models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class DevicesOperations: + """DevicesOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.databoxedge.v2020_12_01.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[~azure.mgmt.databoxedge.v2020_12_01.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 = "2020-12-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[~azure.mgmt.databoxedge.v2020_12_01.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 = "2020-12-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: ~azure.mgmt.databoxedge.v2020_12_01.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 = "2020-12-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, + data_box_edge_device: "_models.DataBoxEdgeDevice", + **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', {})) + api_version = "2020-12-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, + data_box_edge_device: "_models.DataBoxEdgeDevice", + **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 data_box_edge_device: The resource object. + :type data_box_edge_device: ~azure.mgmt.databoxedge.v2020_12_01.models.DataBoxEdgeDevice + :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: Pass in True if you'd like the AsyncARMPolling polling method, + False for no polling, or your own initialized polling object for a 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[~azure.mgmt.databoxedge.v2020_12_01.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, + data_box_edge_device=data_box_edge_device, + 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 = "2020-12-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: Pass in True if you'd like the AsyncARMPolling polling method, + False for no polling, or your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._delete_initial( + device_name=device_name, + resource_group_name=resource_group_name, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}'} # type: ignore + + async def update( + self, + device_name: str, + resource_group_name: str, + parameters: "_models.DataBoxEdgeDevicePatch", + **kwargs + ) -> "_models.DataBoxEdgeDevice": + """Modifies a Data Box Edge/Data Box Gateway resource. + + :param device_name: The device name. + :type device_name: str + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param parameters: The resource parameters. + :type parameters: ~azure.mgmt.databoxedge.v2020_12_01.models.DataBoxEdgeDevicePatch + :keyword callable cls: A custom type or function that will be passed the direct response + :return: DataBoxEdgeDevice, or the result of cls(response) + :rtype: ~azure.mgmt.databoxedge.v2020_12_01.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 = "2020-12-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update.metadata['url'] # type: ignore + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, 'DataBoxEdgeDevicePatch') + body_content_kwargs['content'] = body_content + request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('DataBoxEdgeDevice', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}'} # type: ignore + + async def _download_updates_initial( + self, + device_name: str, + resource_group_name: str, + **kwargs + ) -> None: + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-12-01" + accept = "application/json" + + # Construct URL + url = self._download_updates_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _download_updates_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/downloadUpdates'} # type: ignore + + async def begin_download_updates( + self, + device_name: str, + resource_group_name: str, + **kwargs + ) -> AsyncLROPoller[None]: + """Downloads the updates on a Data Box Edge/Data Box Gateway device. + + Downloads the updates on a Data Box Edge/Data Box Gateway device. + + :param device_name: The device name. + :type device_name: str + :param resource_group_name: The resource group name. + :type resource_group_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: Pass in True if you'd like the AsyncARMPolling polling method, + False for no polling, or your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._download_updates_initial( + device_name=device_name, + resource_group_name=resource_group_name, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_download_updates.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/downloadUpdates'} # type: ignore + + async def generate_certificate( + self, + device_name: str, + resource_group_name: str, + **kwargs + ) -> "_models.GenerateCertResponse": + """Generates certificate for activation key. + + :param device_name: The device name. + :type device_name: str + :param resource_group_name: The resource group name. + :type resource_group_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: GenerateCertResponse, or the result of cls(response) + :rtype: ~azure.mgmt.databoxedge.v2020_12_01.models.GenerateCertResponse + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.GenerateCertResponse"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-12-01" + accept = "application/json" + + # Construct URL + url = self.generate_certificate.metadata['url'] # type: ignore + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('GenerateCertResponse', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + generate_certificate.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/generateCertificate'} # type: ignore + + async def get_extended_information( + self, + device_name: str, + resource_group_name: str, + **kwargs + ) -> "_models.DataBoxEdgeDeviceExtendedInfo": + """Gets additional information for the specified Azure Stack Edge/Data Box Gateway device. + + :param device_name: The device name. + :type device_name: str + :param resource_group_name: The resource group name. + :type resource_group_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: DataBoxEdgeDeviceExtendedInfo, or the result of cls(response) + :rtype: ~azure.mgmt.databoxedge.v2020_12_01.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 = "2020-12-01" + accept = "application/json" + + # Construct URL + url = self.get_extended_information.metadata['url'] # type: ignore + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('DataBoxEdgeDeviceExtendedInfo', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_extended_information.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/getExtendedInformation'} # type: ignore + + async def _install_updates_initial( + self, + device_name: str, + resource_group_name: str, + **kwargs + ) -> None: + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-12-01" + accept = "application/json" + + # Construct URL + url = self._install_updates_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _install_updates_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/installUpdates'} # type: ignore + + async def begin_install_updates( + self, + device_name: str, + resource_group_name: str, + **kwargs + ) -> AsyncLROPoller[None]: + """Installs the updates on the Data Box Edge/Data Box Gateway device. + + Installs the updates on the Data Box Edge/Data Box Gateway device. + + :param device_name: The device name. + :type device_name: str + :param resource_group_name: The resource group name. + :type resource_group_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: Pass in True if you'd like the AsyncARMPolling polling method, + False for no polling, or your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._install_updates_initial( + device_name=device_name, + resource_group_name=resource_group_name, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_install_updates.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/installUpdates'} # type: ignore + + async def get_network_settings( + self, + device_name: str, + resource_group_name: str, + **kwargs + ) -> "_models.NetworkSettings": + """Gets the network settings of the specified Data Box Edge/Data Box Gateway device. + + :param device_name: The device name. + :type device_name: str + :param resource_group_name: The resource group name. + :type resource_group_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: NetworkSettings, or the result of cls(response) + :rtype: ~azure.mgmt.databoxedge.v2020_12_01.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 = "2020-12-01" + accept = "application/json" + + # Construct URL + url = self.get_network_settings.metadata['url'] # type: ignore + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('NetworkSettings', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_network_settings.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/networkSettings/default'} # type: ignore + + async def _scan_for_updates_initial( + self, + device_name: str, + resource_group_name: str, + **kwargs + ) -> None: + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-12-01" + accept = "application/json" + + # Construct URL + url = self._scan_for_updates_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _scan_for_updates_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/scanForUpdates'} # type: ignore + + async def begin_scan_for_updates( + self, + device_name: str, + resource_group_name: str, + **kwargs + ) -> AsyncLROPoller[None]: + """Scans for updates on a Data Box Edge/Data Box Gateway device. + + Scans for updates on a Data Box Edge/Data Box Gateway device. + + :param device_name: The device name. + :type device_name: str + :param resource_group_name: The resource group name. + :type resource_group_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: Pass in True if you'd like the AsyncARMPolling polling method, + False for no polling, or your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._scan_for_updates_initial( + device_name=device_name, + resource_group_name=resource_group_name, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_scan_for_updates.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/scanForUpdates'} # type: ignore + + async def _create_or_update_security_settings_initial( + self, + device_name: str, + resource_group_name: str, + security_settings: "_models.SecuritySettings", + **kwargs + ) -> None: + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-12-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._create_or_update_security_settings_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(security_settings, 'SecuritySettings') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _create_or_update_security_settings_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/securitySettings/default/update'} # type: ignore + + async def begin_create_or_update_security_settings( + self, + device_name: str, + resource_group_name: str, + security_settings: "_models.SecuritySettings", + **kwargs + ) -> AsyncLROPoller[None]: + """Updates the security settings on a Data Box Edge/Data Box Gateway device. + + :param device_name: The device name. + :type device_name: str + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param security_settings: The security settings. + :type security_settings: ~azure.mgmt.databoxedge.v2020_12_01.models.SecuritySettings + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: Pass in True if you'd like the AsyncARMPolling polling method, + False for no polling, or your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._create_or_update_security_settings_initial( + device_name=device_name, + resource_group_name=resource_group_name, + security_settings=security_settings, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create_or_update_security_settings.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/securitySettings/default/update'} # type: ignore + + async def update_extended_information( + self, + device_name: str, + resource_group_name: str, + parameters: "_models.DataBoxEdgeDeviceExtendedInfoPatch", + **kwargs + ) -> "_models.DataBoxEdgeDeviceExtendedInfo": + """Gets additional information for the specified Data Box Edge/Data Box Gateway device. + + :param device_name: The device name. + :type device_name: str + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param parameters: The patch object. + :type parameters: ~azure.mgmt.databoxedge.v2020_12_01.models.DataBoxEdgeDeviceExtendedInfoPatch + :keyword callable cls: A custom type or function that will be passed the direct response + :return: DataBoxEdgeDeviceExtendedInfo, or the result of cls(response) + :rtype: ~azure.mgmt.databoxedge.v2020_12_01.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 = "2020-12-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update_extended_information.metadata['url'] # type: ignore + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, 'DataBoxEdgeDeviceExtendedInfoPatch') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('DataBoxEdgeDeviceExtendedInfo', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update_extended_information.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/updateExtendedInformation'} # type: ignore + + async def get_update_summary( + self, + device_name: str, + resource_group_name: str, + **kwargs + ) -> "_models.UpdateSummary": + """Gets information about the availability of updates based on the last scan of the device. It also gets information about any ongoing download or install jobs on the device. + + Gets information about the availability of updates based on the last scan of the device. It + also gets information about any ongoing download or install jobs on the device. + + :param device_name: The device name. + :type device_name: str + :param resource_group_name: The resource group name. + :type resource_group_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: UpdateSummary, or the result of cls(response) + :rtype: ~azure.mgmt.databoxedge.v2020_12_01.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 = "2020-12-01" + accept = "application/json" + + # Construct URL + url = self.get_update_summary.metadata['url'] # type: ignore + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('UpdateSummary', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_update_summary.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/updateSummary/default'} # type: ignore + + async def upload_certificate( + self, + device_name: str, + resource_group_name: str, + parameters: "_models.UploadCertificateRequest", + **kwargs + ) -> "_models.UploadCertificateResponse": + """Uploads registration certificate for the device. + + :param device_name: The device name. + :type device_name: str + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param parameters: The upload certificate request. + :type parameters: ~azure.mgmt.databoxedge.v2020_12_01.models.UploadCertificateRequest + :keyword callable cls: A custom type or function that will be passed the direct response + :return: UploadCertificateResponse, or the result of cls(response) + :rtype: ~azure.mgmt.databoxedge.v2020_12_01.models.UploadCertificateResponse + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.UploadCertificateResponse"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-12-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/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/datab/aio/operations/_jobs_operations.py b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/datab/aio/operations/_jobs_operations.py new file mode 100644 index 000000000000..792da56690ad --- /dev/null +++ b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/datab/aio/operations/_jobs_operations.py @@ -0,0 +1,105 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, Callable, Dict, Generic, Optional, TypeVar +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.mgmt.core.exceptions import ARMErrorFormat + +from ... import models as _models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class JobsOperations: + """JobsOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.databoxedge.v2020_12_01.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: ~azure.mgmt.databoxedge.v2020_12_01.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 = "2020-12-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/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/datab/aio/operations/_monitoring_config_operations.py b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/datab/aio/operations/_monitoring_config_operations.py new file mode 100644 index 000000000000..23fd343f2ac8 --- /dev/null +++ b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/datab/aio/operations/_monitoring_config_operations.py @@ -0,0 +1,440 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling + +from ... import models as _models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class MonitoringConfigOperations: + """MonitoringConfigOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.databoxedge.v2020_12_01.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list( + self, + device_name: str, + role_name: str, + resource_group_name: str, + **kwargs + ) -> AsyncIterable["_models.MonitoringMetricConfigurationList"]: + """Lists metric configurations in a role. + + Lists metric configurations in a role. + + :param device_name: The device name. + :type device_name: str + :param role_name: The role name. + :type role_name: str + :param resource_group_name: The resource group name. + :type resource_group_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either MonitoringMetricConfigurationList or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.databoxedge.v2020_12_01.models.MonitoringMetricConfigurationList] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.MonitoringMetricConfigurationList"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-12-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list.metadata['url'] # type: ignore + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'roleName': self._serialize.url("role_name", role_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('MonitoringMetricConfigurationList', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/roles/{roleName}/monitoringConfig'} # type: ignore + + async def get( + self, + device_name: str, + role_name: str, + resource_group_name: str, + **kwargs + ) -> "_models.MonitoringMetricConfiguration": + """Gets a metric configuration of a role. + + Gets a metric configuration of a role. + + :param device_name: The device name. + :type device_name: str + :param role_name: The role name. + :type role_name: str + :param resource_group_name: The resource group name. + :type resource_group_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: MonitoringMetricConfiguration, or the result of cls(response) + :rtype: ~azure.mgmt.databoxedge.v2020_12_01.models.MonitoringMetricConfiguration + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.MonitoringMetricConfiguration"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-12-01" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'roleName': self._serialize.url("role_name", role_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('MonitoringMetricConfiguration', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/roles/{roleName}/monitoringConfig/default'} # type: ignore + + async def _create_or_update_initial( + self, + device_name: str, + role_name: str, + resource_group_name: str, + monitoring_metric_configuration: "_models.MonitoringMetricConfiguration", + **kwargs + ) -> Optional["_models.MonitoringMetricConfiguration"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.MonitoringMetricConfiguration"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-12-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._create_or_update_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'roleName': self._serialize.url("role_name", role_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(monitoring_metric_configuration, 'MonitoringMetricConfiguration') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('MonitoringMetricConfiguration', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/roles/{roleName}/monitoringConfig/default'} # type: ignore + + async def begin_create_or_update( + self, + device_name: str, + role_name: str, + resource_group_name: str, + monitoring_metric_configuration: "_models.MonitoringMetricConfiguration", + **kwargs + ) -> AsyncLROPoller["_models.MonitoringMetricConfiguration"]: + """Creates a new metric configuration or updates an existing one for a role. + + Creates a new metric configuration or updates an existing one for a role. + + :param device_name: The device name. + :type device_name: str + :param role_name: The role name. + :type role_name: str + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param monitoring_metric_configuration: The metric configuration. + :type monitoring_metric_configuration: ~azure.mgmt.databoxedge.v2020_12_01.models.MonitoringMetricConfiguration + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: Pass in True if you'd like the AsyncARMPolling polling method, + False for no polling, or your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either MonitoringMetricConfiguration or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.databoxedge.v2020_12_01.models.MonitoringMetricConfiguration] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.MonitoringMetricConfiguration"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._create_or_update_initial( + device_name=device_name, + role_name=role_name, + resource_group_name=resource_group_name, + monitoring_metric_configuration=monitoring_metric_configuration, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('MonitoringMetricConfiguration', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'roleName': self._serialize.url("role_name", role_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/roles/{roleName}/monitoringConfig/default'} # type: ignore + + async def _delete_initial( + self, + device_name: str, + role_name: str, + resource_group_name: str, + **kwargs + ) -> None: + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-12-01" + accept = "application/json" + + # Construct URL + url = self._delete_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'roleName': self._serialize.url("role_name", role_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/roles/{roleName}/monitoringConfig/default'} # type: ignore + + async def begin_delete( + self, + device_name: str, + role_name: str, + resource_group_name: str, + **kwargs + ) -> AsyncLROPoller[None]: + """deletes a new metric configuration for a role. + + deletes a new metric configuration for a role. + + :param device_name: The device name. + :type device_name: str + :param role_name: The role name. + :type role_name: str + :param resource_group_name: The resource group name. + :type resource_group_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: Pass in True if you'd like the AsyncARMPolling polling method, + False for no polling, or your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._delete_initial( + device_name=device_name, + role_name=role_name, + resource_group_name=resource_group_name, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'roleName': self._serialize.url("role_name", role_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/roles/{roleName}/monitoringConfig/default'} # type: ignore diff --git a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/datab/aio/operations/_nodes_operations.py b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/datab/aio/operations/_nodes_operations.py new file mode 100644 index 000000000000..fb78384ebf77 --- /dev/null +++ b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/datab/aio/operations/_nodes_operations.py @@ -0,0 +1,116 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.mgmt.core.exceptions import ARMErrorFormat + +from ... import models as _models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class NodesOperations: + """NodesOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.databoxedge.v2020_12_01.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[~azure.mgmt.databoxedge.v2020_12_01.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 = "2020-12-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_by_data_box_edge_device.metadata['url'] # type: ignore + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('NodeList', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_by_data_box_edge_device.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/nodes'} # type: ignore diff --git a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/datab/aio/operations/_operations.py b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/datab/aio/operations/_operations.py new file mode 100644 index 000000000000..9b025645c727 --- /dev/null +++ b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/datab/aio/operations/_operations.py @@ -0,0 +1,106 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.mgmt.core.exceptions import ARMErrorFormat + +from ... import models as _models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class Operations: + """Operations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.databoxedge.v2020_12_01.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[~azure.mgmt.databoxedge.v2020_12_01.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 = "2020-12-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/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/datab/aio/operations/_operations_status_operations.py b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/datab/aio/operations/_operations_status_operations.py new file mode 100644 index 000000000000..7b3bd3020a35 --- /dev/null +++ b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/datab/aio/operations/_operations_status_operations.py @@ -0,0 +1,105 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, Callable, Dict, Generic, Optional, TypeVar +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.mgmt.core.exceptions import ARMErrorFormat + +from ... import models as _models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class OperationsStatusOperations: + """OperationsStatusOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.databoxedge.v2020_12_01.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: ~azure.mgmt.databoxedge.v2020_12_01.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 = "2020-12-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/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/datab/aio/operations/_orders_operations.py b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/datab/aio/operations/_orders_operations.py new file mode 100644 index 000000000000..13461d449752 --- /dev/null +++ b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/datab/aio/operations/_orders_operations.py @@ -0,0 +1,478 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling + +from ... import models as _models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class OrdersOperations: + """OrdersOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.databoxedge.v2020_12_01.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[~azure.mgmt.databoxedge.v2020_12_01.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 = "2020-12-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: ~azure.mgmt.databoxedge.v2020_12_01.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 = "2020-12-01" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('Order', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/orders/default'} # type: ignore + + async def _create_or_update_initial( + self, + device_name: str, + resource_group_name: str, + order: "_models.Order", + **kwargs + ) -> Optional["_models.Order"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.Order"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-12-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._create_or_update_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(order, 'Order') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('Order', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/orders/default'} # type: ignore + + async def begin_create_or_update( + self, + device_name: str, + resource_group_name: str, + order: "_models.Order", + **kwargs + ) -> AsyncLROPoller["_models.Order"]: + """Creates or updates an order. + + Creates or updates an order. + + :param device_name: The order details of a device. + :type device_name: str + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param order: The order to be created or updated. + :type order: ~azure.mgmt.databoxedge.v2020_12_01.models.Order + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: Pass in True if you'd like the AsyncARMPolling polling method, + False for no polling, or your own initialized polling object for a 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[~azure.mgmt.databoxedge.v2020_12_01.models.Order] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Order"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._create_or_update_initial( + device_name=device_name, + resource_group_name=resource_group_name, + order=order, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('Order', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/orders/default'} # type: ignore + + async def _delete_initial( + self, + device_name: str, + resource_group_name: str, + **kwargs + ) -> None: + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-12-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: Pass in True if you'd like the AsyncARMPolling polling method, + False for no polling, or your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._delete_initial( + device_name=device_name, + resource_group_name=resource_group_name, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/orders/default'} # type: ignore + + async def list_dc_access_code( + self, + device_name: str, + resource_group_name: str, + **kwargs + ) -> "_models.DCAccessCode": + """Gets the DCAccess Code. + + Gets the DCAccess Code. + + :param device_name: The device name. + :type device_name: str + :param resource_group_name: The resource group name. + :type resource_group_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: DCAccessCode, or the result of cls(response) + :rtype: ~azure.mgmt.databoxedge.v2020_12_01.models.DCAccessCode + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.DCAccessCode"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-12-01" + accept = "application/json" + + # Construct URL + url = self.list_dc_access_code.metadata['url'] # type: ignore + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('DCAccessCode', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + list_dc_access_code.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/orders/default/listDCAccessCode'} # type: ignore diff --git a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/datab/aio/operations/_roles_operations.py b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/datab/aio/operations/_roles_operations.py new file mode 100644 index 000000000000..c48fb03eb036 --- /dev/null +++ b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/datab/aio/operations/_roles_operations.py @@ -0,0 +1,428 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling + +from ... import models as _models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class RolesOperations: + """RolesOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.databoxedge.v2020_12_01.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[~azure.mgmt.databoxedge.v2020_12_01.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 = "2020-12-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: ~azure.mgmt.databoxedge.v2020_12_01.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 = "2020-12-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 = "2020-12-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: ~azure.mgmt.databoxedge.v2020_12_01.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: Pass in True if you'd like the AsyncARMPolling polling method, + False for no polling, or your own initialized polling object for a 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[~azure.mgmt.databoxedge.v2020_12_01.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 = "2020-12-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: Pass in True if you'd like the AsyncARMPolling polling method, + False for no polling, or your own initialized polling object for a 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/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/datab/aio/operations/_shares_operations.py b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/datab/aio/operations/_shares_operations.py new file mode 100644 index 000000000000..2dd990265729 --- /dev/null +++ b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/datab/aio/operations/_shares_operations.py @@ -0,0 +1,551 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling + +from ... import models as _models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class SharesOperations: + """SharesOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.databoxedge.v2020_12_01.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[~azure.mgmt.databoxedge.v2020_12_01.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 = "2020-12-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: ~azure.mgmt.databoxedge.v2020_12_01.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 = "2020-12-01" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('Share', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/shares/{name}'} # type: ignore + + async def _create_or_update_initial( + self, + device_name: str, + name: str, + resource_group_name: str, + share: "_models.Share", + **kwargs + ) -> Optional["_models.Share"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.Share"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-12-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._create_or_update_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(share, 'Share') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('Share', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/shares/{name}'} # type: ignore + + async def begin_create_or_update( + self, + device_name: str, + name: str, + resource_group_name: str, + share: "_models.Share", + **kwargs + ) -> AsyncLROPoller["_models.Share"]: + """Creates a new share or updates an existing share on the device. + + Creates a new share or updates an existing share on the device. + + :param device_name: The device name. + :type device_name: str + :param name: The share name. + :type name: str + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param share: The share properties. + :type share: ~azure.mgmt.databoxedge.v2020_12_01.models.Share + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: Pass in True if you'd like the AsyncARMPolling polling method, + False for no polling, or your own initialized polling object for a 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[~azure.mgmt.databoxedge.v2020_12_01.models.Share] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Share"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._create_or_update_initial( + device_name=device_name, + name=name, + resource_group_name=resource_group_name, + share=share, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('Share', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/shares/{name}'} # type: ignore + + async def _delete_initial( + self, + device_name: str, + name: str, + resource_group_name: str, + **kwargs + ) -> None: + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-12-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: Pass in True if you'd like the AsyncARMPolling polling method, + False for no polling, or your own initialized polling object for a 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 = "2020-12-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: Pass in True if you'd like the AsyncARMPolling polling method, + False for no polling, or your own initialized polling object for a 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/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/datab/aio/operations/_storage_account_credentials_operations.py b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/datab/aio/operations/_storage_account_credentials_operations.py new file mode 100644 index 000000000000..3289fffa87df --- /dev/null +++ b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/datab/aio/operations/_storage_account_credentials_operations.py @@ -0,0 +1,430 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling + +from ... import models as _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: ~azure.mgmt.databoxedge.v2020_12_01.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[~azure.mgmt.databoxedge.v2020_12_01.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 = "2020-12-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: ~azure.mgmt.databoxedge.v2020_12_01.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 = "2020-12-01" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('StorageAccountCredential', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/storageAccountCredentials/{name}'} # type: ignore + + async def _create_or_update_initial( + self, + device_name: str, + name: str, + resource_group_name: str, + storage_account_credential: "_models.StorageAccountCredential", + **kwargs + ) -> Optional["_models.StorageAccountCredential"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.StorageAccountCredential"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-12-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._create_or_update_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(storage_account_credential, 'StorageAccountCredential') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('StorageAccountCredential', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/storageAccountCredentials/{name}'} # type: ignore + + async def begin_create_or_update( + self, + device_name: str, + name: str, + resource_group_name: str, + storage_account_credential: "_models.StorageAccountCredential", + **kwargs + ) -> AsyncLROPoller["_models.StorageAccountCredential"]: + """Creates or updates the storage account credential. + + :param device_name: The device name. + :type device_name: str + :param name: The storage account credential name. + :type name: str + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param storage_account_credential: The storage account credential. + :type storage_account_credential: ~azure.mgmt.databoxedge.v2020_12_01.models.StorageAccountCredential + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: Pass in True if you'd like the AsyncARMPolling polling method, + False for no polling, or your own initialized polling object for a 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[~azure.mgmt.databoxedge.v2020_12_01.models.StorageAccountCredential] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.StorageAccountCredential"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._create_or_update_initial( + device_name=device_name, + name=name, + resource_group_name=resource_group_name, + storage_account_credential=storage_account_credential, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('StorageAccountCredential', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/storageAccountCredentials/{name}'} # type: ignore + + async def _delete_initial( + self, + device_name: str, + name: str, + resource_group_name: str, + **kwargs + ) -> None: + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-12-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: Pass in True if you'd like the AsyncARMPolling polling method, + False for no polling, or your own initialized polling object for a 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/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/datab/aio/operations/_storage_accounts_operations.py b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/datab/aio/operations/_storage_accounts_operations.py new file mode 100644 index 000000000000..6cc6cd15314f --- /dev/null +++ b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/datab/aio/operations/_storage_accounts_operations.py @@ -0,0 +1,434 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling + +from ... import models as _models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class StorageAccountsOperations: + """StorageAccountsOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.databoxedge.v2020_12_01.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list_by_data_box_edge_device( + self, + device_name: str, + resource_group_name: str, + **kwargs + ) -> AsyncIterable["_models.StorageAccountList"]: + """Lists all the StorageAccounts in a Data Box Edge/Data Box Gateway device. + + Lists all the StorageAccounts in a Data Box Edge/Data Box Gateway device. + + :param device_name: The device name. + :type device_name: str + :param resource_group_name: The resource group name. + :type resource_group_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either StorageAccountList or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.databoxedge.v2020_12_01.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 = "2020-12-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: ~azure.mgmt.databoxedge.v2020_12_01.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 = "2020-12-01" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'storageAccountName': self._serialize.url("storage_account_name", storage_account_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('StorageAccount', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/storageAccounts/{storageAccountName}'} # type: ignore + + async def _create_or_update_initial( + self, + device_name: str, + storage_account_name: str, + resource_group_name: str, + storage_account: "_models.StorageAccount", + **kwargs + ) -> Optional["_models.StorageAccount"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.StorageAccount"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-12-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._create_or_update_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'storageAccountName': self._serialize.url("storage_account_name", storage_account_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(storage_account, 'StorageAccount') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('StorageAccount', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/storageAccounts/{storageAccountName}'} # type: ignore + + async def begin_create_or_update( + self, + device_name: str, + storage_account_name: str, + resource_group_name: str, + storage_account: "_models.StorageAccount", + **kwargs + ) -> AsyncLROPoller["_models.StorageAccount"]: + """Creates a new StorageAccount or updates an existing StorageAccount on the device. + + Creates a new StorageAccount or updates an existing StorageAccount on the device. + + :param device_name: The device name. + :type device_name: str + :param storage_account_name: The StorageAccount name. + :type storage_account_name: str + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param storage_account: The StorageAccount properties. + :type storage_account: ~azure.mgmt.databoxedge.v2020_12_01.models.StorageAccount + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: Pass in True if you'd like the AsyncARMPolling polling method, + False for no polling, or your own initialized polling object for a 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[~azure.mgmt.databoxedge.v2020_12_01.models.StorageAccount] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.StorageAccount"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._create_or_update_initial( + device_name=device_name, + storage_account_name=storage_account_name, + resource_group_name=resource_group_name, + storage_account=storage_account, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('StorageAccount', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'storageAccountName': self._serialize.url("storage_account_name", storage_account_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/storageAccounts/{storageAccountName}'} # type: ignore + + async def _delete_initial( + self, + device_name: str, + storage_account_name: str, + resource_group_name: str, + **kwargs + ) -> None: + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-12-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: Pass in True if you'd like the AsyncARMPolling polling method, + False for no polling, or your own initialized polling object for a 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/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/datab/aio/operations/_triggers_operations.py b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/datab/aio/operations/_triggers_operations.py new file mode 100644 index 000000000000..9eab91ee9da8 --- /dev/null +++ b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/datab/aio/operations/_triggers_operations.py @@ -0,0 +1,434 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling + +from ... import models as _models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class TriggersOperations: + """TriggersOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.databoxedge.v2020_12_01.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[~azure.mgmt.databoxedge.v2020_12_01.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 = "2020-12-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: ~azure.mgmt.databoxedge.v2020_12_01.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 = "2020-12-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 = "2020-12-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: ~azure.mgmt.databoxedge.v2020_12_01.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: Pass in True if you'd like the AsyncARMPolling polling method, + False for no polling, or your own initialized polling object for a 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[~azure.mgmt.databoxedge.v2020_12_01.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 = "2020-12-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: Pass in True if you'd like the AsyncARMPolling polling method, + False for no polling, or your own initialized polling object for a 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/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/datab/aio/operations/_users_operations.py b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/datab/aio/operations/_users_operations.py new file mode 100644 index 000000000000..b3666cb2e9c5 --- /dev/null +++ b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/datab/aio/operations/_users_operations.py @@ -0,0 +1,434 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling + +from ... import models as _models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class UsersOperations: + """UsersOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.databoxedge.v2020_12_01.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list_by_data_box_edge_device( + self, + device_name: str, + resource_group_name: str, + filter: Optional[str] = None, + **kwargs + ) -> AsyncIterable["_models.UserList"]: + """Gets all the users registered on a Data Box Edge/Data Box Gateway device. + + :param device_name: The device name. + :type device_name: str + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param filter: Specify $filter='Type eq :code:``' to filter on user type property. + :type filter: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either UserList or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.databoxedge.v2020_12_01.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 = "2020-12-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: ~azure.mgmt.databoxedge.v2020_12_01.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 = "2020-12-01" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('User', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/users/{name}'} # type: ignore + + async def _create_or_update_initial( + self, + device_name: str, + name: str, + resource_group_name: str, + user: "_models.User", + **kwargs + ) -> Optional["_models.User"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.User"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-12-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._create_or_update_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(user, 'User') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('User', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/users/{name}'} # type: ignore + + async def begin_create_or_update( + self, + device_name: str, + name: str, + resource_group_name: str, + user: "_models.User", + **kwargs + ) -> AsyncLROPoller["_models.User"]: + """Creates a new user or updates an existing user's information on a Data Box Edge/Data Box + Gateway device. + + :param device_name: The device name. + :type device_name: str + :param name: The user name. + :type name: str + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param user: The user details. + :type user: ~azure.mgmt.databoxedge.v2020_12_01.models.User + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: Pass in True if you'd like the AsyncARMPolling polling method, + False for no polling, or your own initialized polling object for a 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[~azure.mgmt.databoxedge.v2020_12_01.models.User] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.User"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._create_or_update_initial( + device_name=device_name, + name=name, + resource_group_name=resource_group_name, + user=user, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('User', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/users/{name}'} # type: ignore + + async def _delete_initial( + self, + device_name: str, + name: str, + resource_group_name: str, + **kwargs + ) -> None: + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-12-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: Pass in True if you'd like the AsyncARMPolling polling method, + False for no polling, or your own initialized polling object for a 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/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/datab/models/__init__.py b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/datab/models/__init__.py new file mode 100644 index 000000000000..dbf0ba0fe2be --- /dev/null +++ b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/datab/models/__init__.py @@ -0,0 +1,487 @@ +# 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 ARMBaseModel + from ._models_py3 import Addon + from ._models_py3 import AddonList + from ._models_py3 import Address + from ._models_py3 import Alert + from ._models_py3 import AlertErrorDetails + from ._models_py3 import AlertList + from ._models_py3 import ArcAddon + from ._models_py3 import AsymmetricEncryptedSecret + from ._models_py3 import Authentication + from ._models_py3 import AzureContainerInfo + from ._models_py3 import BandwidthSchedule + from ._models_py3 import BandwidthSchedulesList + from ._models_py3 import ClientAccessRight + from ._models_py3 import CloudEdgeManagementRole + from ._models_py3 import CloudErrorBody + from ._models_py3 import CniConfig + from ._models_py3 import ComputeResource + from ._models_py3 import ContactDetails + from ._models_py3 import Container + from ._models_py3 import ContainerList + from ._models_py3 import DCAccessCode + from ._models_py3 import DataBoxEdgeDevice + from ._models_py3 import DataBoxEdgeDeviceExtendedInfo + from ._models_py3 import DataBoxEdgeDeviceExtendedInfoPatch + from ._models_py3 import DataBoxEdgeDeviceList + from ._models_py3 import DataBoxEdgeDevicePatch + from ._models_py3 import DataBoxEdgeMoveRequest + from ._models_py3 import DataBoxEdgeSku + from ._models_py3 import DataBoxEdgeSkuList + from ._models_py3 import DeviceSecrets + from ._models_py3 import EdgeProfile + from ._models_py3 import EdgeProfilePatch + from ._models_py3 import EdgeProfileSubscription + from ._models_py3 import EdgeProfileSubscriptionPatch + from ._models_py3 import EtcdInfo + from ._models_py3 import FileEventTrigger + from ._models_py3 import FileSourceInfo + from ._models_py3 import GenerateCertResponse + from ._models_py3 import ImageRepositoryCredential + from ._models_py3 import IoTAddon + from ._models_py3 import IoTDeviceInfo + from ._models_py3 import IoTEdgeAgentInfo + from ._models_py3 import IoTRole + from ._models_py3 import Ipv4Config + from ._models_py3 import Ipv6Config + from ._models_py3 import Job + from ._models_py3 import JobErrorDetails + from ._models_py3 import JobErrorItem + from ._models_py3 import KubernetesClusterInfo + from ._models_py3 import KubernetesIPConfiguration + from ._models_py3 import KubernetesRole + from ._models_py3 import KubernetesRoleCompute + from ._models_py3 import KubernetesRoleNetwork + from ._models_py3 import KubernetesRoleResources + from ._models_py3 import KubernetesRoleStorage + from ._models_py3 import KubernetesRoleStorageClassInfo + from ._models_py3 import LoadBalancerConfig + from ._models_py3 import MECRole + from ._models_py3 import MetricConfiguration + from ._models_py3 import MetricCounter + from ._models_py3 import MetricCounterSet + from ._models_py3 import MetricDimension + from ._models_py3 import MetricDimensionV1 + from ._models_py3 import MetricSpecificationV1 + from ._models_py3 import MonitoringMetricConfiguration + from ._models_py3 import MonitoringMetricConfigurationList + from ._models_py3 import MountPointMap + from ._models_py3 import NetworkAdapter + from ._models_py3 import NetworkAdapterPosition + from ._models_py3 import NetworkSettings + from ._models_py3 import Node + from ._models_py3 import NodeInfo + from ._models_py3 import NodeList + from ._models_py3 import Operation + from ._models_py3 import OperationDisplay + from ._models_py3 import OperationsList + from ._models_py3 import Order + from ._models_py3 import OrderList + from ._models_py3 import OrderStatus + from ._models_py3 import PeriodicTimerEventTrigger + from ._models_py3 import PeriodicTimerSourceInfo + from ._models_py3 import RefreshDetails + from ._models_py3 import ResourceIdentity + from ._models_py3 import ResourceMoveDetails + from ._models_py3 import ResourceTypeSku + from ._models_py3 import Role + from ._models_py3 import RoleList + from ._models_py3 import RoleSinkInfo + from ._models_py3 import Secret + from ._models_py3 import SecuritySettings + from ._models_py3 import ServiceSpecification + from ._models_py3 import Share + from ._models_py3 import ShareAccessRight + from ._models_py3 import ShareList + from ._models_py3 import Sku + from ._models_py3 import SkuCapability + from ._models_py3 import SkuCost + from ._models_py3 import SkuInformation + from ._models_py3 import SkuInformationList + from ._models_py3 import SkuLocationInfo + from ._models_py3 import StorageAccount + from ._models_py3 import StorageAccountCredential + from ._models_py3 import StorageAccountCredentialList + from ._models_py3 import StorageAccountList + from ._models_py3 import SubscriptionRegisteredFeatures + from ._models_py3 import SymmetricKey + from ._models_py3 import SystemData + from ._models_py3 import TrackingInfo + from ._models_py3 import Trigger + from ._models_py3 import TriggerList + from ._models_py3 import 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 ARMBaseModel # type: ignore + from ._models import Addon # type: ignore + from ._models import AddonList # type: ignore + from ._models import Address # type: ignore + from ._models import Alert # type: ignore + from ._models import AlertErrorDetails # type: ignore + from ._models import AlertList # type: ignore + from ._models import ArcAddon # type: ignore + from ._models import AsymmetricEncryptedSecret # type: ignore + from ._models import Authentication # type: ignore + from ._models import AzureContainerInfo # type: ignore + from ._models import BandwidthSchedule # type: ignore + from ._models import BandwidthSchedulesList # type: ignore + from ._models import ClientAccessRight # type: ignore + from ._models import CloudEdgeManagementRole # type: ignore + from ._models import CloudErrorBody # type: ignore + from ._models import CniConfig # type: ignore + from ._models import ComputeResource # type: ignore + from ._models import ContactDetails # type: ignore + from ._models import Container # type: ignore + from ._models import ContainerList # type: ignore + from ._models import DCAccessCode # type: ignore + from ._models import DataBoxEdgeDevice # type: ignore + from ._models import DataBoxEdgeDeviceExtendedInfo # type: ignore + from ._models import DataBoxEdgeDeviceExtendedInfoPatch # type: ignore + from ._models import DataBoxEdgeDeviceList # type: ignore + from ._models import DataBoxEdgeDevicePatch # type: ignore + from ._models import DataBoxEdgeMoveRequest # type: ignore + from ._models import DataBoxEdgeSku # type: ignore + from ._models import DataBoxEdgeSkuList # type: ignore + from ._models import DeviceSecrets # type: ignore + from ._models import EdgeProfile # type: ignore + from ._models import EdgeProfilePatch # type: ignore + from ._models import EdgeProfileSubscription # type: ignore + from ._models import EdgeProfileSubscriptionPatch # type: ignore + from ._models import EtcdInfo # type: ignore + from ._models import FileEventTrigger # type: ignore + from ._models import FileSourceInfo # type: ignore + from ._models import GenerateCertResponse # type: ignore + from ._models import ImageRepositoryCredential # type: ignore + from ._models import IoTAddon # type: ignore + from ._models import IoTDeviceInfo # type: ignore + from ._models import IoTEdgeAgentInfo # type: ignore + from ._models import IoTRole # type: ignore + from ._models import Ipv4Config # type: ignore + from ._models import Ipv6Config # type: ignore + from ._models import Job # type: ignore + from ._models import JobErrorDetails # type: ignore + from ._models import JobErrorItem # type: ignore + from ._models import KubernetesClusterInfo # type: ignore + from ._models import KubernetesIPConfiguration # type: ignore + from ._models import KubernetesRole # type: ignore + from ._models import KubernetesRoleCompute # type: ignore + from ._models import KubernetesRoleNetwork # type: ignore + from ._models import KubernetesRoleResources # type: ignore + from ._models import KubernetesRoleStorage # type: ignore + from ._models import KubernetesRoleStorageClassInfo # type: ignore + from ._models import LoadBalancerConfig # type: ignore + from ._models import MECRole # type: ignore + from ._models import MetricConfiguration # type: ignore + from ._models import MetricCounter # type: ignore + from ._models import MetricCounterSet # type: ignore + from ._models import MetricDimension # type: ignore + from ._models import MetricDimensionV1 # type: ignore + from ._models import MetricSpecificationV1 # type: ignore + from ._models import MonitoringMetricConfiguration # type: ignore + from ._models import MonitoringMetricConfigurationList # type: ignore + from ._models import MountPointMap # type: ignore + from ._models import NetworkAdapter # type: ignore + from ._models import NetworkAdapterPosition # type: ignore + from ._models import NetworkSettings # type: ignore + from ._models import Node # type: ignore + from ._models import NodeInfo # type: ignore + from ._models import NodeList # type: ignore + from ._models import Operation # type: ignore + from ._models import OperationDisplay # type: ignore + from ._models import OperationsList # type: ignore + from ._models import Order # type: ignore + from ._models import OrderList # type: ignore + from ._models import OrderStatus # type: ignore + from ._models import PeriodicTimerEventTrigger # type: ignore + from ._models import PeriodicTimerSourceInfo # type: ignore + from ._models import RefreshDetails # type: ignore + from ._models import ResourceIdentity # type: ignore + from ._models import ResourceMoveDetails # type: ignore + from ._models import ResourceTypeSku # type: ignore + from ._models import Role # type: ignore + from ._models import RoleList # type: ignore + from ._models import RoleSinkInfo # type: ignore + from ._models import Secret # type: ignore + from ._models import SecuritySettings # type: ignore + from ._models import ServiceSpecification # type: ignore + from ._models import Share # type: ignore + from ._models import ShareAccessRight # type: ignore + from ._models import ShareList # type: ignore + from ._models import Sku # type: ignore + from ._models import SkuCapability # type: ignore + from ._models import SkuCost # type: ignore + from ._models import SkuInformation # type: ignore + from ._models import SkuInformationList # type: ignore + from ._models import SkuLocationInfo # type: ignore + from ._models import StorageAccount # type: ignore + from ._models import StorageAccountCredential # type: ignore + from ._models import StorageAccountCredentialList # type: ignore + from ._models import StorageAccountList # type: ignore + from ._models import SubscriptionRegisteredFeatures # type: ignore + from ._models import SymmetricKey # type: ignore + from ._models import SystemData # type: ignore + from ._models import TrackingInfo # type: ignore + from ._models import Trigger # type: ignore + from ._models import TriggerList # type: ignore + from ._models import 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, + AddonState, + AddonType, + AlertSeverity, + AuthenticationType, + AzureContainerDataFormat, + ClientPermissionType, + ContainerStatus, + CreatedByType, + DataBoxEdgeDeviceKind, + DataBoxEdgeDeviceStatus, + DataPolicy, + DayOfWeek, + DeviceType, + DownloadPhase, + EncryptionAlgorithm, + HostPlatformType, + InstallRebootBehavior, + JobStatus, + JobType, + KeyVaultSyncStatus, + KubernetesNodeType, + KubernetesState, + MetricAggregationType, + MetricCategory, + MetricUnit, + MonitoringStatus, + MountType, + MsiIdentityType, + NetworkAdapterDHCPStatus, + NetworkAdapterRDMAStatus, + NetworkAdapterStatus, + NetworkGroup, + NodeStatus, + OrderState, + PlatformType, + PosixComplianceStatus, + ResourceMoveStatus, + RoleStatus, + RoleTypes, + SSLStatus, + ShareAccessProtocol, + ShareAccessType, + ShareStatus, + ShipmentType, + SkuAvailability, + SkuName, + SkuSignupOption, + SkuTier, + SkuVersion, + StorageAccountStatus, + SubscriptionState, + TimeGrain, + TriggerEventType, + UpdateOperation, + UpdateOperationStage, + UserType, +) + +__all__ = [ + 'ARMBaseModel', + 'Addon', + 'AddonList', + 'Address', + 'Alert', + 'AlertErrorDetails', + 'AlertList', + 'ArcAddon', + 'AsymmetricEncryptedSecret', + 'Authentication', + 'AzureContainerInfo', + 'BandwidthSchedule', + 'BandwidthSchedulesList', + 'ClientAccessRight', + 'CloudEdgeManagementRole', + 'CloudErrorBody', + 'CniConfig', + 'ComputeResource', + 'ContactDetails', + 'Container', + 'ContainerList', + 'DCAccessCode', + 'DataBoxEdgeDevice', + 'DataBoxEdgeDeviceExtendedInfo', + 'DataBoxEdgeDeviceExtendedInfoPatch', + 'DataBoxEdgeDeviceList', + 'DataBoxEdgeDevicePatch', + 'DataBoxEdgeMoveRequest', + 'DataBoxEdgeSku', + 'DataBoxEdgeSkuList', + 'DeviceSecrets', + 'EdgeProfile', + 'EdgeProfilePatch', + 'EdgeProfileSubscription', + 'EdgeProfileSubscriptionPatch', + 'EtcdInfo', + 'FileEventTrigger', + 'FileSourceInfo', + 'GenerateCertResponse', + 'ImageRepositoryCredential', + 'IoTAddon', + 'IoTDeviceInfo', + 'IoTEdgeAgentInfo', + 'IoTRole', + 'Ipv4Config', + 'Ipv6Config', + 'Job', + 'JobErrorDetails', + 'JobErrorItem', + 'KubernetesClusterInfo', + 'KubernetesIPConfiguration', + 'KubernetesRole', + 'KubernetesRoleCompute', + 'KubernetesRoleNetwork', + 'KubernetesRoleResources', + 'KubernetesRoleStorage', + 'KubernetesRoleStorageClassInfo', + 'LoadBalancerConfig', + 'MECRole', + 'MetricConfiguration', + 'MetricCounter', + 'MetricCounterSet', + 'MetricDimension', + 'MetricDimensionV1', + 'MetricSpecificationV1', + 'MonitoringMetricConfiguration', + 'MonitoringMetricConfigurationList', + 'MountPointMap', + 'NetworkAdapter', + 'NetworkAdapterPosition', + 'NetworkSettings', + 'Node', + 'NodeInfo', + 'NodeList', + 'Operation', + 'OperationDisplay', + 'OperationsList', + 'Order', + 'OrderList', + 'OrderStatus', + 'PeriodicTimerEventTrigger', + 'PeriodicTimerSourceInfo', + 'RefreshDetails', + 'ResourceIdentity', + 'ResourceMoveDetails', + 'ResourceTypeSku', + 'Role', + 'RoleList', + 'RoleSinkInfo', + 'Secret', + 'SecuritySettings', + 'ServiceSpecification', + 'Share', + 'ShareAccessRight', + 'ShareList', + 'Sku', + 'SkuCapability', + 'SkuCost', + 'SkuInformation', + 'SkuInformationList', + 'SkuLocationInfo', + 'StorageAccount', + 'StorageAccountCredential', + 'StorageAccountCredentialList', + 'StorageAccountList', + 'SubscriptionRegisteredFeatures', + 'SymmetricKey', + 'SystemData', + 'TrackingInfo', + 'Trigger', + 'TriggerList', + 'UpdateDownloadProgress', + 'UpdateInstallProgress', + 'UpdateSummary', + 'UploadCertificateRequest', + 'UploadCertificateResponse', + 'User', + 'UserAccessRight', + 'UserList', + 'AccountType', + 'AddonState', + 'AddonType', + 'AlertSeverity', + 'AuthenticationType', + 'AzureContainerDataFormat', + 'ClientPermissionType', + 'ContainerStatus', + 'CreatedByType', + 'DataBoxEdgeDeviceKind', + 'DataBoxEdgeDeviceStatus', + 'DataPolicy', + 'DayOfWeek', + 'DeviceType', + 'DownloadPhase', + 'EncryptionAlgorithm', + 'HostPlatformType', + 'InstallRebootBehavior', + 'JobStatus', + 'JobType', + 'KeyVaultSyncStatus', + 'KubernetesNodeType', + 'KubernetesState', + 'MetricAggregationType', + 'MetricCategory', + 'MetricUnit', + 'MonitoringStatus', + 'MountType', + 'MsiIdentityType', + 'NetworkAdapterDHCPStatus', + 'NetworkAdapterRDMAStatus', + 'NetworkAdapterStatus', + 'NetworkGroup', + 'NodeStatus', + 'OrderState', + 'PlatformType', + 'PosixComplianceStatus', + 'ResourceMoveStatus', + 'RoleStatus', + 'RoleTypes', + 'SSLStatus', + 'ShareAccessProtocol', + 'ShareAccessType', + 'ShareStatus', + 'ShipmentType', + 'SkuAvailability', + 'SkuName', + 'SkuSignupOption', + 'SkuTier', + 'SkuVersion', + 'StorageAccountStatus', + 'SubscriptionState', + 'TimeGrain', + 'TriggerEventType', + 'UpdateOperation', + 'UpdateOperationStage', + 'UserType', +] diff --git a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/datab/models/_data_box_edge_management_client_enums.py b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/datab/models/_data_box_edge_management_client_enums.py new file mode 100644 index 000000000000..8bf52f24f0f2 --- /dev/null +++ b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/datab/models/_data_box_edge_management_client_enums.py @@ -0,0 +1,557 @@ +# 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 AddonState(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Addon Provisioning State + """ + + INVALID = "Invalid" + CREATING = "Creating" + CREATED = "Created" + UPDATING = "Updating" + RECONFIGURING = "Reconfiguring" + FAILED = "Failed" + DELETING = "Deleting" + +class AddonType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Addon type. + """ + + IOT_EDGE = "IotEdge" + ARC_FOR_KUBERNETES = "ArcForKubernetes" + +class AlertSeverity(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Severity of the alert. + """ + + INFORMATIONAL = "Informational" + WARNING = "Warning" + CRITICAL = "Critical" + +class AuthenticationType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """The authentication type. + """ + + INVALID = "Invalid" + AZURE_ACTIVE_DIRECTORY = "AzureActiveDirectory" + +class AzureContainerDataFormat(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Storage format used for the file represented by the share. + """ + + BLOCK_BLOB = "BlockBlob" + PAGE_BLOB = "PageBlob" + AZURE_FILE = "AzureFile" + +class ClientPermissionType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Type of access to be allowed for the client. + """ + + NO_ACCESS = "NoAccess" + READ_ONLY = "ReadOnly" + READ_WRITE = "ReadWrite" + +class ContainerStatus(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Current status of the container. + """ + + OK = "OK" + OFFLINE = "Offline" + UNKNOWN = "Unknown" + UPDATING = "Updating" + NEEDS_ATTENTION = "NeedsAttention" + +class CreatedByType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """The type of identity that created the resource. + """ + + USER = "User" + APPLICATION = "Application" + MANAGED_IDENTITY = "ManagedIdentity" + KEY = "Key" + +class DataBoxEdgeDeviceKind(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """The etag for the devices. + """ + + AZURE_DATA_BOX_GATEWAY = "AzureDataBoxGateway" + AZURE_STACK_EDGE = "AzureStackEdge" + AZURE_STACK_HUB = "AzureStackHub" + AZURE_MODULAR_DATA_CENTRE = "AzureModularDataCentre" + +class DataBoxEdgeDeviceStatus(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """The status of the Data Box Edge/Gateway device. + """ + + READY_TO_SETUP = "ReadyToSetup" + ONLINE = "Online" + OFFLINE = "Offline" + NEEDS_ATTENTION = "NeedsAttention" + DISCONNECTED = "Disconnected" + PARTIALLY_DISCONNECTED = "PartiallyDisconnected" + MAINTENANCE = "Maintenance" + +class DataPolicy(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Data policy of the share. + """ + + CLOUD = "Cloud" + LOCAL = "Local" + +class DayOfWeek(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + + SUNDAY = "Sunday" + MONDAY = "Monday" + TUESDAY = "Tuesday" + WEDNESDAY = "Wednesday" + THURSDAY = "Thursday" + FRIDAY = "Friday" + SATURDAY = "Saturday" + +class DeviceType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """The type of the Data Box Edge/Gateway device. + """ + + DATA_BOX_EDGE_DEVICE = "DataBoxEdgeDevice" + +class DownloadPhase(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """The download phase. + """ + + UNKNOWN = "Unknown" + INITIALIZING = "Initializing" + DOWNLOADING = "Downloading" + VERIFYING = "Verifying" + +class EncryptionAlgorithm(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """The algorithm used to encrypt "Value". + """ + + NONE = "None" + AES256 = "AES256" + RSAES_PKCS1_V1_5 = "RSAES_PKCS1_v_1_5" + +class HostPlatformType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Platform where the runtime is hosted. + """ + + KUBERNETES_CLUSTER = "KubernetesCluster" + LINUX_VM = "LinuxVM" + +class InstallRebootBehavior(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Indicates if updates are available and at least one of the updates needs a reboot. + """ + + NEVER_REBOOTS = "NeverReboots" + REQUIRES_REBOOT = "RequiresReboot" + REQUEST_REBOOT = "RequestReboot" + +class JobStatus(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """The current status of the job. + """ + + INVALID = "Invalid" + RUNNING = "Running" + SUCCEEDED = "Succeeded" + FAILED = "Failed" + CANCELED = "Canceled" + PAUSED = "Paused" + SCHEDULED = "Scheduled" + +class JobType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """The type of the job. + """ + + INVALID = "Invalid" + SCAN_FOR_UPDATES = "ScanForUpdates" + DOWNLOAD_UPDATES = "DownloadUpdates" + INSTALL_UPDATES = "InstallUpdates" + REFRESH_SHARE = "RefreshShare" + REFRESH_CONTAINER = "RefreshContainer" + BACKUP = "Backup" + RESTORE = "Restore" + TRIGGER_SUPPORT_PACKAGE = "TriggerSupportPackage" + +class KeyVaultSyncStatus(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """For changing or to initiate the resync to key-vault set the status to KeyVaultSyncPending, rest + of the status will not be applicable. + """ + + KEY_VAULT_SYNCED = "KeyVaultSynced" + KEY_VAULT_SYNC_FAILED = "KeyVaultSyncFailed" + KEY_VAULT_NOT_CONFIGURED = "KeyVaultNotConfigured" + KEY_VAULT_SYNC_PENDING = "KeyVaultSyncPending" + KEY_VAULT_SYNCING = "KeyVaultSyncing" + +class KubernetesNodeType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Node type - Master/Worker + """ + + INVALID = "Invalid" + MASTER = "Master" + WORKER = "Worker" + +class KubernetesState(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """State of Kubernetes deployment + """ + + INVALID = "Invalid" + CREATING = "Creating" + CREATED = "Created" + UPDATING = "Updating" + RECONFIGURING = "Reconfiguring" + FAILED = "Failed" + DELETING = "Deleting" + +class MetricAggregationType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Metric aggregation type. + """ + + NOT_SPECIFIED = "NotSpecified" + NONE = "None" + AVERAGE = "Average" + MINIMUM = "Minimum" + MAXIMUM = "Maximum" + TOTAL = "Total" + COUNT = "Count" + +class MetricCategory(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Metric category. + """ + + CAPACITY = "Capacity" + TRANSACTION = "Transaction" + +class MetricUnit(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Metric units. + """ + + NOT_SPECIFIED = "NotSpecified" + PERCENT = "Percent" + COUNT = "Count" + SECONDS = "Seconds" + MILLISECONDS = "Milliseconds" + BYTES = "Bytes" + BYTES_PER_SECOND = "BytesPerSecond" + COUNT_PER_SECOND = "CountPerSecond" + +class MonitoringStatus(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Current monitoring status of the share. + """ + + ENABLED = "Enabled" + DISABLED = "Disabled" + +class MountType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Mounting type. + """ + + VOLUME = "Volume" + HOST_PATH = "HostPath" + +class MsiIdentityType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Identity type + """ + + NONE = "None" + SYSTEM_ASSIGNED = "SystemAssigned" + USER_ASSIGNED = "UserAssigned" + +class NetworkAdapterDHCPStatus(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Value indicating whether this adapter has DHCP enabled. + """ + + DISABLED = "Disabled" + ENABLED = "Enabled" + +class NetworkAdapterRDMAStatus(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Value indicating whether this adapter is RDMA capable. + """ + + INCAPABLE = "Incapable" + CAPABLE = "Capable" + +class NetworkAdapterStatus(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Value indicating whether this adapter is valid. + """ + + INACTIVE = "Inactive" + ACTIVE = "Active" + +class NetworkGroup(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """The network group. + """ + + NONE = "None" + NON_RDMA = "NonRDMA" + RDMA = "RDMA" + +class NodeStatus(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """The current status of the individual node + """ + + UNKNOWN = "Unknown" + UP = "Up" + DOWN = "Down" + REBOOTING = "Rebooting" + SHUTTING_DOWN = "ShuttingDown" + +class OrderState(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Status of the order as per the allowed status types. + """ + + UNTRACKED = "Untracked" + AWAITING_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" + AWAITING_PICKUP = "AwaitingPickup" + PICKUP_COMPLETED = "PickupCompleted" + AWAITING_DROP = "AwaitingDrop" + +class PlatformType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Host OS supported by the Arc addon. + """ + + WINDOWS = "Windows" + LINUX = "Linux" + +class PosixComplianceStatus(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """If provisioned storage is posix compliant. + """ + + INVALID = "Invalid" + ENABLED = "Enabled" + DISABLED = "Disabled" + +class ResourceMoveStatus(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Denotes whether move operation is in progress + """ + + NONE = "None" + RESOURCE_MOVE_IN_PROGRESS = "ResourceMoveInProgress" + RESOURCE_MOVE_FAILED = "ResourceMoveFailed" + +class RoleStatus(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Local Edge Management Status + """ + + ENABLED = "Enabled" + DISABLED = "Disabled" + +class RoleTypes(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + + IOT = "IOT" + ASA = "ASA" + FUNCTIONS = "Functions" + COGNITIVE = "Cognitive" + MEC = "MEC" + CLOUD_EDGE_MANAGEMENT = "CloudEdgeManagement" + KUBERNETES = "Kubernetes" + +class ShareAccessProtocol(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Access protocol to be used by the share. + """ + + SMB = "SMB" + NFS = "NFS" + +class ShareAccessType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Type of access to be allowed on the share for this user. + """ + + CHANGE = "Change" + READ = "Read" + CUSTOM = "Custom" + +class ShareStatus(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Current status of the share. + """ + + OFFLINE = "Offline" + UNKNOWN = "Unknown" + OK = "OK" + UPDATING = "Updating" + NEEDS_ATTENTION = "NeedsAttention" + +class ShipmentType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + + NOT_APPLICABLE = "NotApplicable" + SHIPPED_TO_CUSTOMER = "ShippedToCustomer" + SELF_PICKUP = "SelfPickup" + +class SkuAvailability(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Links to the next set of results + """ + + AVAILABLE = "Available" + UNAVAILABLE = "Unavailable" + +class SkuName(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """The Sku name. + """ + + GATEWAY = "Gateway" + EDGE = "Edge" + TEA1_NODE = "TEA_1Node" + TEA1_NODE_UPS = "TEA_1Node_UPS" + TEA1_NODE_HEATER = "TEA_1Node_Heater" + TEA1_NODE_UPS_HEATER = "TEA_1Node_UPS_Heater" + TEA4_NODE_HEATER = "TEA_4Node_Heater" + TEA4_NODE_UPS_HEATER = "TEA_4Node_UPS_Heater" + TMA = "TMA" + TDC = "TDC" + TCA_SMALL = "TCA_Small" + GPU = "GPU" + TCA_LARGE = "TCA_Large" + EDGE_P_BASE = "EdgeP_Base" + EDGE_P_HIGH = "EdgeP_High" + EDGE_PR_BASE = "EdgePR_Base" + EDGE_PR_BASE_UPS = "EdgePR_Base_UPS" + EDGE_MR_MINI = "EdgeMR_Mini" + RCA_SMALL = "RCA_Small" + RCA_LARGE = "RCA_Large" + RDC = "RDC" + +class SkuSignupOption(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Sku can be signed up by customer or not. + """ + + NONE = "None" + AVAILABLE = "Available" + +class SkuTier(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """The Sku tier. + """ + + STANDARD = "Standard" + +class SkuVersion(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Availability of the Sku as preview/stable. + """ + + STABLE = "Stable" + PREVIEW = "Preview" + +class SSLStatus(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Signifies whether SSL needs to be enabled or not. + """ + + ENABLED = "Enabled" + DISABLED = "Disabled" + +class StorageAccountStatus(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Current status of the storage account + """ + + OK = "OK" + OFFLINE = "Offline" + UNKNOWN = "Unknown" + UPDATING = "Updating" + NEEDS_ATTENTION = "NeedsAttention" + +class SubscriptionState(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + + REGISTERED = "Registered" + WARNED = "Warned" + SUSPENDED = "Suspended" + DELETED = "Deleted" + UNREGISTERED = "Unregistered" + +class TimeGrain(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + + PT1_M = "PT1M" + PT5_M = "PT5M" + PT15_M = "PT15M" + PT30_M = "PT30M" + PT1_H = "PT1H" + PT6_H = "PT6H" + PT12_H = "PT12H" + PT1_D = "PT1D" + +class TriggerEventType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Trigger Kind. + """ + + FILE_EVENT = "FileEvent" + PERIODIC_TIMER_EVENT = "PeriodicTimerEvent" + +class UpdateOperation(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """The current update operation. + """ + + NONE = "None" + SCAN = "Scan" + DOWNLOAD = "Download" + INSTALL = "Install" + +class UpdateOperationStage(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Current stage of the update operation. + """ + + UNKNOWN = "Unknown" + INITIAL = "Initial" + SCAN_STARTED = "ScanStarted" + SCAN_COMPLETE = "ScanComplete" + SCAN_FAILED = "ScanFailed" + DOWNLOAD_STARTED = "DownloadStarted" + DOWNLOAD_COMPLETE = "DownloadComplete" + DOWNLOAD_FAILED = "DownloadFailed" + INSTALL_STARTED = "InstallStarted" + INSTALL_COMPLETE = "InstallComplete" + INSTALL_FAILED = "InstallFailed" + REBOOT_INITIATED = "RebootInitiated" + SUCCESS = "Success" + FAILURE = "Failure" + RESCAN_STARTED = "RescanStarted" + RESCAN_COMPLETE = "RescanComplete" + RESCAN_FAILED = "RescanFailed" + +class UserType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Type of the user. + """ + + SHARE = "Share" + LOCAL_MANAGEMENT = "LocalManagement" + ARM = "ARM" diff --git a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/datab/models/_models.py b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/datab/models/_models.py new file mode 100644 index 000000000000..88a49cb1ce06 --- /dev/null +++ b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/datab/models/_models.py @@ -0,0 +1,5119 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +import msrest.serialization + + +class ARMBaseModel(msrest.serialization.Model): + """Represents the base class for all object models. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: The path ID that uniquely identifies the object. + :vartype id: str + :ivar name: The object name. + :vartype name: str + :ivar type: The hierarchical type of the object. + :vartype type: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ARMBaseModel, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None + + +class Addon(ARMBaseModel): + """Role Addon. + + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: ArcAddon, IoTAddon. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: The path ID that uniquely identifies the object. + :vartype id: str + :ivar name: The object name. + :vartype name: str + :ivar type: The hierarchical type of the object. + :vartype type: str + :param kind: Required. Addon type.Constant filled by server. Possible values include: + "IotEdge", "ArcForKubernetes". + :type kind: str or ~azure.mgmt.databoxedge.v2020_12_01.models.AddonType + :ivar system_data: Addon type. + :vartype system_data: ~azure.mgmt.databoxedge.v2020_12_01.models.SystemData + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'kind': {'required': True}, + 'system_data': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + } + + _subtype_map = { + 'kind': {'ArcForKubernetes': 'ArcAddon', 'IotEdge': 'IoTAddon'} + } + + def __init__( + self, + **kwargs + ): + super(Addon, self).__init__(**kwargs) + self.kind = 'Addon' # type: str + self.system_data = None + + +class AddonList(msrest.serialization.Model): + """Collection of all the Role addon on the Azure Stack Edge device. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar value: The Value. + :vartype value: list[~azure.mgmt.databoxedge.v2020_12_01.models.Addon] + :ivar next_link: Link to the next set of results. + :vartype next_link: str + """ + + _validation = { + 'value': {'readonly': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[Addon]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(AddonList, self).__init__(**kwargs) + self.value = None + self.next_link = None + + +class Address(msrest.serialization.Model): + """The shipping address of the customer. + + All required parameters must be populated in order to send to Azure. + + :param address_line1: The address line1. + :type address_line1: str + :param address_line2: The address line2. + :type address_line2: str + :param address_line3: The address line3. + :type address_line3: str + :param postal_code: The postal code. + :type postal_code: str + :param city: The city name. + :type city: str + :param state: The state name. + :type state: str + :param country: Required. The country name. + :type country: str + """ + + _validation = { + 'country': {'required': True}, + } + + _attribute_map = { + 'address_line1': {'key': 'addressLine1', 'type': 'str'}, + 'address_line2': {'key': 'addressLine2', 'type': 'str'}, + 'address_line3': {'key': 'addressLine3', 'type': 'str'}, + 'postal_code': {'key': 'postalCode', 'type': 'str'}, + 'city': {'key': 'city', 'type': 'str'}, + 'state': {'key': 'state', 'type': 'str'}, + 'country': {'key': 'country', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(Address, self).__init__(**kwargs) + self.address_line1 = kwargs.get('address_line1', None) + self.address_line2 = kwargs.get('address_line2', None) + self.address_line3 = kwargs.get('address_line3', None) + self.postal_code = kwargs.get('postal_code', None) + self.city = kwargs.get('city', None) + self.state = kwargs.get('state', None) + self.country = kwargs['country'] + + +class Alert(ARMBaseModel): + """Alert on the data box edge/gateway device. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: The path ID that uniquely identifies the object. + :vartype id: str + :ivar name: The object name. + :vartype name: str + :ivar type: The hierarchical type of the object. + :vartype type: str + :ivar system_data: Alert generated in the resource. + :vartype system_data: ~azure.mgmt.databoxedge.v2020_12_01.models.SystemData + :ivar title: Alert title. + :vartype title: str + :ivar alert_type: Alert type. + :vartype alert_type: str + :ivar appeared_at_date_time: UTC time when the alert appeared. + :vartype appeared_at_date_time: ~datetime.datetime + :ivar recommendation: Alert recommendation. + :vartype recommendation: str + :ivar severity: Severity of the alert. Possible values include: "Informational", "Warning", + "Critical". + :vartype severity: str or ~azure.mgmt.databoxedge.v2020_12_01.models.AlertSeverity + :ivar error_details: Error details of the alert. + :vartype error_details: ~azure.mgmt.databoxedge.v2020_12_01.models.AlertErrorDetails + :ivar detailed_information: Alert details. + :vartype detailed_information: dict[str, str] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'system_data': {'readonly': True}, + 'title': {'readonly': True}, + 'alert_type': {'readonly': True}, + 'appeared_at_date_time': {'readonly': True}, + 'recommendation': {'readonly': True}, + 'severity': {'readonly': True}, + 'error_details': {'readonly': True}, + 'detailed_information': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'title': {'key': 'properties.title', 'type': 'str'}, + 'alert_type': {'key': 'properties.alertType', 'type': 'str'}, + 'appeared_at_date_time': {'key': 'properties.appearedAtDateTime', 'type': 'iso-8601'}, + 'recommendation': {'key': 'properties.recommendation', 'type': 'str'}, + 'severity': {'key': 'properties.severity', 'type': 'str'}, + 'error_details': {'key': 'properties.errorDetails', 'type': 'AlertErrorDetails'}, + 'detailed_information': {'key': 'properties.detailedInformation', 'type': '{str}'}, + } + + def __init__( + self, + **kwargs + ): + super(Alert, self).__init__(**kwargs) + self.system_data = None + self.title = None + self.alert_type = None + self.appeared_at_date_time = None + self.recommendation = None + self.severity = None + self.error_details = None + self.detailed_information = None + + +class AlertErrorDetails(msrest.serialization.Model): + """Error details for the alert. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar error_code: Error code. + :vartype error_code: str + :ivar error_message: Error Message. + :vartype error_message: str + :ivar occurrences: Number of occurrences. + :vartype occurrences: int + """ + + _validation = { + 'error_code': {'readonly': True}, + 'error_message': {'readonly': True}, + 'occurrences': {'readonly': True}, + } + + _attribute_map = { + 'error_code': {'key': 'errorCode', 'type': 'str'}, + 'error_message': {'key': 'errorMessage', 'type': 'str'}, + 'occurrences': {'key': 'occurrences', 'type': 'int'}, + } + + def __init__( + self, + **kwargs + ): + super(AlertErrorDetails, self).__init__(**kwargs) + self.error_code = None + self.error_message = None + self.occurrences = None + + +class AlertList(msrest.serialization.Model): + """Collection of alerts. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar value: The value. + :vartype value: list[~azure.mgmt.databoxedge.v2020_12_01.models.Alert] + :ivar next_link: Link to the next set of results. + :vartype next_link: str + """ + + _validation = { + 'value': {'readonly': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[Alert]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(AlertList, self).__init__(**kwargs) + self.value = None + self.next_link = None + + +class ArcAddon(Addon): + """Arc Addon. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: The path ID that uniquely identifies the object. + :vartype id: str + :ivar name: The object name. + :vartype name: str + :ivar type: The hierarchical type of the object. + :vartype type: str + :param kind: Required. Addon type.Constant filled by server. Possible values include: + "IotEdge", "ArcForKubernetes". + :type kind: str or ~azure.mgmt.databoxedge.v2020_12_01.models.AddonType + :ivar system_data: Addon type. + :vartype system_data: ~azure.mgmt.databoxedge.v2020_12_01.models.SystemData + :param subscription_id: Required. Arc resource subscription Id. + :type subscription_id: str + :param resource_group_name: Required. Arc resource group name. + :type resource_group_name: str + :param resource_name: Required. Arc resource Name. + :type resource_name: str + :param resource_location: Required. Arc resource location. + :type resource_location: str + :ivar version: Arc resource version. + :vartype version: str + :ivar host_platform: Host OS supported by the Arc addon. Possible values include: "Windows", + "Linux". + :vartype host_platform: str or ~azure.mgmt.databoxedge.v2020_12_01.models.PlatformType + :ivar host_platform_type: Platform where the runtime is hosted. Possible values include: + "KubernetesCluster", "LinuxVM". + :vartype host_platform_type: str or ~azure.mgmt.databoxedge.v2020_12_01.models.HostPlatformType + :ivar provisioning_state: Addon Provisioning State. Possible values include: "Invalid", + "Creating", "Created", "Updating", "Reconfiguring", "Failed", "Deleting". + :vartype provisioning_state: str or ~azure.mgmt.databoxedge.v2020_12_01.models.AddonState + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'kind': {'required': True}, + 'system_data': {'readonly': True}, + 'subscription_id': {'required': True}, + 'resource_group_name': {'required': True}, + 'resource_name': {'required': True}, + 'resource_location': {'required': True}, + 'version': {'readonly': True}, + 'host_platform': {'readonly': True}, + 'host_platform_type': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'subscription_id': {'key': 'properties.subscriptionId', 'type': 'str'}, + 'resource_group_name': {'key': 'properties.resourceGroupName', 'type': 'str'}, + 'resource_name': {'key': 'properties.resourceName', 'type': 'str'}, + 'resource_location': {'key': 'properties.resourceLocation', 'type': 'str'}, + 'version': {'key': 'properties.version', 'type': 'str'}, + 'host_platform': {'key': 'properties.hostPlatform', 'type': 'str'}, + 'host_platform_type': {'key': 'properties.hostPlatformType', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ArcAddon, self).__init__(**kwargs) + self.kind = 'ArcForKubernetes' # type: str + self.subscription_id = kwargs['subscription_id'] + self.resource_group_name = kwargs['resource_group_name'] + self.resource_name = kwargs['resource_name'] + self.resource_location = kwargs['resource_location'] + self.version = None + self.host_platform = None + self.host_platform_type = None + self.provisioning_state = None + + +class AsymmetricEncryptedSecret(msrest.serialization.Model): + """Represent the secrets intended for encryption with asymmetric key pair. + + All required parameters must be populated in order to send to Azure. + + :param value: Required. The value of the secret. + :type value: str + :param encryption_cert_thumbprint: Thumbprint certificate used to encrypt \"Value\". If the + value is unencrypted, it will be null. + :type encryption_cert_thumbprint: str + :param encryption_algorithm: Required. The algorithm used to encrypt "Value". Possible values + include: "None", "AES256", "RSAES_PKCS1_v_1_5". + :type encryption_algorithm: str or + ~azure.mgmt.databoxedge.v2020_12_01.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: ~azure.mgmt.databoxedge.v2020_12_01.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 ~azure.mgmt.databoxedge.v2020_12_01.models.AzureContainerDataFormat + """ + + _validation = { + 'storage_account_credential_id': {'required': True}, + 'container_name': {'required': True}, + 'data_format': {'required': True}, + } + + _attribute_map = { + 'storage_account_credential_id': {'key': 'storageAccountCredentialId', 'type': 'str'}, + 'container_name': {'key': 'containerName', 'type': 'str'}, + 'data_format': {'key': 'dataFormat', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(AzureContainerInfo, self).__init__(**kwargs) + self.storage_account_credential_id = kwargs['storage_account_credential_id'] + self.container_name = kwargs['container_name'] + self.data_format = kwargs['data_format'] + + +class BandwidthSchedule(ARMBaseModel): + """The bandwidth schedule details. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: The path ID that uniquely identifies the object. + :vartype id: str + :ivar name: The object name. + :vartype name: str + :ivar type: The hierarchical type of the object. + :vartype type: str + :ivar system_data: Bandwidth object related to ASE resource. + :vartype system_data: ~azure.mgmt.databoxedge.v2020_12_01.models.SystemData + :param start: Required. The start time of the schedule in UTC. + :type start: str + :param stop: Required. The stop time of the schedule in UTC. + :type stop: str + :param rate_in_mbps: Required. The bandwidth rate in Mbps. + :type rate_in_mbps: int + :param days: Required. The days of the week when this schedule is applicable. + :type days: list[str or ~azure.mgmt.databoxedge.v2020_12_01.models.DayOfWeek] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'system_data': {'readonly': True}, + 'start': {'required': True}, + 'stop': {'required': True}, + 'rate_in_mbps': {'required': True}, + 'days': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'start': {'key': 'properties.start', 'type': 'str'}, + 'stop': {'key': 'properties.stop', 'type': 'str'}, + 'rate_in_mbps': {'key': 'properties.rateInMbps', 'type': 'int'}, + 'days': {'key': 'properties.days', 'type': '[str]'}, + } + + def __init__( + self, + **kwargs + ): + super(BandwidthSchedule, self).__init__(**kwargs) + self.system_data = None + self.start = kwargs['start'] + self.stop = kwargs['stop'] + self.rate_in_mbps = kwargs['rate_in_mbps'] + self.days = kwargs['days'] + + +class BandwidthSchedulesList(msrest.serialization.Model): + """The collection of bandwidth schedules. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar value: The list of bandwidth schedules. + :vartype value: list[~azure.mgmt.databoxedge.v2020_12_01.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 ~azure.mgmt.databoxedge.v2020_12_01.models.ClientPermissionType + """ + + _validation = { + 'client': {'required': True}, + 'access_permission': {'required': True}, + } + + _attribute_map = { + 'client': {'key': 'client', 'type': 'str'}, + 'access_permission': {'key': 'accessPermission', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ClientAccessRight, self).__init__(**kwargs) + self.client = kwargs['client'] + self.access_permission = kwargs['access_permission'] + + +class Role(ARMBaseModel): + """Compute role. + + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: CloudEdgeManagementRole, IoTRole, KubernetesRole, MECRole. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: The path ID that uniquely identifies the object. + :vartype id: str + :ivar name: The object name. + :vartype name: str + :ivar type: The hierarchical type of the object. + :vartype type: str + :param kind: Required. Role type.Constant filled by server. Possible values include: "IOT", + "ASA", "Functions", "Cognitive", "MEC", "CloudEdgeManagement", "Kubernetes". + :type kind: str or ~azure.mgmt.databoxedge.v2020_12_01.models.RoleTypes + :ivar system_data: Role configured on ASE resource. + :vartype system_data: ~azure.mgmt.databoxedge.v2020_12_01.models.SystemData + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'kind': {'required': True}, + 'system_data': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + } + + _subtype_map = { + 'kind': {'CloudEdgeManagement': 'CloudEdgeManagementRole', 'IOT': 'IoTRole', 'Kubernetes': 'KubernetesRole', 'MEC': 'MECRole'} + } + + def __init__( + self, + **kwargs + ): + super(Role, self).__init__(**kwargs) + self.kind = 'Role' # type: str + self.system_data = None + + +class CloudEdgeManagementRole(Role): + """CloudEdgeManagementRole role. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: The path ID that uniquely identifies the object. + :vartype id: str + :ivar name: The object name. + :vartype name: str + :ivar type: The hierarchical type of the object. + :vartype type: str + :param kind: Required. Role type.Constant filled by server. Possible values include: "IOT", + "ASA", "Functions", "Cognitive", "MEC", "CloudEdgeManagement", "Kubernetes". + :type kind: str or ~azure.mgmt.databoxedge.v2020_12_01.models.RoleTypes + :ivar system_data: Role configured on ASE resource. + :vartype system_data: ~azure.mgmt.databoxedge.v2020_12_01.models.SystemData + :ivar local_management_status: Local Edge Management Status. Possible values include: + "Enabled", "Disabled". + :vartype local_management_status: str or ~azure.mgmt.databoxedge.v2020_12_01.models.RoleStatus + :ivar edge_profile: Edge Profile of the resource. + :vartype edge_profile: ~azure.mgmt.databoxedge.v2020_12_01.models.EdgeProfile + :param role_status: Role status. Possible values include: "Enabled", "Disabled". + :type role_status: str or ~azure.mgmt.databoxedge.v2020_12_01.models.RoleStatus + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'kind': {'required': True}, + 'system_data': {'readonly': True}, + 'local_management_status': {'readonly': True}, + 'edge_profile': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'local_management_status': {'key': 'properties.localManagementStatus', 'type': 'str'}, + 'edge_profile': {'key': 'properties.edgeProfile', 'type': 'EdgeProfile'}, + 'role_status': {'key': 'properties.roleStatus', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(CloudEdgeManagementRole, self).__init__(**kwargs) + self.kind = 'CloudEdgeManagement' # type: str + self.local_management_status = None + self.edge_profile = None + self.role_status = kwargs.get('role_status', None) + + +class CloudErrorBody(msrest.serialization.Model): + """An error response from the service. + + :param code: An identifier for the error. Codes are invariant and are intended to be consumed + programmatically. + :type code: str + :param message: A message describing the error, intended to be suitable for display in a user + interface. + :type message: str + :param details: A list of additional details about the error. + :type details: list[~azure.mgmt.databoxedge.v2020_12_01.models.CloudErrorBody] + """ + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + 'details': {'key': 'details', 'type': '[CloudErrorBody]'}, + } + + def __init__( + self, + **kwargs + ): + super(CloudErrorBody, self).__init__(**kwargs) + self.code = kwargs.get('code', None) + self.message = kwargs.get('message', None) + self.details = kwargs.get('details', None) + + +class CniConfig(msrest.serialization.Model): + """Cni configuration. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar type: Cni type. + :vartype type: str + :ivar version: Cni version. + :vartype version: str + :ivar pod_subnet: Pod Subnet. + :vartype pod_subnet: str + :ivar service_subnet: Service subnet. + :vartype service_subnet: str + """ + + _validation = { + 'type': {'readonly': True}, + 'version': {'readonly': True}, + 'pod_subnet': {'readonly': True}, + 'service_subnet': {'readonly': True}, + } + + _attribute_map = { + 'type': {'key': 'type', 'type': 'str'}, + 'version': {'key': 'version', 'type': 'str'}, + 'pod_subnet': {'key': 'podSubnet', 'type': 'str'}, + 'service_subnet': {'key': 'serviceSubnet', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(CniConfig, self).__init__(**kwargs) + self.type = None + self.version = None + self.pod_subnet = None + self.service_subnet = None + + +class ComputeResource(msrest.serialization.Model): + """Compute infrastructure Resource. + + All required parameters must be populated in order to send to Azure. + + :param processor_count: Required. Processor count. + :type processor_count: int + :param memory_in_gb: Required. Memory in GB. + :type memory_in_gb: long + """ + + _validation = { + 'processor_count': {'required': True}, + 'memory_in_gb': {'required': True}, + } + + _attribute_map = { + 'processor_count': {'key': 'processorCount', 'type': 'int'}, + 'memory_in_gb': {'key': 'memoryInGB', 'type': 'long'}, + } + + def __init__( + self, + **kwargs + ): + super(ComputeResource, self).__init__(**kwargs) + self.processor_count = kwargs['processor_count'] + self.memory_in_gb = kwargs['memory_in_gb'] + + +class ContactDetails(msrest.serialization.Model): + """Contains all the contact details of the customer. + + All required parameters must be populated in order to send to Azure. + + :param contact_person: Required. The contact person name. + :type contact_person: str + :param company_name: Required. The name of the company. + :type company_name: str + :param phone: Required. The phone number. + :type phone: str + :param email_list: Required. The email list. + :type email_list: list[str] + """ + + _validation = { + 'contact_person': {'required': True}, + 'company_name': {'required': True}, + 'phone': {'required': True}, + 'email_list': {'required': True}, + } + + _attribute_map = { + 'contact_person': {'key': 'contactPerson', 'type': 'str'}, + 'company_name': {'key': 'companyName', 'type': 'str'}, + 'phone': {'key': 'phone', 'type': 'str'}, + 'email_list': {'key': 'emailList', 'type': '[str]'}, + } + + def __init__( + self, + **kwargs + ): + super(ContactDetails, self).__init__(**kwargs) + self.contact_person = kwargs['contact_person'] + self.company_name = kwargs['company_name'] + self.phone = kwargs['phone'] + self.email_list = kwargs['email_list'] + + +class Container(ARMBaseModel): + """Represents a container on the Data Box Edge/Gateway device. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: The path ID that uniquely identifies the object. + :vartype id: str + :ivar name: The object name. + :vartype name: str + :ivar type: The hierarchical type of the object. + :vartype type: str + :ivar system_data: Container in DataBoxEdge Resource. + :vartype system_data: ~azure.mgmt.databoxedge.v2020_12_01.models.SystemData + :ivar container_status: Current status of the container. Possible values include: "OK", + "Offline", "Unknown", "Updating", "NeedsAttention". + :vartype container_status: str or ~azure.mgmt.databoxedge.v2020_12_01.models.ContainerStatus + :param data_format: Required. DataFormat for Container. Possible values include: "BlockBlob", + "PageBlob", "AzureFile". + :type data_format: str or ~azure.mgmt.databoxedge.v2020_12_01.models.AzureContainerDataFormat + :ivar refresh_details: Details of the refresh job on this container. + :vartype refresh_details: ~azure.mgmt.databoxedge.v2020_12_01.models.RefreshDetails + :ivar created_date_time: The UTC time when container got created. + :vartype created_date_time: ~datetime.datetime + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'system_data': {'readonly': True}, + 'container_status': {'readonly': True}, + 'data_format': {'required': True}, + 'refresh_details': {'readonly': True}, + 'created_date_time': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'container_status': {'key': 'properties.containerStatus', 'type': 'str'}, + 'data_format': {'key': 'properties.dataFormat', 'type': 'str'}, + 'refresh_details': {'key': 'properties.refreshDetails', 'type': 'RefreshDetails'}, + 'created_date_time': {'key': 'properties.createdDateTime', 'type': 'iso-8601'}, + } + + def __init__( + self, + **kwargs + ): + super(Container, self).__init__(**kwargs) + self.system_data = None + self.container_status = None + self.data_format = kwargs['data_format'] + self.refresh_details = None + self.created_date_time = None + + +class ContainerList(msrest.serialization.Model): + """Collection of all the containers on the Data Box Edge/Gateway device. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar value: The list of containers. + :vartype value: list[~azure.mgmt.databoxedge.v2020_12_01.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: ~azure.mgmt.databoxedge.v2020_12_01.models.Sku + :param etag: The etag for the devices. + :type etag: str + :param identity: Msi identity of the resource. + :type identity: ~azure.mgmt.databoxedge.v2020_12_01.models.ResourceIdentity + :ivar kind: The etag for the devices. Possible values include: "AzureDataBoxGateway", + "AzureStackEdge", "AzureStackHub", "AzureModularDataCentre". + :vartype kind: str or ~azure.mgmt.databoxedge.v2020_12_01.models.DataBoxEdgeDeviceKind + :ivar system_data: DataBoxEdge Resource. + :vartype system_data: ~azure.mgmt.databoxedge.v2020_12_01.models.SystemData + :param data_box_edge_device_status: The status of the Data Box Edge/Gateway device. Possible + values include: "ReadyToSetup", "Online", "Offline", "NeedsAttention", "Disconnected", + "PartiallyDisconnected", "Maintenance". + :type data_box_edge_device_status: str or + ~azure.mgmt.databoxedge.v2020_12_01.models.DataBoxEdgeDeviceStatus + :ivar serial_number: The Serial Number of Data Box Edge/Gateway device. + :vartype serial_number: str + :ivar description: The Description of the Data Box Edge/Gateway device. + :vartype description: str + :ivar model_description: The description of the Data Box Edge/Gateway device model. + :vartype model_description: str + :ivar device_type: The type of the Data Box Edge/Gateway device. Possible values include: + "DataBoxEdgeDevice". + :vartype device_type: str or ~azure.mgmt.databoxedge.v2020_12_01.models.DeviceType + :ivar friendly_name: The Data Box Edge/Gateway device name. + :vartype friendly_name: str + :ivar culture: The Data Box Edge/Gateway device culture. + :vartype culture: str + :ivar device_model: The Data Box Edge/Gateway device model. + :vartype device_model: str + :ivar device_software_version: The Data Box Edge/Gateway device software version. + :vartype device_software_version: str + :ivar device_local_capacity: The Data Box Edge/Gateway device local capacity in MB. + :vartype device_local_capacity: long + :ivar time_zone: The Data Box Edge/Gateway device timezone. + :vartype time_zone: str + :ivar device_hcs_version: The device software version number of the device (eg: 1.2.18105.6). + :vartype device_hcs_version: str + :ivar configured_role_types: Type of compute roles configured. + :vartype configured_role_types: list[str or + ~azure.mgmt.databoxedge.v2020_12_01.models.RoleTypes] + :ivar node_count: The number of nodes in the cluster. + :vartype node_count: int + :ivar resource_move_details: The details of the move operation on this resource. + :vartype resource_move_details: ~azure.mgmt.databoxedge.v2020_12_01.models.ResourceMoveDetails + :ivar edge_profile: The details of Edge Profile for this resource. + :vartype edge_profile: ~azure.mgmt.databoxedge.v2020_12_01.models.EdgeProfile + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': True}, + 'kind': {'readonly': True}, + 'system_data': {'readonly': True}, + 'serial_number': {'readonly': True}, + 'description': {'readonly': True}, + 'model_description': {'readonly': True}, + 'device_type': {'readonly': True}, + 'friendly_name': {'readonly': True}, + 'culture': {'readonly': True}, + 'device_model': {'readonly': True}, + 'device_software_version': {'readonly': True}, + 'device_local_capacity': {'readonly': True}, + 'time_zone': {'readonly': True}, + 'device_hcs_version': {'readonly': True}, + 'configured_role_types': {'readonly': True}, + 'node_count': {'readonly': True}, + 'resource_move_details': {'readonly': True}, + 'edge_profile': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'sku': {'key': 'sku', 'type': 'Sku'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'identity': {'key': 'identity', 'type': 'ResourceIdentity'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'data_box_edge_device_status': {'key': 'properties.dataBoxEdgeDeviceStatus', 'type': 'str'}, + 'serial_number': {'key': 'properties.serialNumber', 'type': 'str'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + 'model_description': {'key': 'properties.modelDescription', 'type': 'str'}, + 'device_type': {'key': 'properties.deviceType', 'type': 'str'}, + 'friendly_name': {'key': 'properties.friendlyName', 'type': 'str'}, + 'culture': {'key': 'properties.culture', 'type': 'str'}, + 'device_model': {'key': 'properties.deviceModel', 'type': 'str'}, + 'device_software_version': {'key': 'properties.deviceSoftwareVersion', 'type': 'str'}, + 'device_local_capacity': {'key': 'properties.deviceLocalCapacity', 'type': 'long'}, + 'time_zone': {'key': 'properties.timeZone', 'type': 'str'}, + 'device_hcs_version': {'key': 'properties.deviceHcsVersion', 'type': 'str'}, + 'configured_role_types': {'key': 'properties.configuredRoleTypes', 'type': '[str]'}, + 'node_count': {'key': 'properties.nodeCount', 'type': 'int'}, + 'resource_move_details': {'key': 'properties.resourceMoveDetails', 'type': 'ResourceMoveDetails'}, + 'edge_profile': {'key': 'properties.edgeProfile', 'type': 'EdgeProfile'}, + } + + def __init__( + self, + **kwargs + ): + super(DataBoxEdgeDevice, self).__init__(**kwargs) + self.location = kwargs['location'] + self.tags = kwargs.get('tags', None) + self.sku = kwargs.get('sku', None) + self.etag = kwargs.get('etag', None) + self.identity = kwargs.get('identity', None) + self.kind = None + self.system_data = None + self.data_box_edge_device_status = kwargs.get('data_box_edge_device_status', None) + self.serial_number = None + self.description = None + self.model_description = None + self.device_type = None + self.friendly_name = None + self.culture = None + self.device_model = None + self.device_software_version = None + self.device_local_capacity = None + self.time_zone = None + self.device_hcs_version = None + self.configured_role_types = None + self.node_count = None + self.resource_move_details = None + self.edge_profile = None + + +class DataBoxEdgeDeviceExtendedInfo(ARMBaseModel): + """The extended Info of the Data Box Edge/Gateway device. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: The path ID that uniquely identifies the object. + :vartype id: str + :ivar name: The object name. + :vartype name: str + :ivar type: The hierarchical type of the object. + :vartype type: str + :param encryption_key_thumbprint: The digital signature of encrypted certificate. + :type encryption_key_thumbprint: str + :param encryption_key: The public part of the encryption certificate. Client uses this to + encrypt any secret. + :type encryption_key: str + :ivar resource_key: The Resource ID of the Resource. + :vartype resource_key: str + :param client_secret_store_id: The Key Vault ARM Id for client secrets. + :type client_secret_store_id: str + :param client_secret_store_url: The url to access the Client Key Vault. + :type client_secret_store_url: str + :param channel_integrity_key_name: The name of Channel Integrity Key stored in the Client Key + Vault. + :type channel_integrity_key_name: str + :param channel_integrity_key_version: The version of Channel Integrity Key stored in the Client + Key Vault. + :type channel_integrity_key_version: str + :param key_vault_sync_status: Key vault sync status. Possible values include: "KeyVaultSynced", + "KeyVaultSyncFailed", "KeyVaultNotConfigured", "KeyVaultSyncPending", "KeyVaultSyncing". + :type key_vault_sync_status: str or + ~azure.mgmt.databoxedge.v2020_12_01.models.KeyVaultSyncStatus + :ivar device_secrets: Device secrets, will be returned only with ODataFilter + $expand=deviceSecrets. + :vartype device_secrets: ~azure.mgmt.databoxedge.v2020_12_01.models.DeviceSecrets + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'resource_key': {'readonly': True}, + 'device_secrets': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'encryption_key_thumbprint': {'key': 'properties.encryptionKeyThumbprint', 'type': 'str'}, + 'encryption_key': {'key': 'properties.encryptionKey', 'type': 'str'}, + 'resource_key': {'key': 'properties.resourceKey', 'type': 'str'}, + 'client_secret_store_id': {'key': 'properties.clientSecretStoreId', 'type': 'str'}, + 'client_secret_store_url': {'key': 'properties.clientSecretStoreUrl', 'type': 'str'}, + 'channel_integrity_key_name': {'key': 'properties.channelIntegrityKeyName', 'type': 'str'}, + 'channel_integrity_key_version': {'key': 'properties.channelIntegrityKeyVersion', 'type': 'str'}, + 'key_vault_sync_status': {'key': 'properties.keyVaultSyncStatus', 'type': 'str'}, + 'device_secrets': {'key': 'properties.deviceSecrets', 'type': 'DeviceSecrets'}, + } + + def __init__( + self, + **kwargs + ): + super(DataBoxEdgeDeviceExtendedInfo, self).__init__(**kwargs) + self.encryption_key_thumbprint = kwargs.get('encryption_key_thumbprint', None) + self.encryption_key = kwargs.get('encryption_key', None) + self.resource_key = None + self.client_secret_store_id = kwargs.get('client_secret_store_id', None) + self.client_secret_store_url = kwargs.get('client_secret_store_url', None) + self.channel_integrity_key_name = kwargs.get('channel_integrity_key_name', None) + self.channel_integrity_key_version = kwargs.get('channel_integrity_key_version', None) + self.key_vault_sync_status = kwargs.get('key_vault_sync_status', None) + self.device_secrets = None + + +class DataBoxEdgeDeviceExtendedInfoPatch(msrest.serialization.Model): + """The Data Box Edge/Gateway device extended info patch. + + :param client_secret_store_id: The Key Vault ARM Id for client secrets. + :type client_secret_store_id: str + :param client_secret_store_url: The url to access the Client Key Vault. + :type client_secret_store_url: str + :param channel_integrity_key_name: The name for Channel Integrity Key stored in the Client Key + Vault. + :type channel_integrity_key_name: str + :param channel_integrity_key_version: The version of Channel Integrity Key stored in the Client + Key Vault. + :type channel_integrity_key_version: str + :param sync_status: For changing or to initiate the resync to key-vault set the status to + KeyVaultSyncPending, rest of the status will not be applicable. Possible values include: + "KeyVaultSynced", "KeyVaultSyncFailed", "KeyVaultNotConfigured", "KeyVaultSyncPending", + "KeyVaultSyncing". + :type sync_status: str or ~azure.mgmt.databoxedge.v2020_12_01.models.KeyVaultSyncStatus + """ + + _attribute_map = { + 'client_secret_store_id': {'key': 'clientSecretStoreId', 'type': 'str'}, + 'client_secret_store_url': {'key': 'clientSecretStoreUrl', 'type': 'str'}, + 'channel_integrity_key_name': {'key': 'channelIntegrityKeyName', 'type': 'str'}, + 'channel_integrity_key_version': {'key': 'channelIntegrityKeyVersion', 'type': 'str'}, + 'sync_status': {'key': 'syncStatus', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(DataBoxEdgeDeviceExtendedInfoPatch, self).__init__(**kwargs) + self.client_secret_store_id = kwargs.get('client_secret_store_id', None) + self.client_secret_store_url = kwargs.get('client_secret_store_url', None) + self.channel_integrity_key_name = kwargs.get('channel_integrity_key_name', None) + self.channel_integrity_key_version = kwargs.get('channel_integrity_key_version', None) + self.sync_status = kwargs.get('sync_status', None) + + +class DataBoxEdgeDeviceList(msrest.serialization.Model): + """The collection of Data Box Edge/Gateway devices. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar value: The list of Data Box Edge/Gateway devices. + :vartype value: list[~azure.mgmt.databoxedge.v2020_12_01.models.DataBoxEdgeDevice] + :ivar next_link: Link to the next set of results. + :vartype next_link: str + """ + + _validation = { + 'value': {'readonly': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[DataBoxEdgeDevice]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(DataBoxEdgeDeviceList, self).__init__(**kwargs) + self.value = None + self.next_link = None + + +class DataBoxEdgeDevicePatch(msrest.serialization.Model): + """The Data Box Edge/Gateway device patch. + + :param tags: A set of tags. The tags attached to the Data Box Edge/Gateway resource. + :type tags: dict[str, str] + :param identity: Msi identity of the resource. + :type identity: ~azure.mgmt.databoxedge.v2020_12_01.models.ResourceIdentity + :param edge_profile: Edge Profile property of the Data Box Edge/Gateway device. + :type edge_profile: ~azure.mgmt.databoxedge.v2020_12_01.models.EdgeProfilePatch + """ + + _attribute_map = { + 'tags': {'key': 'tags', 'type': '{str}'}, + 'identity': {'key': 'identity', 'type': 'ResourceIdentity'}, + 'edge_profile': {'key': 'properties.edgeProfile', 'type': 'EdgeProfilePatch'}, + } + + def __init__( + self, + **kwargs + ): + super(DataBoxEdgeDevicePatch, self).__init__(**kwargs) + self.tags = kwargs.get('tags', None) + self.identity = kwargs.get('identity', None) + self.edge_profile = kwargs.get('edge_profile', None) + + +class DataBoxEdgeMoveRequest(msrest.serialization.Model): + """Resource Move details. + + All required parameters must be populated in order to send to Azure. + + :param target_resource_group: Required. Target resource group ARMId. + :type target_resource_group: str + :param resources: Required. List of resources to be moved. + :type resources: list[str] + """ + + _validation = { + 'target_resource_group': {'required': True}, + 'resources': {'required': True}, + } + + _attribute_map = { + 'target_resource_group': {'key': 'targetResourceGroup', 'type': 'str'}, + 'resources': {'key': 'resources', 'type': '[str]'}, + } + + def __init__( + self, + **kwargs + ): + super(DataBoxEdgeMoveRequest, self).__init__(**kwargs) + self.target_resource_group = kwargs['target_resource_group'] + self.resources = kwargs['resources'] + + +class DataBoxEdgeSku(msrest.serialization.Model): + """The Sku information. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar resource_type: The type of the resource. + :vartype resource_type: str + :ivar name: The Sku name. Possible values include: "Gateway", "Edge", "TEA_1Node", + "TEA_1Node_UPS", "TEA_1Node_Heater", "TEA_1Node_UPS_Heater", "TEA_4Node_Heater", + "TEA_4Node_UPS_Heater", "TMA", "TDC", "TCA_Small", "GPU", "TCA_Large", "EdgeP_Base", + "EdgeP_High", "EdgePR_Base", "EdgePR_Base_UPS", "EdgeMR_Mini", "RCA_Small", "RCA_Large", "RDC". + :vartype name: str or ~azure.mgmt.databoxedge.v2020_12_01.models.SkuName + :ivar kind: The Sku kind. + :vartype kind: str + :ivar tier: The Sku tier. Possible values include: "Standard". + :vartype tier: str or ~azure.mgmt.databoxedge.v2020_12_01.models.SkuTier + :ivar size: The Sku kind. + :vartype size: str + :ivar family: The Sku family. + :vartype family: str + :ivar locations: Availability of the Sku for the region. + :vartype locations: list[str] + :ivar api_versions: The API versions in which Sku is available. + :vartype api_versions: list[str] + :ivar location_info: Availability of the Sku for the location/zone/site. + :vartype location_info: list[~azure.mgmt.databoxedge.v2020_12_01.models.SkuLocationInfo] + :ivar costs: The pricing info of the Sku. + :vartype costs: list[~azure.mgmt.databoxedge.v2020_12_01.models.SkuCost] + :ivar signup_option: Sku can be signed up by customer or not. Possible values include: "None", + "Available". + :vartype signup_option: str or ~azure.mgmt.databoxedge.v2020_12_01.models.SkuSignupOption + :ivar version: Availability of the Sku as preview/stable. Possible values include: "Stable", + "Preview". + :vartype version: str or ~azure.mgmt.databoxedge.v2020_12_01.models.SkuVersion + :ivar availability: Links to the next set of results. Possible values include: "Available", + "Unavailable". + :vartype availability: str or ~azure.mgmt.databoxedge.v2020_12_01.models.SkuAvailability + :ivar shipment_types: List of Shipment Types supported by this SKU. + :vartype shipment_types: list[str or ~azure.mgmt.databoxedge.v2020_12_01.models.ShipmentType] + :ivar capabilities: The capability info of the SKU. + :vartype capabilities: list[~azure.mgmt.databoxedge.v2020_12_01.models.SkuCapability] + """ + + _validation = { + 'resource_type': {'readonly': True}, + 'name': {'readonly': True}, + 'kind': {'readonly': True}, + 'tier': {'readonly': True}, + 'size': {'readonly': True}, + 'family': {'readonly': True}, + 'locations': {'readonly': True}, + 'api_versions': {'readonly': True}, + 'location_info': {'readonly': True}, + 'costs': {'readonly': True}, + 'signup_option': {'readonly': True}, + 'version': {'readonly': True}, + 'availability': {'readonly': True}, + 'shipment_types': {'readonly': True}, + 'capabilities': {'readonly': True}, + } + + _attribute_map = { + 'resource_type': {'key': 'resourceType', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'tier': {'key': 'tier', 'type': 'str'}, + 'size': {'key': 'size', 'type': 'str'}, + 'family': {'key': 'family', 'type': 'str'}, + 'locations': {'key': 'locations', 'type': '[str]'}, + 'api_versions': {'key': 'apiVersions', 'type': '[str]'}, + 'location_info': {'key': 'locationInfo', 'type': '[SkuLocationInfo]'}, + 'costs': {'key': 'costs', 'type': '[SkuCost]'}, + 'signup_option': {'key': 'signupOption', 'type': 'str'}, + 'version': {'key': 'version', 'type': 'str'}, + 'availability': {'key': 'availability', 'type': 'str'}, + 'shipment_types': {'key': 'shipmentTypes', 'type': '[str]'}, + 'capabilities': {'key': 'capabilities', 'type': '[SkuCapability]'}, + } + + def __init__( + self, + **kwargs + ): + super(DataBoxEdgeSku, self).__init__(**kwargs) + self.resource_type = None + self.name = None + self.kind = None + self.tier = None + self.size = None + self.family = None + self.locations = None + self.api_versions = None + self.location_info = None + self.costs = None + self.signup_option = None + self.version = None + self.availability = None + self.shipment_types = None + self.capabilities = None + + +class DataBoxEdgeSkuList(msrest.serialization.Model): + """List of SKU Information objects. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar value: List of ResourceType Sku. + :vartype value: list[~azure.mgmt.databoxedge.v2020_12_01.models.DataBoxEdgeSku] + :ivar next_link: Links to the next set of results. + :vartype next_link: str + """ + + _validation = { + 'value': {'readonly': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[DataBoxEdgeSku]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(DataBoxEdgeSkuList, self).__init__(**kwargs) + self.value = None + self.next_link = None + + +class DCAccessCode(msrest.serialization.Model): + """DC Access code in the case of Self Managed Shipping. + + :param auth_code: DCAccess Code for the Self Managed shipment. + :type auth_code: str + """ + + _attribute_map = { + 'auth_code': {'key': 'properties.authCode', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(DCAccessCode, self).__init__(**kwargs) + self.auth_code = kwargs.get('auth_code', None) + + +class DeviceSecrets(msrest.serialization.Model): + """Device Secrets. + + :param hcs_data_volume_bit_locker_external_key: Keyvault Id of + HcsDataVolumeBitLockerExternalKey. + :type hcs_data_volume_bit_locker_external_key: + ~azure.mgmt.databoxedge.v2020_12_01.models.Secret + :param hcs_internal_volume_bit_locker_external_key: Keyvault Id of + HcsInternalVolumeBitLockerExternalKey. + :type hcs_internal_volume_bit_locker_external_key: + ~azure.mgmt.databoxedge.v2020_12_01.models.Secret + :param system_volume_bit_locker_recovery_key: Keyvault Id of SystemVolumeBitLockerRecoveryKey. + :type system_volume_bit_locker_recovery_key: ~azure.mgmt.databoxedge.v2020_12_01.models.Secret + :param sed_encryption_external_key_id: Keyvault Id of SEDEncryptionExternalKeyId. + :type sed_encryption_external_key_id: ~azure.mgmt.databoxedge.v2020_12_01.models.Secret + :param sed_encryption_external_key: Keyvault Id of SEDEncryptionExternalKey. + :type sed_encryption_external_key: ~azure.mgmt.databoxedge.v2020_12_01.models.Secret + :param bmc_default_user_password: Keyvault Id of BMCDefaultUserPassword. + :type bmc_default_user_password: ~azure.mgmt.databoxedge.v2020_12_01.models.Secret + :param rotate_key_for_data_volume_bitlocker: Keyvault Id of RotateKeyForDataVolumeBitlocker. + :type rotate_key_for_data_volume_bitlocker: ~azure.mgmt.databoxedge.v2020_12_01.models.Secret + :param rotate_keys_for_sed_drives_serialized: Keyvault Id of RotateKeysForSedDrivesSerialized. + :type rotate_keys_for_sed_drives_serialized: ~azure.mgmt.databoxedge.v2020_12_01.models.Secret + """ + + _attribute_map = { + 'hcs_data_volume_bit_locker_external_key': {'key': 'hcsDataVolumeBitLockerExternalKey', 'type': 'Secret'}, + 'hcs_internal_volume_bit_locker_external_key': {'key': 'hcsInternalVolumeBitLockerExternalKey', 'type': 'Secret'}, + 'system_volume_bit_locker_recovery_key': {'key': 'systemVolumeBitLockerRecoveryKey', 'type': 'Secret'}, + 'sed_encryption_external_key_id': {'key': 'sedEncryptionExternalKeyId', 'type': 'Secret'}, + 'sed_encryption_external_key': {'key': 'sedEncryptionExternalKey', 'type': 'Secret'}, + 'bmc_default_user_password': {'key': 'bmcDefaultUserPassword', 'type': 'Secret'}, + 'rotate_key_for_data_volume_bitlocker': {'key': 'rotateKeyForDataVolumeBitlocker', 'type': 'Secret'}, + 'rotate_keys_for_sed_drives_serialized': {'key': 'rotateKeysForSedDrivesSerialized', 'type': 'Secret'}, + } + + def __init__( + self, + **kwargs + ): + super(DeviceSecrets, self).__init__(**kwargs) + self.hcs_data_volume_bit_locker_external_key = kwargs.get('hcs_data_volume_bit_locker_external_key', None) + self.hcs_internal_volume_bit_locker_external_key = kwargs.get('hcs_internal_volume_bit_locker_external_key', None) + self.system_volume_bit_locker_recovery_key = kwargs.get('system_volume_bit_locker_recovery_key', None) + self.sed_encryption_external_key_id = kwargs.get('sed_encryption_external_key_id', None) + self.sed_encryption_external_key = kwargs.get('sed_encryption_external_key', None) + self.bmc_default_user_password = kwargs.get('bmc_default_user_password', None) + self.rotate_key_for_data_volume_bitlocker = kwargs.get('rotate_key_for_data_volume_bitlocker', None) + self.rotate_keys_for_sed_drives_serialized = kwargs.get('rotate_keys_for_sed_drives_serialized', None) + + +class EdgeProfile(msrest.serialization.Model): + """Details about Edge Profile for the resource. + + :param subscription: Edge Profile Subscription. + :type subscription: ~azure.mgmt.databoxedge.v2020_12_01.models.EdgeProfileSubscription + """ + + _attribute_map = { + 'subscription': {'key': 'subscription', 'type': 'EdgeProfileSubscription'}, + } + + def __init__( + self, + **kwargs + ): + super(EdgeProfile, self).__init__(**kwargs) + self.subscription = kwargs.get('subscription', None) + + +class EdgeProfilePatch(msrest.serialization.Model): + """The Data Box Edge/Gateway Edge Profile patch. + + :param subscription: The Data Box Edge/Gateway Edge Profile Subscription patch. + :type subscription: ~azure.mgmt.databoxedge.v2020_12_01.models.EdgeProfileSubscriptionPatch + """ + + _attribute_map = { + 'subscription': {'key': 'subscription', 'type': 'EdgeProfileSubscriptionPatch'}, + } + + def __init__( + self, + **kwargs + ): + super(EdgeProfilePatch, self).__init__(**kwargs) + self.subscription = kwargs.get('subscription', None) + + +class EdgeProfileSubscription(msrest.serialization.Model): + """Subscription details for the Edge Profile. + + :param registration_id: Edge Subscription Registration ID. + :type registration_id: str + :param id: ARM ID of the subscription. + :type id: str + :param state: Possible values include: "Registered", "Warned", "Suspended", "Deleted", + "Unregistered". + :type state: str or ~azure.mgmt.databoxedge.v2020_12_01.models.SubscriptionState + :param registration_date: + :type registration_date: str + :param subscription_id: + :type subscription_id: str + :param tenant_id: + :type tenant_id: str + :param location_placement_id: + :type location_placement_id: str + :param quota_id: + :type quota_id: str + :param serialized_details: + :type serialized_details: str + :param registered_features: + :type registered_features: + list[~azure.mgmt.databoxedge.v2020_12_01.models.SubscriptionRegisteredFeatures] + """ + + _attribute_map = { + 'registration_id': {'key': 'registrationId', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + 'state': {'key': 'state', 'type': 'str'}, + 'registration_date': {'key': 'registrationDate', 'type': 'str'}, + 'subscription_id': {'key': 'subscriptionId', 'type': 'str'}, + 'tenant_id': {'key': 'properties.tenantId', 'type': 'str'}, + 'location_placement_id': {'key': 'properties.locationPlacementId', 'type': 'str'}, + 'quota_id': {'key': 'properties.quotaId', 'type': 'str'}, + 'serialized_details': {'key': 'properties.serializedDetails', 'type': 'str'}, + 'registered_features': {'key': 'properties.registeredFeatures', 'type': '[SubscriptionRegisteredFeatures]'}, + } + + def __init__( + self, + **kwargs + ): + super(EdgeProfileSubscription, self).__init__(**kwargs) + self.registration_id = kwargs.get('registration_id', None) + self.id = kwargs.get('id', None) + self.state = kwargs.get('state', None) + self.registration_date = kwargs.get('registration_date', None) + self.subscription_id = kwargs.get('subscription_id', None) + self.tenant_id = kwargs.get('tenant_id', None) + self.location_placement_id = kwargs.get('location_placement_id', None) + self.quota_id = kwargs.get('quota_id', None) + self.serialized_details = kwargs.get('serialized_details', None) + self.registered_features = kwargs.get('registered_features', None) + + +class EdgeProfileSubscriptionPatch(msrest.serialization.Model): + """The Data Box Edge/Gateway Edge Profile Subscription patch. + + :param id: The path ID that uniquely identifies the subscription of the edge profile. + :type id: str + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(EdgeProfileSubscriptionPatch, self).__init__(**kwargs) + self.id = kwargs.get('id', None) + + +class EtcdInfo(msrest.serialization.Model): + """Etcd configuration. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar type: Etcd type. + :vartype type: str + :ivar version: Etcd version. + :vartype version: str + """ + + _validation = { + 'type': {'readonly': True}, + 'version': {'readonly': True}, + } + + _attribute_map = { + 'type': {'key': 'type', 'type': 'str'}, + 'version': {'key': 'version', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(EtcdInfo, self).__init__(**kwargs) + self.type = None + self.version = None + + +class Trigger(ARMBaseModel): + """Trigger details. + + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: FileEventTrigger, PeriodicTimerEventTrigger. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: The path ID that uniquely identifies the object. + :vartype id: str + :ivar name: The object name. + :vartype name: str + :ivar type: The hierarchical type of the object. + :vartype type: str + :ivar system_data: Trigger in DataBoxEdge Resource. + :vartype system_data: ~azure.mgmt.databoxedge.v2020_12_01.models.SystemData + :param kind: Required. Trigger Kind.Constant filled by server. Possible values include: + "FileEvent", "PeriodicTimerEvent". + :type kind: str or ~azure.mgmt.databoxedge.v2020_12_01.models.TriggerEventType + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'system_data': {'readonly': True}, + 'kind': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'kind': {'key': 'kind', 'type': 'str'}, + } + + _subtype_map = { + 'kind': {'FileEvent': 'FileEventTrigger', 'PeriodicTimerEvent': 'PeriodicTimerEventTrigger'} + } + + def __init__( + self, + **kwargs + ): + super(Trigger, self).__init__(**kwargs) + self.system_data = None + self.kind = 'Trigger' # type: str + + +class FileEventTrigger(Trigger): + """Trigger details. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: The path ID that uniquely identifies the object. + :vartype id: str + :ivar name: The object name. + :vartype name: str + :ivar type: The hierarchical type of the object. + :vartype type: str + :ivar system_data: Trigger in DataBoxEdge Resource. + :vartype system_data: ~azure.mgmt.databoxedge.v2020_12_01.models.SystemData + :param kind: Required. Trigger Kind.Constant filled by server. Possible values include: + "FileEvent", "PeriodicTimerEvent". + :type kind: str or ~azure.mgmt.databoxedge.v2020_12_01.models.TriggerEventType + :param source_info: Required. File event source details. + :type source_info: ~azure.mgmt.databoxedge.v2020_12_01.models.FileSourceInfo + :param sink_info: Required. Role sink info. + :type sink_info: ~azure.mgmt.databoxedge.v2020_12_01.models.RoleSinkInfo + :param custom_context_tag: A custom context tag typically used to correlate the trigger against + its usage. For example, if a periodic timer trigger is intended for certain specific IoT + modules in the device, the tag can be the name or the image URL of the module. + :type custom_context_tag: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'system_data': {'readonly': True}, + 'kind': {'required': True}, + 'source_info': {'required': True}, + 'sink_info': {'required': True}, + 'custom_context_tag': {'max_length': 192, 'min_length': 0}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'source_info': {'key': 'properties.sourceInfo', 'type': 'FileSourceInfo'}, + 'sink_info': {'key': 'properties.sinkInfo', 'type': 'RoleSinkInfo'}, + 'custom_context_tag': {'key': 'properties.customContextTag', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(FileEventTrigger, self).__init__(**kwargs) + self.kind = 'FileEvent' # type: str + self.source_info = kwargs['source_info'] + self.sink_info = kwargs['sink_info'] + self.custom_context_tag = kwargs.get('custom_context_tag', None) + + +class FileSourceInfo(msrest.serialization.Model): + """File source details. + + All required parameters must be populated in order to send to Azure. + + :param share_id: Required. File share ID. + :type share_id: str + """ + + _validation = { + 'share_id': {'required': True}, + } + + _attribute_map = { + 'share_id': {'key': 'shareId', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(FileSourceInfo, self).__init__(**kwargs) + self.share_id = kwargs['share_id'] + + +class GenerateCertResponse(msrest.serialization.Model): + """Used in activation key generation flow. + + :param public_key: Gets or sets base64 encoded certificate raw data, + this is the public part needed to be uploaded to cert vault. + :type public_key: str + :param private_key: Gets or sets base64 encoded private part of the certificate, + needed to form the activation key. + :type private_key: str + :param expiry_time_in_utc: Gets or sets expiry time in UTC. + :type expiry_time_in_utc: str + """ + + _attribute_map = { + 'public_key': {'key': 'publicKey', 'type': 'str'}, + 'private_key': {'key': 'privateKey', 'type': 'str'}, + 'expiry_time_in_utc': {'key': 'expiryTimeInUTC', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(GenerateCertResponse, self).__init__(**kwargs) + self.public_key = kwargs.get('public_key', None) + self.private_key = kwargs.get('private_key', None) + self.expiry_time_in_utc = kwargs.get('expiry_time_in_utc', None) + + +class ImageRepositoryCredential(msrest.serialization.Model): + """Image repository credential. + + All required parameters must be populated in order to send to Azure. + + :param image_repository_url: Required. Image repository url (e.g.: mcr.microsoft.com). + :type image_repository_url: str + :param user_name: Required. Repository user name. + :type user_name: str + :param password: Repository user password. + :type password: ~azure.mgmt.databoxedge.v2020_12_01.models.AsymmetricEncryptedSecret + """ + + _validation = { + 'image_repository_url': {'required': True}, + 'user_name': {'required': True}, + } + + _attribute_map = { + 'image_repository_url': {'key': 'imageRepositoryUrl', 'type': 'str'}, + 'user_name': {'key': 'userName', 'type': 'str'}, + 'password': {'key': 'password', 'type': 'AsymmetricEncryptedSecret'}, + } + + def __init__( + self, + **kwargs + ): + super(ImageRepositoryCredential, self).__init__(**kwargs) + self.image_repository_url = kwargs['image_repository_url'] + self.user_name = kwargs['user_name'] + self.password = kwargs.get('password', None) + + +class IoTAddon(Addon): + """IoT Addon. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: The path ID that uniquely identifies the object. + :vartype id: str + :ivar name: The object name. + :vartype name: str + :ivar type: The hierarchical type of the object. + :vartype type: str + :param kind: Required. Addon type.Constant filled by server. Possible values include: + "IotEdge", "ArcForKubernetes". + :type kind: str or ~azure.mgmt.databoxedge.v2020_12_01.models.AddonType + :ivar system_data: Addon type. + :vartype system_data: ~azure.mgmt.databoxedge.v2020_12_01.models.SystemData + :param io_t_device_details: Required. IoT device metadata to which appliance needs to be + connected. + :type io_t_device_details: ~azure.mgmt.databoxedge.v2020_12_01.models.IoTDeviceInfo + :param io_t_edge_device_details: Required. IoT edge device to which the IoT Addon needs to be + configured. + :type io_t_edge_device_details: ~azure.mgmt.databoxedge.v2020_12_01.models.IoTDeviceInfo + :ivar version: Version of IoT running on the appliance. + :vartype version: str + :ivar host_platform: Host OS supported by the IoT addon. Possible values include: "Windows", + "Linux". + :vartype host_platform: str or ~azure.mgmt.databoxedge.v2020_12_01.models.PlatformType + :ivar host_platform_type: Platform where the runtime is hosted. Possible values include: + "KubernetesCluster", "LinuxVM". + :vartype host_platform_type: str or ~azure.mgmt.databoxedge.v2020_12_01.models.HostPlatformType + :ivar provisioning_state: Addon Provisioning State. Possible values include: "Invalid", + "Creating", "Created", "Updating", "Reconfiguring", "Failed", "Deleting". + :vartype provisioning_state: str or ~azure.mgmt.databoxedge.v2020_12_01.models.AddonState + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'kind': {'required': True}, + 'system_data': {'readonly': True}, + 'io_t_device_details': {'required': True}, + 'io_t_edge_device_details': {'required': True}, + 'version': {'readonly': True}, + 'host_platform': {'readonly': True}, + 'host_platform_type': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'io_t_device_details': {'key': 'properties.ioTDeviceDetails', 'type': 'IoTDeviceInfo'}, + 'io_t_edge_device_details': {'key': 'properties.ioTEdgeDeviceDetails', 'type': 'IoTDeviceInfo'}, + 'version': {'key': 'properties.version', 'type': 'str'}, + 'host_platform': {'key': 'properties.hostPlatform', 'type': 'str'}, + 'host_platform_type': {'key': 'properties.hostPlatformType', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(IoTAddon, self).__init__(**kwargs) + self.kind = 'IotEdge' # type: str + self.io_t_device_details = kwargs['io_t_device_details'] + self.io_t_edge_device_details = kwargs['io_t_edge_device_details'] + self.version = None + self.host_platform = None + self.host_platform_type = None + self.provisioning_state = None + + +class IoTDeviceInfo(msrest.serialization.Model): + """Metadata of IoT device/IoT Edge device to be configured. + + All required parameters must be populated in order to send to Azure. + + :param device_id: Required. ID of the IoT device/edge device. + :type device_id: str + :param io_t_host_hub: Required. Host name for the IoT hub associated to the device. + :type io_t_host_hub: str + :param io_t_host_hub_id: Id for the IoT hub associated to the device. + :type io_t_host_hub_id: str + :param authentication: Encrypted IoT device/IoT edge device connection string. + :type authentication: ~azure.mgmt.databoxedge.v2020_12_01.models.Authentication + """ + + _validation = { + 'device_id': {'required': True}, + 'io_t_host_hub': {'required': True}, + } + + _attribute_map = { + 'device_id': {'key': 'deviceId', 'type': 'str'}, + 'io_t_host_hub': {'key': 'ioTHostHub', 'type': 'str'}, + 'io_t_host_hub_id': {'key': 'ioTHostHubId', 'type': 'str'}, + 'authentication': {'key': 'authentication', 'type': 'Authentication'}, + } + + def __init__( + self, + **kwargs + ): + super(IoTDeviceInfo, self).__init__(**kwargs) + self.device_id = kwargs['device_id'] + self.io_t_host_hub = kwargs['io_t_host_hub'] + self.io_t_host_hub_id = kwargs.get('io_t_host_hub_id', None) + self.authentication = kwargs.get('authentication', None) + + +class IoTEdgeAgentInfo(msrest.serialization.Model): + """IoT edge agent details is optional, this will be used for download system Agent module while bootstrapping IoT Role if specified. + + All required parameters must be populated in order to send to Azure. + + :param image_name: Required. Name of the IoT edge agent image. + :type image_name: str + :param tag: Required. Image Tag. + :type tag: str + :param image_repository: Image repository details. + :type image_repository: ~azure.mgmt.databoxedge.v2020_12_01.models.ImageRepositoryCredential + """ + + _validation = { + 'image_name': {'required': True}, + 'tag': {'required': True}, + } + + _attribute_map = { + 'image_name': {'key': 'imageName', 'type': 'str'}, + 'tag': {'key': 'tag', 'type': 'str'}, + 'image_repository': {'key': 'imageRepository', 'type': 'ImageRepositoryCredential'}, + } + + def __init__( + self, + **kwargs + ): + super(IoTEdgeAgentInfo, self).__init__(**kwargs) + self.image_name = kwargs['image_name'] + self.tag = kwargs['tag'] + self.image_repository = kwargs.get('image_repository', None) + + +class IoTRole(Role): + """Compute role. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: The path ID that uniquely identifies the object. + :vartype id: str + :ivar name: The object name. + :vartype name: str + :ivar type: The hierarchical type of the object. + :vartype type: str + :param kind: Required. Role type.Constant filled by server. Possible values include: "IOT", + "ASA", "Functions", "Cognitive", "MEC", "CloudEdgeManagement", "Kubernetes". + :type kind: str or ~azure.mgmt.databoxedge.v2020_12_01.models.RoleTypes + :ivar system_data: Role configured on ASE resource. + :vartype system_data: ~azure.mgmt.databoxedge.v2020_12_01.models.SystemData + :param host_platform: Host OS supported by the IoT role. Possible values include: "Windows", + "Linux". + :type host_platform: str or ~azure.mgmt.databoxedge.v2020_12_01.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: ~azure.mgmt.databoxedge.v2020_12_01.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: ~azure.mgmt.databoxedge.v2020_12_01.models.IoTDeviceInfo + :param share_mappings: Mount points of shares in role(s). + :type share_mappings: list[~azure.mgmt.databoxedge.v2020_12_01.models.MountPointMap] + :param io_t_edge_agent_info: Iot edge agent details to download the agent and bootstrap iot + runtime. + :type io_t_edge_agent_info: ~azure.mgmt.databoxedge.v2020_12_01.models.IoTEdgeAgentInfo + :ivar host_platform_type: Platform where the Iot runtime is hosted. Possible values include: + "KubernetesCluster", "LinuxVM". + :vartype host_platform_type: str or ~azure.mgmt.databoxedge.v2020_12_01.models.HostPlatformType + :param compute_resource: Resource allocation. + :type compute_resource: ~azure.mgmt.databoxedge.v2020_12_01.models.ComputeResource + :param role_status: Role status. Possible values include: "Enabled", "Disabled". + :type role_status: str or ~azure.mgmt.databoxedge.v2020_12_01.models.RoleStatus + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'kind': {'required': True}, + 'system_data': {'readonly': True}, + 'host_platform_type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'host_platform': {'key': 'properties.hostPlatform', 'type': 'str'}, + 'io_t_device_details': {'key': 'properties.ioTDeviceDetails', 'type': 'IoTDeviceInfo'}, + 'io_t_edge_device_details': {'key': 'properties.ioTEdgeDeviceDetails', 'type': 'IoTDeviceInfo'}, + 'share_mappings': {'key': 'properties.shareMappings', 'type': '[MountPointMap]'}, + 'io_t_edge_agent_info': {'key': 'properties.ioTEdgeAgentInfo', 'type': 'IoTEdgeAgentInfo'}, + 'host_platform_type': {'key': 'properties.hostPlatformType', 'type': 'str'}, + 'compute_resource': {'key': 'properties.computeResource', 'type': 'ComputeResource'}, + 'role_status': {'key': 'properties.roleStatus', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(IoTRole, self).__init__(**kwargs) + self.kind = 'IOT' # type: str + self.host_platform = kwargs.get('host_platform', None) + self.io_t_device_details = kwargs.get('io_t_device_details', None) + self.io_t_edge_device_details = kwargs.get('io_t_edge_device_details', None) + self.share_mappings = kwargs.get('share_mappings', None) + self.io_t_edge_agent_info = kwargs.get('io_t_edge_agent_info', None) + self.host_platform_type = None + self.compute_resource = kwargs.get('compute_resource', None) + self.role_status = kwargs.get('role_status', None) + + +class Ipv4Config(msrest.serialization.Model): + """Details related to the IPv4 address configuration. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar ip_address: The IPv4 address of the network adapter. + :vartype ip_address: str + :ivar subnet: The IPv4 subnet of the network adapter. + :vartype subnet: str + :ivar gateway: The IPv4 gateway of the network adapter. + :vartype gateway: str + """ + + _validation = { + 'ip_address': {'readonly': True}, + 'subnet': {'readonly': True}, + 'gateway': {'readonly': True}, + } + + _attribute_map = { + 'ip_address': {'key': 'ipAddress', 'type': 'str'}, + 'subnet': {'key': 'subnet', 'type': 'str'}, + 'gateway': {'key': 'gateway', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(Ipv4Config, self).__init__(**kwargs) + self.ip_address = None + self.subnet = None + self.gateway = None + + +class Ipv6Config(msrest.serialization.Model): + """Details related to the IPv6 address configuration. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar ip_address: The IPv6 address of the network adapter. + :vartype ip_address: str + :ivar prefix_length: The IPv6 prefix of the network adapter. + :vartype prefix_length: int + :ivar gateway: The IPv6 gateway of the network adapter. + :vartype gateway: str + """ + + _validation = { + 'ip_address': {'readonly': True}, + 'prefix_length': {'readonly': True}, + 'gateway': {'readonly': True}, + } + + _attribute_map = { + 'ip_address': {'key': 'ipAddress', 'type': 'str'}, + 'prefix_length': {'key': 'prefixLength', 'type': 'int'}, + 'gateway': {'key': 'gateway', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(Ipv6Config, self).__init__(**kwargs) + self.ip_address = None + self.prefix_length = None + self.gateway = None + + +class Job(msrest.serialization.Model): + """A device job. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: The path ID that uniquely identifies the object. + :vartype id: str + :ivar name: The name of the object. + :vartype name: str + :ivar type: The hierarchical type of the object. + :vartype type: str + :ivar status: The current status of the job. Possible values include: "Invalid", "Running", + "Succeeded", "Failed", "Canceled", "Paused", "Scheduled". + :vartype status: str or ~azure.mgmt.databoxedge.v2020_12_01.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: ~azure.mgmt.databoxedge.v2020_12_01.models.JobErrorDetails + :ivar job_type: The type of the job. Possible values include: "Invalid", "ScanForUpdates", + "DownloadUpdates", "InstallUpdates", "RefreshShare", "RefreshContainer", "Backup", "Restore", + "TriggerSupportPackage". + :vartype job_type: str or ~azure.mgmt.databoxedge.v2020_12_01.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 ~azure.mgmt.databoxedge.v2020_12_01.models.UpdateOperationStage + :ivar download_progress: The download progress. + :vartype download_progress: ~azure.mgmt.databoxedge.v2020_12_01.models.UpdateDownloadProgress + :ivar install_progress: The install progress. + :vartype install_progress: ~azure.mgmt.databoxedge.v2020_12_01.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[~azure.mgmt.databoxedge.v2020_12_01.models.JobErrorItem] + :ivar code: The code intended for programmatic access. + :vartype code: str + :ivar message: The message that describes the error in detail. + :vartype message: str + """ + + _validation = { + 'error_details': {'readonly': True}, + 'code': {'readonly': True}, + 'message': {'readonly': True}, + } + + _attribute_map = { + 'error_details': {'key': 'errorDetails', 'type': '[JobErrorItem]'}, + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(JobErrorDetails, self).__init__(**kwargs) + self.error_details = None + self.code = None + self.message = None + + +class JobErrorItem(msrest.serialization.Model): + """The job error items. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar recommendations: The recommended actions. + :vartype recommendations: list[str] + :ivar code: The code intended for programmatic access. + :vartype code: str + :ivar message: The message that describes the error in detail. + :vartype message: str + """ + + _validation = { + 'recommendations': {'readonly': True}, + 'code': {'readonly': True}, + 'message': {'readonly': True}, + } + + _attribute_map = { + 'recommendations': {'key': 'recommendations', 'type': '[str]'}, + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(JobErrorItem, self).__init__(**kwargs) + self.recommendations = None + self.code = None + self.message = None + + +class KubernetesClusterInfo(msrest.serialization.Model): + """Kubernetes cluster configuration. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar etcd_info: Etcd configuration. + :vartype etcd_info: ~azure.mgmt.databoxedge.v2020_12_01.models.EtcdInfo + :ivar nodes: Kubernetes cluster nodes. + :vartype nodes: list[~azure.mgmt.databoxedge.v2020_12_01.models.NodeInfo] + :param version: Required. Kubernetes cluster version. + :type version: str + """ + + _validation = { + 'etcd_info': {'readonly': True}, + 'nodes': {'readonly': True}, + 'version': {'required': True}, + } + + _attribute_map = { + 'etcd_info': {'key': 'etcdInfo', 'type': 'EtcdInfo'}, + 'nodes': {'key': 'nodes', 'type': '[NodeInfo]'}, + 'version': {'key': 'version', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(KubernetesClusterInfo, self).__init__(**kwargs) + self.etcd_info = None + self.nodes = None + self.version = kwargs['version'] + + +class KubernetesIPConfiguration(msrest.serialization.Model): + """Kubernetes node IP configuration. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar port: Port of the Kubernetes node. + :vartype port: str + :param ip_address: IP address of the Kubernetes node. + :type ip_address: str + """ + + _validation = { + 'port': {'readonly': True}, + } + + _attribute_map = { + 'port': {'key': 'port', 'type': 'str'}, + 'ip_address': {'key': 'ipAddress', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(KubernetesIPConfiguration, self).__init__(**kwargs) + self.port = None + self.ip_address = kwargs.get('ip_address', None) + + +class KubernetesRole(Role): + """Kubernetes role. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: The path ID that uniquely identifies the object. + :vartype id: str + :ivar name: The object name. + :vartype name: str + :ivar type: The hierarchical type of the object. + :vartype type: str + :param kind: Required. Role type.Constant filled by server. Possible values include: "IOT", + "ASA", "Functions", "Cognitive", "MEC", "CloudEdgeManagement", "Kubernetes". + :type kind: str or ~azure.mgmt.databoxedge.v2020_12_01.models.RoleTypes + :ivar system_data: Role configured on ASE resource. + :vartype system_data: ~azure.mgmt.databoxedge.v2020_12_01.models.SystemData + :param host_platform: Host OS supported by the Kubernetes role. Possible values include: + "Windows", "Linux". + :type host_platform: str or ~azure.mgmt.databoxedge.v2020_12_01.models.PlatformType + :ivar provisioning_state: State of Kubernetes deployment. Possible values include: "Invalid", + "Creating", "Created", "Updating", "Reconfiguring", "Failed", "Deleting". + :vartype provisioning_state: str or ~azure.mgmt.databoxedge.v2020_12_01.models.KubernetesState + :ivar host_platform_type: Platform where the runtime is hosted. Possible values include: + "KubernetesCluster", "LinuxVM". + :vartype host_platform_type: str or ~azure.mgmt.databoxedge.v2020_12_01.models.HostPlatformType + :param kubernetes_cluster_info: Kubernetes cluster configuration. + :type kubernetes_cluster_info: ~azure.mgmt.databoxedge.v2020_12_01.models.KubernetesClusterInfo + :param kubernetes_role_resources: Kubernetes role resources. + :type kubernetes_role_resources: + ~azure.mgmt.databoxedge.v2020_12_01.models.KubernetesRoleResources + :param role_status: Role status. Possible values include: "Enabled", "Disabled". + :type role_status: str or ~azure.mgmt.databoxedge.v2020_12_01.models.RoleStatus + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'kind': {'required': True}, + 'system_data': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + 'host_platform_type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'host_platform': {'key': 'properties.hostPlatform', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'host_platform_type': {'key': 'properties.hostPlatformType', 'type': 'str'}, + 'kubernetes_cluster_info': {'key': 'properties.kubernetesClusterInfo', 'type': 'KubernetesClusterInfo'}, + 'kubernetes_role_resources': {'key': 'properties.kubernetesRoleResources', 'type': 'KubernetesRoleResources'}, + 'role_status': {'key': 'properties.roleStatus', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(KubernetesRole, self).__init__(**kwargs) + self.kind = 'Kubernetes' # type: str + self.host_platform = kwargs.get('host_platform', None) + self.provisioning_state = None + self.host_platform_type = None + self.kubernetes_cluster_info = kwargs.get('kubernetes_cluster_info', None) + self.kubernetes_role_resources = kwargs.get('kubernetes_role_resources', None) + self.role_status = kwargs.get('role_status', None) + + +class KubernetesRoleCompute(msrest.serialization.Model): + """Kubernetes role compute resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :param vm_profile: Required. VM profile. + :type vm_profile: str + :ivar memory_in_bytes: Memory in bytes. + :vartype memory_in_bytes: long + :ivar processor_count: Processor count. + :vartype processor_count: int + """ + + _validation = { + 'vm_profile': {'required': True}, + 'memory_in_bytes': {'readonly': True}, + 'processor_count': {'readonly': True}, + } + + _attribute_map = { + 'vm_profile': {'key': 'vmProfile', 'type': 'str'}, + 'memory_in_bytes': {'key': 'memoryInBytes', 'type': 'long'}, + 'processor_count': {'key': 'processorCount', 'type': 'int'}, + } + + def __init__( + self, + **kwargs + ): + super(KubernetesRoleCompute, self).__init__(**kwargs) + self.vm_profile = kwargs['vm_profile'] + self.memory_in_bytes = None + self.processor_count = None + + +class KubernetesRoleNetwork(msrest.serialization.Model): + """Kubernetes role network resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar cni_config: Cni configuration. + :vartype cni_config: ~azure.mgmt.databoxedge.v2020_12_01.models.CniConfig + :ivar load_balancer_config: Load balancer configuration. + :vartype load_balancer_config: ~azure.mgmt.databoxedge.v2020_12_01.models.LoadBalancerConfig + """ + + _validation = { + 'cni_config': {'readonly': True}, + 'load_balancer_config': {'readonly': True}, + } + + _attribute_map = { + 'cni_config': {'key': 'cniConfig', 'type': 'CniConfig'}, + 'load_balancer_config': {'key': 'loadBalancerConfig', 'type': 'LoadBalancerConfig'}, + } + + def __init__( + self, + **kwargs + ): + super(KubernetesRoleNetwork, self).__init__(**kwargs) + self.cni_config = None + self.load_balancer_config = None + + +class KubernetesRoleResources(msrest.serialization.Model): + """Kubernetes role resources. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :param storage: Kubernetes role storage resource. + :type storage: ~azure.mgmt.databoxedge.v2020_12_01.models.KubernetesRoleStorage + :param compute: Required. Kubernetes role compute resource. + :type compute: ~azure.mgmt.databoxedge.v2020_12_01.models.KubernetesRoleCompute + :ivar network: Kubernetes role network resource. + :vartype network: ~azure.mgmt.databoxedge.v2020_12_01.models.KubernetesRoleNetwork + """ + + _validation = { + 'compute': {'required': True}, + 'network': {'readonly': True}, + } + + _attribute_map = { + 'storage': {'key': 'storage', 'type': 'KubernetesRoleStorage'}, + 'compute': {'key': 'compute', 'type': 'KubernetesRoleCompute'}, + 'network': {'key': 'network', 'type': 'KubernetesRoleNetwork'}, + } + + def __init__( + self, + **kwargs + ): + super(KubernetesRoleResources, self).__init__(**kwargs) + self.storage = kwargs.get('storage', None) + self.compute = kwargs['compute'] + self.network = None + + +class KubernetesRoleStorage(msrest.serialization.Model): + """Kubernetes role storage resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar storage_classes: Kubernetes storage class info. + :vartype storage_classes: + list[~azure.mgmt.databoxedge.v2020_12_01.models.KubernetesRoleStorageClassInfo] + :param endpoints: Mount points of shares in role(s). + :type endpoints: list[~azure.mgmt.databoxedge.v2020_12_01.models.MountPointMap] + """ + + _validation = { + 'storage_classes': {'readonly': True}, + } + + _attribute_map = { + 'storage_classes': {'key': 'storageClasses', 'type': '[KubernetesRoleStorageClassInfo]'}, + 'endpoints': {'key': 'endpoints', 'type': '[MountPointMap]'}, + } + + def __init__( + self, + **kwargs + ): + super(KubernetesRoleStorage, self).__init__(**kwargs) + self.storage_classes = None + self.endpoints = kwargs.get('endpoints', None) + + +class KubernetesRoleStorageClassInfo(msrest.serialization.Model): + """Kubernetes storage class info. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar name: Storage class name. + :vartype name: str + :ivar type: Storage class type. + :vartype type: str + :ivar posix_compliant: If provisioned storage is posix compliant. Possible values include: + "Invalid", "Enabled", "Disabled". + :vartype posix_compliant: str or + ~azure.mgmt.databoxedge.v2020_12_01.models.PosixComplianceStatus + """ + + _validation = { + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'posix_compliant': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'posix_compliant': {'key': 'posixCompliant', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(KubernetesRoleStorageClassInfo, self).__init__(**kwargs) + self.name = None + self.type = None + self.posix_compliant = None + + +class LoadBalancerConfig(msrest.serialization.Model): + """Load balancer configuration. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar type: Load balancer type. + :vartype type: str + :ivar version: Load balancer version. + :vartype version: str + """ + + _validation = { + 'type': {'readonly': True}, + 'version': {'readonly': True}, + } + + _attribute_map = { + 'type': {'key': 'type', 'type': 'str'}, + 'version': {'key': 'version', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(LoadBalancerConfig, self).__init__(**kwargs) + self.type = None + self.version = None + + +class MECRole(Role): + """MEC role. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: The path ID that uniquely identifies the object. + :vartype id: str + :ivar name: The object name. + :vartype name: str + :ivar type: The hierarchical type of the object. + :vartype type: str + :param kind: Required. Role type.Constant filled by server. Possible values include: "IOT", + "ASA", "Functions", "Cognitive", "MEC", "CloudEdgeManagement", "Kubernetes". + :type kind: str or ~azure.mgmt.databoxedge.v2020_12_01.models.RoleTypes + :ivar system_data: Role configured on ASE resource. + :vartype system_data: ~azure.mgmt.databoxedge.v2020_12_01.models.SystemData + :param connection_string: Activation key of the MEC. + :type connection_string: ~azure.mgmt.databoxedge.v2020_12_01.models.AsymmetricEncryptedSecret + :param role_status: Role status. Possible values include: "Enabled", "Disabled". + :type role_status: str or ~azure.mgmt.databoxedge.v2020_12_01.models.RoleStatus + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'kind': {'required': True}, + 'system_data': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'connection_string': {'key': 'properties.connectionString', 'type': 'AsymmetricEncryptedSecret'}, + 'role_status': {'key': 'properties.roleStatus', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(MECRole, self).__init__(**kwargs) + self.kind = 'MEC' # type: str + self.connection_string = kwargs.get('connection_string', None) + self.role_status = kwargs.get('role_status', None) + + +class MetricConfiguration(msrest.serialization.Model): + """Metric configuration. + + All required parameters must be populated in order to send to Azure. + + :param resource_id: Required. The Resource ID on which the metrics should be pushed. + :type resource_id: str + :param mdm_account: The MDM account to which the counters should be pushed. + :type mdm_account: str + :param metric_name_space: The MDM namespace to which the counters should be pushed. This is + required if MDMAccount is specified. + :type metric_name_space: str + :param counter_sets: Required. Host name for the IoT hub associated to the device. + :type counter_sets: list[~azure.mgmt.databoxedge.v2020_12_01.models.MetricCounterSet] + """ + + _validation = { + 'resource_id': {'required': True}, + 'counter_sets': {'required': True}, + } + + _attribute_map = { + 'resource_id': {'key': 'resourceId', 'type': 'str'}, + 'mdm_account': {'key': 'mdmAccount', 'type': 'str'}, + 'metric_name_space': {'key': 'metricNameSpace', 'type': 'str'}, + 'counter_sets': {'key': 'counterSets', 'type': '[MetricCounterSet]'}, + } + + def __init__( + self, + **kwargs + ): + super(MetricConfiguration, self).__init__(**kwargs) + self.resource_id = kwargs['resource_id'] + self.mdm_account = kwargs.get('mdm_account', None) + self.metric_name_space = kwargs.get('metric_name_space', None) + self.counter_sets = kwargs['counter_sets'] + + +class MetricCounter(msrest.serialization.Model): + """The metric counter. + + All required parameters must be populated in order to send to Azure. + + :param name: Required. The counter name. + :type name: str + :param instance: The instance from which counter should be collected. + :type instance: str + :param dimension_filter: The dimension filter. + :type dimension_filter: list[~azure.mgmt.databoxedge.v2020_12_01.models.MetricDimension] + :param additional_dimensions: The additional dimensions to be added to metric. + :type additional_dimensions: list[~azure.mgmt.databoxedge.v2020_12_01.models.MetricDimension] + """ + + _validation = { + 'name': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'instance': {'key': 'instance', 'type': 'str'}, + 'dimension_filter': {'key': 'dimensionFilter', 'type': '[MetricDimension]'}, + 'additional_dimensions': {'key': 'additionalDimensions', 'type': '[MetricDimension]'}, + } + + def __init__( + self, + **kwargs + ): + super(MetricCounter, self).__init__(**kwargs) + self.name = kwargs['name'] + self.instance = kwargs.get('instance', None) + self.dimension_filter = kwargs.get('dimension_filter', None) + self.additional_dimensions = kwargs.get('additional_dimensions', None) + + +class MetricCounterSet(msrest.serialization.Model): + """The metric counter set. + + All required parameters must be populated in order to send to Azure. + + :param counters: Required. The counters that should be collected in this set. + :type counters: list[~azure.mgmt.databoxedge.v2020_12_01.models.MetricCounter] + """ + + _validation = { + 'counters': {'required': True}, + } + + _attribute_map = { + 'counters': {'key': 'counters', 'type': '[MetricCounter]'}, + } + + def __init__( + self, + **kwargs + ): + super(MetricCounterSet, self).__init__(**kwargs) + self.counters = kwargs['counters'] + + +class MetricDimension(msrest.serialization.Model): + """The metric dimension. + + All required parameters must be populated in order to send to Azure. + + :param source_type: Required. The dimension type. + :type source_type: str + :param source_name: Required. The dimension value. + :type source_name: str + """ + + _validation = { + 'source_type': {'required': True}, + 'source_name': {'required': True}, + } + + _attribute_map = { + 'source_type': {'key': 'sourceType', 'type': 'str'}, + 'source_name': {'key': 'sourceName', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(MetricDimension, self).__init__(**kwargs) + self.source_type = kwargs['source_type'] + self.source_name = kwargs['source_name'] + + +class MetricDimensionV1(msrest.serialization.Model): + """Metric Dimension v1. + + :param name: Name of the metrics dimension. + :type name: str + :param display_name: Display name of the metrics dimension. + :type display_name: str + :param to_be_exported_for_shoebox: To be exported to shoe box. + :type to_be_exported_for_shoebox: bool + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'display_name': {'key': 'displayName', 'type': 'str'}, + 'to_be_exported_for_shoebox': {'key': 'toBeExportedForShoebox', 'type': 'bool'}, + } + + def __init__( + self, + **kwargs + ): + super(MetricDimensionV1, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.display_name = kwargs.get('display_name', None) + self.to_be_exported_for_shoebox = kwargs.get('to_be_exported_for_shoebox', None) + + +class MetricSpecificationV1(msrest.serialization.Model): + """Metric specification version 1. + + :param name: Name of the metric. + :type name: str + :param display_name: Display name of the metric. + :type display_name: str + :param display_description: Description of the metric to be displayed. + :type display_description: str + :param unit: Metric units. Possible values include: "NotSpecified", "Percent", "Count", + "Seconds", "Milliseconds", "Bytes", "BytesPerSecond", "CountPerSecond". + :type unit: str or ~azure.mgmt.databoxedge.v2020_12_01.models.MetricUnit + :param aggregation_type: Metric aggregation type. Possible values include: "NotSpecified", + "None", "Average", "Minimum", "Maximum", "Total", "Count". + :type aggregation_type: str or ~azure.mgmt.databoxedge.v2020_12_01.models.MetricAggregationType + :param dimensions: Metric dimensions, other than default dimension which is resource. + :type dimensions: list[~azure.mgmt.databoxedge.v2020_12_01.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 ~azure.mgmt.databoxedge.v2020_12_01.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 + ~azure.mgmt.databoxedge.v2020_12_01.models.TimeGrain] + :param supported_aggregation_types: Support metric aggregation type. + :type supported_aggregation_types: list[str or + ~azure.mgmt.databoxedge.v2020_12_01.models.MetricAggregationType] + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'display_name': {'key': 'displayName', 'type': 'str'}, + 'display_description': {'key': 'displayDescription', 'type': 'str'}, + 'unit': {'key': 'unit', 'type': 'str'}, + 'aggregation_type': {'key': 'aggregationType', 'type': 'str'}, + 'dimensions': {'key': 'dimensions', 'type': '[MetricDimensionV1]'}, + 'fill_gap_with_zero': {'key': 'fillGapWithZero', 'type': 'bool'}, + 'category': {'key': 'category', 'type': 'str'}, + 'resource_id_dimension_name_override': {'key': 'resourceIdDimensionNameOverride', 'type': 'str'}, + 'supported_time_grain_types': {'key': 'supportedTimeGrainTypes', 'type': '[str]'}, + 'supported_aggregation_types': {'key': 'supportedAggregationTypes', 'type': '[str]'}, + } + + def __init__( + self, + **kwargs + ): + super(MetricSpecificationV1, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.display_name = kwargs.get('display_name', None) + self.display_description = kwargs.get('display_description', None) + self.unit = kwargs.get('unit', None) + self.aggregation_type = kwargs.get('aggregation_type', None) + self.dimensions = kwargs.get('dimensions', None) + self.fill_gap_with_zero = kwargs.get('fill_gap_with_zero', None) + self.category = kwargs.get('category', None) + self.resource_id_dimension_name_override = kwargs.get('resource_id_dimension_name_override', None) + self.supported_time_grain_types = kwargs.get('supported_time_grain_types', None) + self.supported_aggregation_types = kwargs.get('supported_aggregation_types', None) + + +class MonitoringMetricConfiguration(ARMBaseModel): + """The metric setting details for the role. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: The path ID that uniquely identifies the object. + :vartype id: str + :ivar name: The object name. + :vartype name: str + :ivar type: The hierarchical type of the object. + :vartype type: str + :param metric_configurations: Required. The metrics configuration details. + :type metric_configurations: + list[~azure.mgmt.databoxedge.v2020_12_01.models.MetricConfiguration] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'metric_configurations': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'metric_configurations': {'key': 'properties.metricConfigurations', 'type': '[MetricConfiguration]'}, + } + + def __init__( + self, + **kwargs + ): + super(MonitoringMetricConfiguration, self).__init__(**kwargs) + self.metric_configurations = kwargs['metric_configurations'] + + +class MonitoringMetricConfigurationList(msrest.serialization.Model): + """Collection of metric configurations. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar value: The list of metric configurations. + :vartype value: list[~azure.mgmt.databoxedge.v2020_12_01.models.MonitoringMetricConfiguration] + :ivar next_link: Link to the next set of results. + :vartype next_link: str + """ + + _validation = { + 'value': {'readonly': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[MonitoringMetricConfiguration]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(MonitoringMetricConfigurationList, self).__init__(**kwargs) + self.value = None + self.next_link = None + + +class MountPointMap(msrest.serialization.Model): + """The share mount point. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :param share_id: Required. ID of the share mounted to the role VM. + :type share_id: str + :ivar role_id: ID of the role to which share is mounted. + :vartype role_id: str + :ivar mount_point: Mount point for the share. + :vartype mount_point: str + :ivar mount_type: Mounting type. Possible values include: "Volume", "HostPath". + :vartype mount_type: str or ~azure.mgmt.databoxedge.v2020_12_01.models.MountType + :ivar role_type: Role type. Possible values include: "IOT", "ASA", "Functions", "Cognitive", + "MEC", "CloudEdgeManagement", "Kubernetes". + :vartype role_type: str or ~azure.mgmt.databoxedge.v2020_12_01.models.RoleTypes + """ + + _validation = { + 'share_id': {'required': True}, + 'role_id': {'readonly': True}, + 'mount_point': {'readonly': True}, + 'mount_type': {'readonly': True}, + 'role_type': {'readonly': True}, + } + + _attribute_map = { + 'share_id': {'key': 'shareId', 'type': 'str'}, + 'role_id': {'key': 'roleId', 'type': 'str'}, + 'mount_point': {'key': 'mountPoint', 'type': 'str'}, + 'mount_type': {'key': 'mountType', 'type': 'str'}, + 'role_type': {'key': 'roleType', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(MountPointMap, self).__init__(**kwargs) + self.share_id = kwargs['share_id'] + self.role_id = None + self.mount_point = None + self.mount_type = None + self.role_type = None + + +class NetworkAdapter(msrest.serialization.Model): + """Represents the networkAdapter on a device. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar adapter_id: Instance ID of network adapter. + :vartype adapter_id: str + :ivar adapter_position: Hardware position of network adapter. + :vartype adapter_position: ~azure.mgmt.databoxedge.v2020_12_01.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 ~azure.mgmt.databoxedge.v2020_12_01.models.NetworkAdapterStatus + :param rdma_status: Value indicating whether this adapter is RDMA capable. Possible values + include: "Incapable", "Capable". + :type rdma_status: str or ~azure.mgmt.databoxedge.v2020_12_01.models.NetworkAdapterRDMAStatus + :param dhcp_status: Value indicating whether this adapter has DHCP enabled. Possible values + include: "Disabled", "Enabled". + :type dhcp_status: str or ~azure.mgmt.databoxedge.v2020_12_01.models.NetworkAdapterDHCPStatus + :ivar ipv4_configuration: The IPv4 configuration of the network adapter. + :vartype ipv4_configuration: ~azure.mgmt.databoxedge.v2020_12_01.models.Ipv4Config + :ivar ipv6_configuration: The IPv6 configuration of the network adapter. + :vartype ipv6_configuration: ~azure.mgmt.databoxedge.v2020_12_01.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 ~azure.mgmt.databoxedge.v2020_12_01.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[~azure.mgmt.databoxedge.v2020_12_01.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 ~azure.mgmt.databoxedge.v2020_12_01.models.NodeStatus + :ivar node_chassis_serial_number: Serial number of the Chassis. + :vartype node_chassis_serial_number: str + :ivar node_serial_number: Serial number of the individual node. + :vartype node_serial_number: str + :ivar node_display_name: Display Name of the individual node. + :vartype node_display_name: str + :ivar node_friendly_software_version: Friendly software version name that is currently + installed on the node. + :vartype node_friendly_software_version: str + :ivar node_hcs_version: HCS version that is currently installed on the node. + :vartype node_hcs_version: str + :ivar node_instance_id: Guid instance id of the node. + :vartype node_instance_id: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'node_status': {'readonly': True}, + 'node_chassis_serial_number': {'readonly': True}, + 'node_serial_number': {'readonly': True}, + 'node_display_name': {'readonly': True}, + 'node_friendly_software_version': {'readonly': True}, + 'node_hcs_version': {'readonly': True}, + 'node_instance_id': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'node_status': {'key': 'properties.nodeStatus', 'type': 'str'}, + 'node_chassis_serial_number': {'key': 'properties.nodeChassisSerialNumber', 'type': 'str'}, + 'node_serial_number': {'key': 'properties.nodeSerialNumber', 'type': 'str'}, + 'node_display_name': {'key': 'properties.nodeDisplayName', 'type': 'str'}, + 'node_friendly_software_version': {'key': 'properties.nodeFriendlySoftwareVersion', 'type': 'str'}, + 'node_hcs_version': {'key': 'properties.nodeHcsVersion', 'type': 'str'}, + 'node_instance_id': {'key': 'properties.nodeInstanceId', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(Node, self).__init__(**kwargs) + self.node_status = None + self.node_chassis_serial_number = None + self.node_serial_number = None + self.node_display_name = None + self.node_friendly_software_version = None + self.node_hcs_version = None + self.node_instance_id = None + + +class NodeInfo(msrest.serialization.Model): + """Kubernetes node info. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar name: Node name. + :vartype name: str + :ivar type: Node type - Master/Worker. Possible values include: "Invalid", "Master", "Worker". + :vartype type: str or ~azure.mgmt.databoxedge.v2020_12_01.models.KubernetesNodeType + :param ip_configuration: IP Configuration of the Kubernetes node. + :type ip_configuration: + list[~azure.mgmt.databoxedge.v2020_12_01.models.KubernetesIPConfiguration] + """ + + _validation = { + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'ip_configuration': {'key': 'ipConfiguration', 'type': '[KubernetesIPConfiguration]'}, + } + + def __init__( + self, + **kwargs + ): + super(NodeInfo, self).__init__(**kwargs) + self.name = None + self.type = None + self.ip_configuration = kwargs.get('ip_configuration', None) + + +class NodeList(msrest.serialization.Model): + """Collection of Nodes. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar value: The list of Nodes. + :vartype value: list[~azure.mgmt.databoxedge.v2020_12_01.models.Node] + :param next_link: Link to the next set of results. + :type next_link: str + """ + + _validation = { + 'value': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[Node]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(NodeList, self).__init__(**kwargs) + self.value = None + self.next_link = kwargs.get('next_link', None) + + +class Operation(msrest.serialization.Model): + """Operations. + + :param name: Name of the operation. + :type name: str + :param is_data_action: Is data action. + :type is_data_action: bool + :param display: Properties displayed for the operation. + :type display: ~azure.mgmt.databoxedge.v2020_12_01.models.OperationDisplay + :param origin: Origin of the operation. + :type origin: str + :param service_specification: Service specification. + :type service_specification: ~azure.mgmt.databoxedge.v2020_12_01.models.ServiceSpecification + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'is_data_action': {'key': 'isDataAction', 'type': 'bool'}, + 'display': {'key': 'display', 'type': 'OperationDisplay'}, + 'origin': {'key': 'origin', 'type': 'str'}, + 'service_specification': {'key': 'properties.serviceSpecification', 'type': 'ServiceSpecification'}, + } + + def __init__( + self, + **kwargs + ): + super(Operation, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.is_data_action = kwargs.get('is_data_action', None) + self.display = kwargs.get('display', None) + self.origin = kwargs.get('origin', None) + self.service_specification = kwargs.get('service_specification', None) + + +class OperationDisplay(msrest.serialization.Model): + """Operation display properties. + + :param provider: Provider name. + :type provider: str + :param resource: The type of resource in which the operation is performed. + :type resource: str + :param operation: Operation to be performed on the resource. + :type operation: str + :param description: Description of the operation to be performed. + :type description: str + """ + + _attribute_map = { + 'provider': {'key': 'provider', 'type': 'str'}, + 'resource': {'key': 'resource', 'type': 'str'}, + 'operation': {'key': 'operation', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(OperationDisplay, self).__init__(**kwargs) + self.provider = kwargs.get('provider', None) + self.resource = kwargs.get('resource', None) + self.operation = kwargs.get('operation', None) + self.description = kwargs.get('description', None) + + +class OperationsList(msrest.serialization.Model): + """The list of operations used for the discovery of available provider operations. + + All required parameters must be populated in order to send to Azure. + + :param value: Required. The value. + :type value: list[~azure.mgmt.databoxedge.v2020_12_01.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: ~azure.mgmt.databoxedge.v2020_12_01.models.ContactDetails + :param shipping_address: The shipping address. + :type shipping_address: ~azure.mgmt.databoxedge.v2020_12_01.models.Address + :ivar current_status: Current status of the order. + :vartype current_status: ~azure.mgmt.databoxedge.v2020_12_01.models.OrderStatus + :ivar order_history: List of status changes in the order. + :vartype order_history: list[~azure.mgmt.databoxedge.v2020_12_01.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[~azure.mgmt.databoxedge.v2020_12_01.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[~azure.mgmt.databoxedge.v2020_12_01.models.TrackingInfo] + :param shipment_type: ShipmentType of the order. Possible values include: "NotApplicable", + "ShippedToCustomer", "SelfPickup". + :type shipment_type: str or ~azure.mgmt.databoxedge.v2020_12_01.models.ShipmentType + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'current_status': {'readonly': True}, + 'order_history': {'readonly': True}, + 'serial_number': {'readonly': True}, + 'delivery_tracking_info': {'readonly': True}, + 'return_tracking_info': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'contact_information': {'key': 'properties.contactInformation', 'type': 'ContactDetails'}, + 'shipping_address': {'key': 'properties.shippingAddress', 'type': 'Address'}, + 'current_status': {'key': 'properties.currentStatus', 'type': 'OrderStatus'}, + 'order_history': {'key': 'properties.orderHistory', 'type': '[OrderStatus]'}, + 'serial_number': {'key': 'properties.serialNumber', 'type': 'str'}, + 'delivery_tracking_info': {'key': 'properties.deliveryTrackingInfo', 'type': '[TrackingInfo]'}, + 'return_tracking_info': {'key': 'properties.returnTrackingInfo', 'type': '[TrackingInfo]'}, + 'shipment_type': {'key': 'properties.shipmentType', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(Order, self).__init__(**kwargs) + self.contact_information = kwargs.get('contact_information', None) + self.shipping_address = kwargs.get('shipping_address', None) + self.current_status = None + self.order_history = None + self.serial_number = None + self.delivery_tracking_info = None + self.return_tracking_info = None + self.shipment_type = kwargs.get('shipment_type', None) + + +class OrderList(msrest.serialization.Model): + """List of order entities. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar value: The list of orders. + :vartype value: list[~azure.mgmt.databoxedge.v2020_12_01.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", + "AwaitingPickup", "PickupCompleted", "AwaitingDrop". + :type status: str or ~azure.mgmt.databoxedge.v2020_12_01.models.OrderState + :ivar update_date_time: Time of status update. + :vartype update_date_time: ~datetime.datetime + :param comments: Comments related to this status change. + :type comments: str + :ivar tracking_information: Tracking information related to the state in the ordering flow. + :vartype tracking_information: ~azure.mgmt.databoxedge.v2020_12_01.models.TrackingInfo + :ivar additional_order_details: Dictionary to hold generic information which is not stored + by the already existing properties. + :vartype additional_order_details: dict[str, str] + """ + + _validation = { + 'status': {'required': True}, + 'update_date_time': {'readonly': True}, + 'tracking_information': {'readonly': True}, + 'additional_order_details': {'readonly': True}, + } + + _attribute_map = { + 'status': {'key': 'status', 'type': 'str'}, + 'update_date_time': {'key': 'updateDateTime', 'type': 'iso-8601'}, + 'comments': {'key': 'comments', 'type': 'str'}, + 'tracking_information': {'key': 'trackingInformation', 'type': 'TrackingInfo'}, + 'additional_order_details': {'key': 'additionalOrderDetails', 'type': '{str}'}, + } + + def __init__( + self, + **kwargs + ): + super(OrderStatus, self).__init__(**kwargs) + self.status = kwargs['status'] + self.update_date_time = None + self.comments = kwargs.get('comments', None) + self.tracking_information = None + self.additional_order_details = None + + +class PeriodicTimerEventTrigger(Trigger): + """Trigger details. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: The path ID that uniquely identifies the object. + :vartype id: str + :ivar name: The object name. + :vartype name: str + :ivar type: The hierarchical type of the object. + :vartype type: str + :ivar system_data: Trigger in DataBoxEdge Resource. + :vartype system_data: ~azure.mgmt.databoxedge.v2020_12_01.models.SystemData + :param kind: Required. Trigger Kind.Constant filled by server. Possible values include: + "FileEvent", "PeriodicTimerEvent". + :type kind: str or ~azure.mgmt.databoxedge.v2020_12_01.models.TriggerEventType + :param source_info: Required. Periodic timer details. + :type source_info: ~azure.mgmt.databoxedge.v2020_12_01.models.PeriodicTimerSourceInfo + :param sink_info: Required. Role Sink information. + :type sink_info: ~azure.mgmt.databoxedge.v2020_12_01.models.RoleSinkInfo + :param custom_context_tag: A custom context tag typically used to correlate the trigger against + its usage. For example, if a periodic timer trigger is intended for certain specific IoT + modules in the device, the tag can be the name or the image URL of the module. + :type custom_context_tag: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'system_data': {'readonly': True}, + 'kind': {'required': True}, + 'source_info': {'required': True}, + 'sink_info': {'required': True}, + 'custom_context_tag': {'max_length': 192, 'min_length': 0}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'source_info': {'key': 'properties.sourceInfo', 'type': 'PeriodicTimerSourceInfo'}, + 'sink_info': {'key': 'properties.sinkInfo', 'type': 'RoleSinkInfo'}, + 'custom_context_tag': {'key': 'properties.customContextTag', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(PeriodicTimerEventTrigger, self).__init__(**kwargs) + self.kind = 'PeriodicTimerEvent' # type: str + self.source_info = kwargs['source_info'] + self.sink_info = kwargs['sink_info'] + self.custom_context_tag = kwargs.get('custom_context_tag', None) + + +class PeriodicTimerSourceInfo(msrest.serialization.Model): + """Periodic timer event source. + + All required parameters must be populated in order to send to Azure. + + :param start_time: Required. The time of the day that results in a valid trigger. Schedule is + computed with reference to the time specified upto seconds. If timezone is not specified the + time will considered to be in device timezone. The value will always be returned as UTC time. + :type start_time: ~datetime.datetime + :param schedule: Required. Periodic frequency at which timer event needs to be raised. Supports + daily, hourly, minutes, and seconds. + :type schedule: str + :param topic: Topic where periodic events are published to IoT device. + :type topic: str + """ + + _validation = { + 'start_time': {'required': True}, + 'schedule': {'required': True}, + } + + _attribute_map = { + 'start_time': {'key': 'startTime', 'type': 'iso-8601'}, + 'schedule': {'key': 'schedule', 'type': 'str'}, + 'topic': {'key': 'topic', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(PeriodicTimerSourceInfo, self).__init__(**kwargs) + self.start_time = kwargs['start_time'] + self.schedule = kwargs['schedule'] + self.topic = kwargs.get('topic', None) + + +class RefreshDetails(msrest.serialization.Model): + """Fields for tracking refresh job on the share or container. + + :param in_progress_refresh_job_id: If a refresh job is currently in progress on this share or + container, this field indicates the ARM resource ID of that job. The field is empty if no job + is in progress. + :type in_progress_refresh_job_id: str + :param last_completed_refresh_job_time_in_utc: Indicates the completed time for the last + refresh job on this particular share or container, if any.This could be a failed job or a + successful job. + :type last_completed_refresh_job_time_in_utc: ~datetime.datetime + :param error_manifest_file: Indicates the relative path of the error xml for the last refresh + job on this particular share or container, if any. This could be a failed job or a successful + job. + :type error_manifest_file: str + :param last_job: Indicates the id of the last refresh job on this particular share or + container,if any. This could be a failed job or a successful job. + :type last_job: str + """ + + _attribute_map = { + 'in_progress_refresh_job_id': {'key': 'inProgressRefreshJobId', 'type': 'str'}, + 'last_completed_refresh_job_time_in_utc': {'key': 'lastCompletedRefreshJobTimeInUTC', 'type': 'iso-8601'}, + 'error_manifest_file': {'key': 'errorManifestFile', 'type': 'str'}, + 'last_job': {'key': 'lastJob', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(RefreshDetails, self).__init__(**kwargs) + self.in_progress_refresh_job_id = kwargs.get('in_progress_refresh_job_id', None) + self.last_completed_refresh_job_time_in_utc = kwargs.get('last_completed_refresh_job_time_in_utc', None) + self.error_manifest_file = kwargs.get('error_manifest_file', None) + self.last_job = kwargs.get('last_job', None) + + +class ResourceIdentity(msrest.serialization.Model): + """Msi identity details of the resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param type: Identity type. Possible values include: "None", "SystemAssigned", "UserAssigned". + :type type: str or ~azure.mgmt.databoxedge.v2020_12_01.models.MsiIdentityType + :ivar principal_id: Service Principal Id backing the Msi. + :vartype principal_id: str + :ivar tenant_id: Home Tenant Id. + :vartype tenant_id: str + """ + + _validation = { + 'principal_id': {'readonly': True}, + 'tenant_id': {'readonly': True}, + } + + _attribute_map = { + 'type': {'key': 'type', 'type': 'str'}, + 'principal_id': {'key': 'principalId', 'type': 'str'}, + 'tenant_id': {'key': 'tenantId', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ResourceIdentity, self).__init__(**kwargs) + self.type = kwargs.get('type', None) + self.principal_id = None + self.tenant_id = None + + +class ResourceMoveDetails(msrest.serialization.Model): + """Fields for tracking resource move. + + :param operation_in_progress: Denotes whether move operation is in progress. Possible values + include: "None", "ResourceMoveInProgress", "ResourceMoveFailed". + :type operation_in_progress: str or + ~azure.mgmt.databoxedge.v2020_12_01.models.ResourceMoveStatus + :param operation_in_progress_lock_timeout_in_utc: Denotes the timeout of the operation to + finish. + :type operation_in_progress_lock_timeout_in_utc: ~datetime.datetime + """ + + _attribute_map = { + 'operation_in_progress': {'key': 'operationInProgress', 'type': 'str'}, + 'operation_in_progress_lock_timeout_in_utc': {'key': 'operationInProgressLockTimeoutInUTC', 'type': 'iso-8601'}, + } + + def __init__( + self, + **kwargs + ): + super(ResourceMoveDetails, self).__init__(**kwargs) + self.operation_in_progress = kwargs.get('operation_in_progress', None) + self.operation_in_progress_lock_timeout_in_utc = kwargs.get('operation_in_progress_lock_timeout_in_utc', None) + + +class ResourceTypeSku(msrest.serialization.Model): + """Resource type Sku object. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar resource_type: The resource type. + :vartype resource_type: str + :ivar skus: The skus. + :vartype skus: list[~azure.mgmt.databoxedge.v2020_12_01.models.SkuInformation] + """ + + _validation = { + 'resource_type': {'readonly': True}, + 'skus': {'readonly': True}, + } + + _attribute_map = { + 'resource_type': {'key': 'resourceType', 'type': 'str'}, + 'skus': {'key': 'skus', 'type': '[SkuInformation]'}, + } + + def __init__( + self, + **kwargs + ): + super(ResourceTypeSku, self).__init__(**kwargs) + self.resource_type = None + self.skus = None + + +class RoleList(msrest.serialization.Model): + """Collection of all the roles on the Data Box Edge device. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar value: The Value. + :vartype value: list[~azure.mgmt.databoxedge.v2020_12_01.models.Role] + :ivar next_link: Link to the next set of results. + :vartype next_link: str + """ + + _validation = { + 'value': {'readonly': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[Role]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(RoleList, self).__init__(**kwargs) + self.value = None + self.next_link = None + + +class RoleSinkInfo(msrest.serialization.Model): + """Compute role against which events will be raised. + + All required parameters must be populated in order to send to Azure. + + :param role_id: Required. Compute role ID. + :type role_id: str + """ + + _validation = { + 'role_id': {'required': True}, + } + + _attribute_map = { + 'role_id': {'key': 'roleId', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(RoleSinkInfo, self).__init__(**kwargs) + self.role_id = kwargs['role_id'] + + +class Secret(msrest.serialization.Model): + """Holds device secret either as a KeyVault reference or as an encrypted value. + + :param encrypted_secret: Encrypted (using device public key) secret value. + :type encrypted_secret: ~azure.mgmt.databoxedge.v2020_12_01.models.AsymmetricEncryptedSecret + :param key_vault_id: Id of the Key-Vault where secret is stored (ex: + secrets/AuthClientSecret/82ef4346187a4033a10d629cde07d740). + :type key_vault_id: str + """ + + _attribute_map = { + 'encrypted_secret': {'key': 'encryptedSecret', 'type': 'AsymmetricEncryptedSecret'}, + 'key_vault_id': {'key': 'keyVaultId', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(Secret, self).__init__(**kwargs) + self.encrypted_secret = kwargs.get('encrypted_secret', None) + self.key_vault_id = kwargs.get('key_vault_id', None) + + +class SecuritySettings(ARMBaseModel): + """The security settings of a device. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: The path ID that uniquely identifies the object. + :vartype id: str + :ivar name: The object name. + :vartype name: str + :ivar type: The hierarchical type of the object. + :vartype type: str + :param device_admin_password: Required. Device administrator password as an encrypted string + (encrypted using RSA PKCS #1) is used to sign into the local web UI of the device. The Actual + password should have at least 8 characters that are a combination of uppercase, lowercase, + numeric, and special characters. + :type device_admin_password: + ~azure.mgmt.databoxedge.v2020_12_01.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[~azure.mgmt.databoxedge.v2020_12_01.models.MetricSpecificationV1] + """ + + _attribute_map = { + 'metric_specifications': {'key': 'metricSpecifications', 'type': '[MetricSpecificationV1]'}, + } + + def __init__( + self, + **kwargs + ): + super(ServiceSpecification, self).__init__(**kwargs) + self.metric_specifications = kwargs.get('metric_specifications', None) + + +class Share(ARMBaseModel): + """Represents a share on the Data Box Edge/Gateway device. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: The path ID that uniquely identifies the object. + :vartype id: str + :ivar name: The object name. + :vartype name: str + :ivar type: The hierarchical type of the object. + :vartype type: str + :ivar system_data: Share on ASE device. + :vartype system_data: ~azure.mgmt.databoxedge.v2020_12_01.models.SystemData + :param description: Description for the share. + :type description: str + :param share_status: Required. Current status of the share. Possible values include: "Offline", + "Unknown", "OK", "Updating", "NeedsAttention". + :type share_status: str or ~azure.mgmt.databoxedge.v2020_12_01.models.ShareStatus + :param monitoring_status: Required. Current monitoring status of the share. Possible values + include: "Enabled", "Disabled". + :type monitoring_status: str or ~azure.mgmt.databoxedge.v2020_12_01.models.MonitoringStatus + :param azure_container_info: Azure container mapping for the share. + :type azure_container_info: ~azure.mgmt.databoxedge.v2020_12_01.models.AzureContainerInfo + :param access_protocol: Required. Access protocol to be used by the share. Possible values + include: "SMB", "NFS". + :type access_protocol: str or ~azure.mgmt.databoxedge.v2020_12_01.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[~azure.mgmt.databoxedge.v2020_12_01.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[~azure.mgmt.databoxedge.v2020_12_01.models.ClientAccessRight] + :param refresh_details: Details of the refresh job on this share. + :type refresh_details: ~azure.mgmt.databoxedge.v2020_12_01.models.RefreshDetails + :ivar share_mappings: Share mount point to the role. + :vartype share_mappings: list[~azure.mgmt.databoxedge.v2020_12_01.models.MountPointMap] + :param data_policy: Data policy of the share. Possible values include: "Cloud", "Local". + :type data_policy: str or ~azure.mgmt.databoxedge.v2020_12_01.models.DataPolicy + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'system_data': {'readonly': True}, + 'share_status': {'required': True}, + 'monitoring_status': {'required': True}, + 'access_protocol': {'required': True}, + 'share_mappings': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + 'share_status': {'key': 'properties.shareStatus', 'type': 'str'}, + 'monitoring_status': {'key': 'properties.monitoringStatus', 'type': 'str'}, + 'azure_container_info': {'key': 'properties.azureContainerInfo', 'type': 'AzureContainerInfo'}, + 'access_protocol': {'key': 'properties.accessProtocol', 'type': 'str'}, + 'user_access_rights': {'key': 'properties.userAccessRights', 'type': '[UserAccessRight]'}, + 'client_access_rights': {'key': 'properties.clientAccessRights', 'type': '[ClientAccessRight]'}, + 'refresh_details': {'key': 'properties.refreshDetails', 'type': 'RefreshDetails'}, + 'share_mappings': {'key': 'properties.shareMappings', 'type': '[MountPointMap]'}, + 'data_policy': {'key': 'properties.dataPolicy', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(Share, self).__init__(**kwargs) + self.system_data = None + self.description = kwargs.get('description', None) + self.share_status = kwargs['share_status'] + self.monitoring_status = kwargs['monitoring_status'] + self.azure_container_info = kwargs.get('azure_container_info', None) + self.access_protocol = kwargs['access_protocol'] + self.user_access_rights = kwargs.get('user_access_rights', None) + self.client_access_rights = kwargs.get('client_access_rights', None) + self.refresh_details = kwargs.get('refresh_details', None) + self.share_mappings = None + self.data_policy = kwargs.get('data_policy', None) + + +class ShareAccessRight(msrest.serialization.Model): + """Specifies the mapping between this particular user and the type of access he has on shares on this device. + + All required parameters must be populated in order to send to Azure. + + :param share_id: Required. The share ID. + :type share_id: str + :param access_type: Required. Type of access to be allowed on the share for this user. Possible + values include: "Change", "Read", "Custom". + :type access_type: str or ~azure.mgmt.databoxedge.v2020_12_01.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[~azure.mgmt.databoxedge.v2020_12_01.models.Share] + :ivar next_link: Link to the next set of results. + :vartype next_link: str + """ + + _validation = { + 'value': {'readonly': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[Share]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ShareList, self).__init__(**kwargs) + self.value = None + self.next_link = None + + +class Sku(msrest.serialization.Model): + """The SKU type. + + :param name: SKU name. Possible values include: "Gateway", "Edge", "TEA_1Node", + "TEA_1Node_UPS", "TEA_1Node_Heater", "TEA_1Node_UPS_Heater", "TEA_4Node_Heater", + "TEA_4Node_UPS_Heater", "TMA", "TDC", "TCA_Small", "GPU", "TCA_Large", "EdgeP_Base", + "EdgeP_High", "EdgePR_Base", "EdgePR_Base_UPS", "EdgeMR_Mini", "RCA_Small", "RCA_Large", "RDC". + :type name: str or ~azure.mgmt.databoxedge.v2020_12_01.models.SkuName + :param tier: The SKU tier. This is based on the SKU name. Possible values include: "Standard". + :type tier: str or ~azure.mgmt.databoxedge.v2020_12_01.models.SkuTier + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'tier': {'key': 'tier', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(Sku, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.tier = kwargs.get('tier', None) + + +class SkuCapability(msrest.serialization.Model): + """The metadata to describe the capability. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar name: An invariant to describe the feature. + :vartype name: str + :ivar value: An invariant if the feature is measured by quantity. + :vartype value: str + """ + + _validation = { + 'name': {'readonly': True}, + 'value': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'value': {'key': 'value', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(SkuCapability, self).__init__(**kwargs) + self.name = None + self.value = None + + +class SkuCost(msrest.serialization.Model): + """The metadata for retrieving price info. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar meter_id: Used for querying price from commerce. + :vartype meter_id: str + :ivar quantity: The cost quantity. + :vartype quantity: long + :ivar extended_unit: The extended unit. + :vartype extended_unit: str + """ + + _validation = { + 'meter_id': {'readonly': True}, + 'quantity': {'readonly': True}, + 'extended_unit': {'readonly': True}, + } + + _attribute_map = { + 'meter_id': {'key': 'meterId', 'type': 'str'}, + 'quantity': {'key': 'quantity', 'type': 'long'}, + 'extended_unit': {'key': 'extendedUnit', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(SkuCost, self).__init__(**kwargs) + self.meter_id = None + self.quantity = None + self.extended_unit = None + + +class SkuInformation(msrest.serialization.Model): + """Sku information. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar name: The sku name. + :vartype name: str + :ivar tier: The sku tier. + :vartype tier: str + :ivar kind: The sku kind. + :vartype kind: str + :ivar family: The Sku family. + :vartype family: str + :ivar costs: The pricing info of the Sku. + :vartype costs: list[~azure.mgmt.databoxedge.v2020_12_01.models.SkuCost] + :ivar locations: The locations where Sku is available. + :vartype locations: list[str] + :ivar location_info: The locations where Sku is available with zones and sites info. + :vartype location_info: list[~azure.mgmt.databoxedge.v2020_12_01.models.SkuLocationInfo] + :ivar required_quota_ids: The required quotaIds for the sku to be available. + :vartype required_quota_ids: list[str] + :ivar required_features: The required features for the sku to be available. + :vartype required_features: list[str] + """ + + _validation = { + 'name': {'readonly': True}, + 'tier': {'readonly': True}, + 'kind': {'readonly': True}, + 'family': {'readonly': True}, + 'costs': {'readonly': True}, + 'locations': {'readonly': True}, + 'location_info': {'readonly': True}, + 'required_quota_ids': {'readonly': True}, + 'required_features': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'tier': {'key': 'tier', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'family': {'key': 'family', 'type': 'str'}, + 'costs': {'key': 'costs', 'type': '[SkuCost]'}, + 'locations': {'key': 'locations', 'type': '[str]'}, + 'location_info': {'key': 'locationInfo', 'type': '[SkuLocationInfo]'}, + 'required_quota_ids': {'key': 'requiredQuotaIds', 'type': '[str]'}, + 'required_features': {'key': 'requiredFeatures', 'type': '[str]'}, + } + + def __init__( + self, + **kwargs + ): + super(SkuInformation, self).__init__(**kwargs) + self.name = None + self.tier = None + self.kind = None + self.family = None + self.costs = None + self.locations = None + self.location_info = None + self.required_quota_ids = None + self.required_features = None + + +class SkuInformationList(msrest.serialization.Model): + """List of SKU Information objects. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar value: List of ResourceTypeSku objects. + :vartype value: list[~azure.mgmt.databoxedge.v2020_12_01.models.ResourceTypeSku] + :ivar next_link: Links to the next set of results. + :vartype next_link: str + """ + + _validation = { + 'value': {'readonly': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[ResourceTypeSku]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(SkuInformationList, self).__init__(**kwargs) + self.value = None + self.next_link = None + + +class SkuLocationInfo(msrest.serialization.Model): + """The location info. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar location: The location. + :vartype location: str + :ivar zones: The zones. + :vartype zones: list[str] + :ivar sites: The sites. + :vartype sites: list[str] + """ + + _validation = { + 'location': {'readonly': True}, + 'zones': {'readonly': True}, + 'sites': {'readonly': True}, + } + + _attribute_map = { + 'location': {'key': 'location', 'type': 'str'}, + 'zones': {'key': 'zones', 'type': '[str]'}, + 'sites': {'key': 'sites', 'type': '[str]'}, + } + + def __init__( + self, + **kwargs + ): + super(SkuLocationInfo, self).__init__(**kwargs) + self.location = None + self.zones = None + self.sites = None + + +class StorageAccount(ARMBaseModel): + """Represents a Storage Account on the Data Box Edge/Gateway device. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: The path ID that uniquely identifies the object. + :vartype id: str + :ivar name: The object name. + :vartype name: str + :ivar type: The hierarchical type of the object. + :vartype type: str + :ivar system_data: StorageAccount object on ASE device. + :vartype system_data: ~azure.mgmt.databoxedge.v2020_12_01.models.SystemData + :param description: Description for the storage Account. + :type description: str + :param storage_account_status: Current status of the storage account. Possible values include: + "OK", "Offline", "Unknown", "Updating", "NeedsAttention". + :type storage_account_status: str or + ~azure.mgmt.databoxedge.v2020_12_01.models.StorageAccountStatus + :param data_policy: Required. Data policy of the storage Account. Possible values include: + "Cloud", "Local". + :type data_policy: str or ~azure.mgmt.databoxedge.v2020_12_01.models.DataPolicy + :param storage_account_credential_id: Storage Account Credential Id. + :type storage_account_credential_id: str + :ivar blob_endpoint: BlobEndpoint of Storage Account. + :vartype blob_endpoint: str + :ivar container_count: The Container Count. Present only for Storage Accounts with DataPolicy + set to Cloud. + :vartype container_count: int + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'system_data': {'readonly': True}, + 'data_policy': {'required': True}, + 'blob_endpoint': {'readonly': True}, + 'container_count': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + 'storage_account_status': {'key': 'properties.storageAccountStatus', 'type': 'str'}, + 'data_policy': {'key': 'properties.dataPolicy', 'type': 'str'}, + 'storage_account_credential_id': {'key': 'properties.storageAccountCredentialId', 'type': 'str'}, + 'blob_endpoint': {'key': 'properties.blobEndpoint', 'type': 'str'}, + 'container_count': {'key': 'properties.containerCount', 'type': 'int'}, + } + + def __init__( + self, + **kwargs + ): + super(StorageAccount, self).__init__(**kwargs) + self.system_data = None + self.description = kwargs.get('description', None) + self.storage_account_status = kwargs.get('storage_account_status', None) + self.data_policy = kwargs['data_policy'] + self.storage_account_credential_id = kwargs.get('storage_account_credential_id', None) + self.blob_endpoint = None + self.container_count = None + + +class StorageAccountCredential(ARMBaseModel): + """The storage account credential. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: The path ID that uniquely identifies the object. + :vartype id: str + :ivar name: The object name. + :vartype name: str + :ivar type: The hierarchical type of the object. + :vartype type: str + :ivar system_data: StorageAccountCredential object. + :vartype system_data: ~azure.mgmt.databoxedge.v2020_12_01.models.SystemData + :param alias: Required. Alias for the storage account. + :type alias: str + :param user_name: Username for the storage account. + :type user_name: str + :param account_key: Encrypted storage key. + :type account_key: ~azure.mgmt.databoxedge.v2020_12_01.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 ~azure.mgmt.databoxedge.v2020_12_01.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 ~azure.mgmt.databoxedge.v2020_12_01.models.AccountType + :param storage_account_id: Id of the storage account. + :type storage_account_id: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'system_data': {'readonly': True}, + 'alias': {'required': True}, + 'ssl_status': {'required': True}, + 'account_type': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'alias': {'key': 'properties.alias', 'type': 'str'}, + 'user_name': {'key': 'properties.userName', 'type': 'str'}, + 'account_key': {'key': 'properties.accountKey', 'type': 'AsymmetricEncryptedSecret'}, + 'connection_string': {'key': 'properties.connectionString', 'type': 'str'}, + 'ssl_status': {'key': 'properties.sslStatus', 'type': 'str'}, + 'blob_domain_name': {'key': 'properties.blobDomainName', 'type': 'str'}, + 'account_type': {'key': 'properties.accountType', 'type': 'str'}, + 'storage_account_id': {'key': 'properties.storageAccountId', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(StorageAccountCredential, self).__init__(**kwargs) + self.system_data = None + self.alias = kwargs['alias'] + self.user_name = kwargs.get('user_name', None) + self.account_key = kwargs.get('account_key', None) + self.connection_string = kwargs.get('connection_string', None) + self.ssl_status = kwargs['ssl_status'] + self.blob_domain_name = kwargs.get('blob_domain_name', None) + self.account_type = kwargs['account_type'] + self.storage_account_id = kwargs.get('storage_account_id', None) + + +class StorageAccountCredentialList(msrest.serialization.Model): + """The collection of storage account credentials. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar value: The value. + :vartype value: list[~azure.mgmt.databoxedge.v2020_12_01.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[~azure.mgmt.databoxedge.v2020_12_01.models.StorageAccount] + :ivar next_link: Link to the next set of results. + :vartype next_link: str + """ + + _validation = { + 'value': {'readonly': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[StorageAccount]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(StorageAccountList, self).__init__(**kwargs) + self.value = None + self.next_link = None + + +class SubscriptionRegisteredFeatures(msrest.serialization.Model): + """SubscriptionRegisteredFeatures. + + :param name: + :type name: str + :param state: + :type state: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'state': {'key': 'state', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(SubscriptionRegisteredFeatures, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.state = kwargs.get('state', None) + + +class SymmetricKey(msrest.serialization.Model): + """Symmetric key for authentication. + + :param connection_string: Connection string based on the symmetric key. + :type connection_string: ~azure.mgmt.databoxedge.v2020_12_01.models.AsymmetricEncryptedSecret + """ + + _attribute_map = { + 'connection_string': {'key': 'connectionString', 'type': 'AsymmetricEncryptedSecret'}, + } + + def __init__( + self, + **kwargs + ): + super(SymmetricKey, self).__init__(**kwargs) + self.connection_string = kwargs.get('connection_string', None) + + +class SystemData(msrest.serialization.Model): + """Metadata pertaining to creation and last modification of the resource. + + :param created_by: The identity that created the resource. + :type created_by: str + :param created_by_type: The type of identity that created the resource. Possible values + include: "User", "Application", "ManagedIdentity", "Key". + :type created_by_type: str or ~azure.mgmt.databoxedge.v2020_12_01.models.CreatedByType + :param created_at: The timestamp of resource creation (UTC). + :type created_at: ~datetime.datetime + :param last_modified_by: The identity that last modified the resource. + :type last_modified_by: str + :param last_modified_by_type: The type of identity that last modified the resource. Possible + values include: "User", "Application", "ManagedIdentity", "Key". + :type last_modified_by_type: str or ~azure.mgmt.databoxedge.v2020_12_01.models.CreatedByType + :param last_modified_at: The type of identity that last modified the resource. + :type last_modified_at: ~datetime.datetime + """ + + _attribute_map = { + 'created_by': {'key': 'createdBy', 'type': 'str'}, + 'created_by_type': {'key': 'createdByType', 'type': 'str'}, + 'created_at': {'key': 'createdAt', 'type': 'iso-8601'}, + 'last_modified_by': {'key': 'lastModifiedBy', 'type': 'str'}, + 'last_modified_by_type': {'key': 'lastModifiedByType', 'type': 'str'}, + 'last_modified_at': {'key': 'lastModifiedAt', 'type': 'iso-8601'}, + } + + def __init__( + self, + **kwargs + ): + super(SystemData, self).__init__(**kwargs) + self.created_by = kwargs.get('created_by', None) + self.created_by_type = kwargs.get('created_by_type', None) + self.created_at = kwargs.get('created_at', None) + self.last_modified_by = kwargs.get('last_modified_by', None) + self.last_modified_by_type = kwargs.get('last_modified_by_type', None) + self.last_modified_at = kwargs.get('last_modified_at', None) + + +class TrackingInfo(msrest.serialization.Model): + """Tracking courier information. + + :param serial_number: Serial number of the device being tracked. + :type serial_number: str + :param carrier_name: Name of the carrier used in the delivery. + :type carrier_name: str + :param tracking_id: Tracking ID of the shipment. + :type tracking_id: str + :param tracking_url: Tracking URL of the shipment. + :type tracking_url: str + """ + + _attribute_map = { + 'serial_number': {'key': 'serialNumber', 'type': 'str'}, + 'carrier_name': {'key': 'carrierName', 'type': 'str'}, + 'tracking_id': {'key': 'trackingId', 'type': 'str'}, + 'tracking_url': {'key': 'trackingUrl', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(TrackingInfo, self).__init__(**kwargs) + self.serial_number = kwargs.get('serial_number', None) + self.carrier_name = kwargs.get('carrier_name', None) + self.tracking_id = kwargs.get('tracking_id', None) + self.tracking_url = kwargs.get('tracking_url', None) + + +class TriggerList(msrest.serialization.Model): + """Collection of all trigger on the data box edge device. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar value: The list of triggers. + :vartype value: list[~azure.mgmt.databoxedge.v2020_12_01.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 ~azure.mgmt.databoxedge.v2020_12_01.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 + ~azure.mgmt.databoxedge.v2020_12_01.models.InstallRebootBehavior + :ivar ongoing_update_operation: The current update operation. Possible values include: "None", + "Scan", "Download", "Install". + :vartype ongoing_update_operation: str or + ~azure.mgmt.databoxedge.v2020_12_01.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 ~azure.mgmt.databoxedge.v2020_12_01.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 ~azure.mgmt.databoxedge.v2020_12_01.models.AuthenticationType + :ivar resource_id: The resource ID of the Data Box Edge/Gateway device. + :vartype resource_id: str + :ivar aad_authority: Azure Active Directory tenant authority. + :vartype aad_authority: str + :ivar aad_tenant_id: Azure Active Directory tenant ID. + :vartype aad_tenant_id: str + :ivar service_principal_client_id: Azure Active Directory service principal client ID. + :vartype service_principal_client_id: str + :ivar service_principal_object_id: Azure Active Directory service principal object ID. + :vartype service_principal_object_id: str + :ivar azure_management_endpoint_audience: The azure management endpoint audience. + :vartype azure_management_endpoint_audience: str + :ivar aad_audience: Identifier of the target resource that is the recipient of the requested + token. + :vartype aad_audience: str + """ + + _validation = { + 'resource_id': {'readonly': True}, + 'aad_authority': {'readonly': True}, + 'aad_tenant_id': {'readonly': True}, + 'service_principal_client_id': {'readonly': True}, + 'service_principal_object_id': {'readonly': True}, + 'azure_management_endpoint_audience': {'readonly': True}, + 'aad_audience': {'readonly': True}, + } + + _attribute_map = { + 'auth_type': {'key': 'authType', 'type': 'str'}, + 'resource_id': {'key': 'resourceId', 'type': 'str'}, + 'aad_authority': {'key': 'aadAuthority', 'type': 'str'}, + 'aad_tenant_id': {'key': 'aadTenantId', 'type': 'str'}, + 'service_principal_client_id': {'key': 'servicePrincipalClientId', 'type': 'str'}, + 'service_principal_object_id': {'key': 'servicePrincipalObjectId', 'type': 'str'}, + 'azure_management_endpoint_audience': {'key': 'azureManagementEndpointAudience', 'type': 'str'}, + 'aad_audience': {'key': 'aadAudience', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(UploadCertificateResponse, self).__init__(**kwargs) + self.auth_type = kwargs.get('auth_type', None) + self.resource_id = None + self.aad_authority = None + self.aad_tenant_id = None + self.service_principal_client_id = None + self.service_principal_object_id = None + self.azure_management_endpoint_audience = None + self.aad_audience = None + + +class User(ARMBaseModel): + """Represents a user who has access to one or more shares on the Data Box Edge/Gateway device. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: The path ID that uniquely identifies the object. + :vartype id: str + :ivar name: The object name. + :vartype name: str + :ivar type: The hierarchical type of the object. + :vartype type: str + :ivar system_data: User in DataBoxEdge Resource. + :vartype system_data: ~azure.mgmt.databoxedge.v2020_12_01.models.SystemData + :param encrypted_password: The password details. + :type encrypted_password: ~azure.mgmt.databoxedge.v2020_12_01.models.AsymmetricEncryptedSecret + :ivar share_access_rights: List of shares that the user has rights on. This field should not be + specified during user creation. + :vartype share_access_rights: list[~azure.mgmt.databoxedge.v2020_12_01.models.ShareAccessRight] + :param user_type: Required. Type of the user. Possible values include: "Share", + "LocalManagement", "ARM". + :type user_type: str or ~azure.mgmt.databoxedge.v2020_12_01.models.UserType + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'system_data': {'readonly': True}, + 'share_access_rights': {'readonly': True}, + 'user_type': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'encrypted_password': {'key': 'properties.encryptedPassword', 'type': 'AsymmetricEncryptedSecret'}, + 'share_access_rights': {'key': 'properties.shareAccessRights', 'type': '[ShareAccessRight]'}, + 'user_type': {'key': 'properties.userType', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(User, self).__init__(**kwargs) + self.system_data = None + self.encrypted_password = kwargs.get('encrypted_password', None) + self.share_access_rights = None + self.user_type = kwargs['user_type'] + + +class UserAccessRight(msrest.serialization.Model): + """The mapping between a particular user and the access type on the SMB share. + + All required parameters must be populated in order to send to Azure. + + :param user_id: Required. User ID (already existing in the device). + :type user_id: str + :param access_type: Required. Type of access to be allowed for the user. Possible values + include: "Change", "Read", "Custom". + :type access_type: str or ~azure.mgmt.databoxedge.v2020_12_01.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[~azure.mgmt.databoxedge.v2020_12_01.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/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/datab/models/_models_py3.py b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/datab/models/_models_py3.py new file mode 100644 index 000000000000..dd497b64f9f8 --- /dev/null +++ b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/datab/models/_models_py3.py @@ -0,0 +1,5435 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +import datetime +from typing import Dict, List, Optional, Union + +import msrest.serialization + +from ._data_box_edge_management_client_enums import * + + +class ARMBaseModel(msrest.serialization.Model): + """Represents the base class for all object models. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: The path ID that uniquely identifies the object. + :vartype id: str + :ivar name: The object name. + :vartype name: str + :ivar type: The hierarchical type of the object. + :vartype type: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ARMBaseModel, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None + + +class Addon(ARMBaseModel): + """Role Addon. + + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: ArcAddon, IoTAddon. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: The path ID that uniquely identifies the object. + :vartype id: str + :ivar name: The object name. + :vartype name: str + :ivar type: The hierarchical type of the object. + :vartype type: str + :param kind: Required. Addon type.Constant filled by server. Possible values include: + "IotEdge", "ArcForKubernetes". + :type kind: str or ~azure.mgmt.databoxedge.v2020_12_01.models.AddonType + :ivar system_data: Addon type. + :vartype system_data: ~azure.mgmt.databoxedge.v2020_12_01.models.SystemData + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'kind': {'required': True}, + 'system_data': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + } + + _subtype_map = { + 'kind': {'ArcForKubernetes': 'ArcAddon', 'IotEdge': 'IoTAddon'} + } + + def __init__( + self, + **kwargs + ): + super(Addon, self).__init__(**kwargs) + self.kind = 'Addon' # type: str + self.system_data = None + + +class AddonList(msrest.serialization.Model): + """Collection of all the Role addon on the Azure Stack Edge device. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar value: The Value. + :vartype value: list[~azure.mgmt.databoxedge.v2020_12_01.models.Addon] + :ivar next_link: Link to the next set of results. + :vartype next_link: str + """ + + _validation = { + 'value': {'readonly': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[Addon]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(AddonList, self).__init__(**kwargs) + self.value = None + self.next_link = None + + +class Address(msrest.serialization.Model): + """The shipping address of the customer. + + All required parameters must be populated in order to send to Azure. + + :param address_line1: The address line1. + :type address_line1: str + :param address_line2: The address line2. + :type address_line2: str + :param address_line3: The address line3. + :type address_line3: str + :param postal_code: The postal code. + :type postal_code: str + :param city: The city name. + :type city: str + :param state: The state name. + :type state: str + :param country: Required. The country name. + :type country: str + """ + + _validation = { + 'country': {'required': True}, + } + + _attribute_map = { + 'address_line1': {'key': 'addressLine1', 'type': 'str'}, + 'address_line2': {'key': 'addressLine2', 'type': 'str'}, + 'address_line3': {'key': 'addressLine3', 'type': 'str'}, + 'postal_code': {'key': 'postalCode', 'type': 'str'}, + 'city': {'key': 'city', 'type': 'str'}, + 'state': {'key': 'state', 'type': 'str'}, + 'country': {'key': 'country', 'type': 'str'}, + } + + def __init__( + self, + *, + country: str, + address_line1: Optional[str] = None, + address_line2: Optional[str] = None, + address_line3: Optional[str] = None, + postal_code: Optional[str] = None, + city: Optional[str] = None, + state: Optional[str] = None, + **kwargs + ): + super(Address, self).__init__(**kwargs) + self.address_line1 = address_line1 + self.address_line2 = address_line2 + self.address_line3 = address_line3 + self.postal_code = postal_code + self.city = city + self.state = state + self.country = country + + +class Alert(ARMBaseModel): + """Alert on the data box edge/gateway device. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: The path ID that uniquely identifies the object. + :vartype id: str + :ivar name: The object name. + :vartype name: str + :ivar type: The hierarchical type of the object. + :vartype type: str + :ivar system_data: Alert generated in the resource. + :vartype system_data: ~azure.mgmt.databoxedge.v2020_12_01.models.SystemData + :ivar title: Alert title. + :vartype title: str + :ivar alert_type: Alert type. + :vartype alert_type: str + :ivar appeared_at_date_time: UTC time when the alert appeared. + :vartype appeared_at_date_time: ~datetime.datetime + :ivar recommendation: Alert recommendation. + :vartype recommendation: str + :ivar severity: Severity of the alert. Possible values include: "Informational", "Warning", + "Critical". + :vartype severity: str or ~azure.mgmt.databoxedge.v2020_12_01.models.AlertSeverity + :ivar error_details: Error details of the alert. + :vartype error_details: ~azure.mgmt.databoxedge.v2020_12_01.models.AlertErrorDetails + :ivar detailed_information: Alert details. + :vartype detailed_information: dict[str, str] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'system_data': {'readonly': True}, + 'title': {'readonly': True}, + 'alert_type': {'readonly': True}, + 'appeared_at_date_time': {'readonly': True}, + 'recommendation': {'readonly': True}, + 'severity': {'readonly': True}, + 'error_details': {'readonly': True}, + 'detailed_information': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'title': {'key': 'properties.title', 'type': 'str'}, + 'alert_type': {'key': 'properties.alertType', 'type': 'str'}, + 'appeared_at_date_time': {'key': 'properties.appearedAtDateTime', 'type': 'iso-8601'}, + 'recommendation': {'key': 'properties.recommendation', 'type': 'str'}, + 'severity': {'key': 'properties.severity', 'type': 'str'}, + 'error_details': {'key': 'properties.errorDetails', 'type': 'AlertErrorDetails'}, + 'detailed_information': {'key': 'properties.detailedInformation', 'type': '{str}'}, + } + + def __init__( + self, + **kwargs + ): + super(Alert, self).__init__(**kwargs) + self.system_data = None + self.title = None + self.alert_type = None + self.appeared_at_date_time = None + self.recommendation = None + self.severity = None + self.error_details = None + self.detailed_information = None + + +class AlertErrorDetails(msrest.serialization.Model): + """Error details for the alert. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar error_code: Error code. + :vartype error_code: str + :ivar error_message: Error Message. + :vartype error_message: str + :ivar occurrences: Number of occurrences. + :vartype occurrences: int + """ + + _validation = { + 'error_code': {'readonly': True}, + 'error_message': {'readonly': True}, + 'occurrences': {'readonly': True}, + } + + _attribute_map = { + 'error_code': {'key': 'errorCode', 'type': 'str'}, + 'error_message': {'key': 'errorMessage', 'type': 'str'}, + 'occurrences': {'key': 'occurrences', 'type': 'int'}, + } + + def __init__( + self, + **kwargs + ): + super(AlertErrorDetails, self).__init__(**kwargs) + self.error_code = None + self.error_message = None + self.occurrences = None + + +class AlertList(msrest.serialization.Model): + """Collection of alerts. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar value: The value. + :vartype value: list[~azure.mgmt.databoxedge.v2020_12_01.models.Alert] + :ivar next_link: Link to the next set of results. + :vartype next_link: str + """ + + _validation = { + 'value': {'readonly': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[Alert]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(AlertList, self).__init__(**kwargs) + self.value = None + self.next_link = None + + +class ArcAddon(Addon): + """Arc Addon. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: The path ID that uniquely identifies the object. + :vartype id: str + :ivar name: The object name. + :vartype name: str + :ivar type: The hierarchical type of the object. + :vartype type: str + :param kind: Required. Addon type.Constant filled by server. Possible values include: + "IotEdge", "ArcForKubernetes". + :type kind: str or ~azure.mgmt.databoxedge.v2020_12_01.models.AddonType + :ivar system_data: Addon type. + :vartype system_data: ~azure.mgmt.databoxedge.v2020_12_01.models.SystemData + :param subscription_id: Required. Arc resource subscription Id. + :type subscription_id: str + :param resource_group_name: Required. Arc resource group name. + :type resource_group_name: str + :param resource_name: Required. Arc resource Name. + :type resource_name: str + :param resource_location: Required. Arc resource location. + :type resource_location: str + :ivar version: Arc resource version. + :vartype version: str + :ivar host_platform: Host OS supported by the Arc addon. Possible values include: "Windows", + "Linux". + :vartype host_platform: str or ~azure.mgmt.databoxedge.v2020_12_01.models.PlatformType + :ivar host_platform_type: Platform where the runtime is hosted. Possible values include: + "KubernetesCluster", "LinuxVM". + :vartype host_platform_type: str or ~azure.mgmt.databoxedge.v2020_12_01.models.HostPlatformType + :ivar provisioning_state: Addon Provisioning State. Possible values include: "Invalid", + "Creating", "Created", "Updating", "Reconfiguring", "Failed", "Deleting". + :vartype provisioning_state: str or ~azure.mgmt.databoxedge.v2020_12_01.models.AddonState + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'kind': {'required': True}, + 'system_data': {'readonly': True}, + 'subscription_id': {'required': True}, + 'resource_group_name': {'required': True}, + 'resource_name': {'required': True}, + 'resource_location': {'required': True}, + 'version': {'readonly': True}, + 'host_platform': {'readonly': True}, + 'host_platform_type': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'subscription_id': {'key': 'properties.subscriptionId', 'type': 'str'}, + 'resource_group_name': {'key': 'properties.resourceGroupName', 'type': 'str'}, + 'resource_name': {'key': 'properties.resourceName', 'type': 'str'}, + 'resource_location': {'key': 'properties.resourceLocation', 'type': 'str'}, + 'version': {'key': 'properties.version', 'type': 'str'}, + 'host_platform': {'key': 'properties.hostPlatform', 'type': 'str'}, + 'host_platform_type': {'key': 'properties.hostPlatformType', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + } + + def __init__( + self, + *, + subscription_id: str, + resource_group_name: str, + resource_name: str, + resource_location: str, + **kwargs + ): + super(ArcAddon, self).__init__(**kwargs) + self.kind = 'ArcForKubernetes' # type: str + self.subscription_id = subscription_id + self.resource_group_name = resource_group_name + self.resource_name = resource_name + self.resource_location = resource_location + self.version = None + self.host_platform = None + self.host_platform_type = None + self.provisioning_state = None + + +class AsymmetricEncryptedSecret(msrest.serialization.Model): + """Represent the secrets intended for encryption with asymmetric key pair. + + All required parameters must be populated in order to send to Azure. + + :param value: Required. The value of the secret. + :type value: str + :param encryption_cert_thumbprint: Thumbprint certificate used to encrypt \"Value\". If the + value is unencrypted, it will be null. + :type encryption_cert_thumbprint: str + :param encryption_algorithm: Required. The algorithm used to encrypt "Value". Possible values + include: "None", "AES256", "RSAES_PKCS1_v_1_5". + :type encryption_algorithm: str or + ~azure.mgmt.databoxedge.v2020_12_01.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: ~azure.mgmt.databoxedge.v2020_12_01.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 ~azure.mgmt.databoxedge.v2020_12_01.models.AzureContainerDataFormat + """ + + _validation = { + 'storage_account_credential_id': {'required': True}, + 'container_name': {'required': True}, + 'data_format': {'required': True}, + } + + _attribute_map = { + 'storage_account_credential_id': {'key': 'storageAccountCredentialId', 'type': 'str'}, + 'container_name': {'key': 'containerName', 'type': 'str'}, + 'data_format': {'key': 'dataFormat', 'type': 'str'}, + } + + def __init__( + self, + *, + storage_account_credential_id: str, + container_name: str, + data_format: Union[str, "AzureContainerDataFormat"], + **kwargs + ): + super(AzureContainerInfo, self).__init__(**kwargs) + self.storage_account_credential_id = storage_account_credential_id + self.container_name = container_name + self.data_format = data_format + + +class BandwidthSchedule(ARMBaseModel): + """The bandwidth schedule details. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: The path ID that uniquely identifies the object. + :vartype id: str + :ivar name: The object name. + :vartype name: str + :ivar type: The hierarchical type of the object. + :vartype type: str + :ivar system_data: Bandwidth object related to ASE resource. + :vartype system_data: ~azure.mgmt.databoxedge.v2020_12_01.models.SystemData + :param start: Required. The start time of the schedule in UTC. + :type start: str + :param stop: Required. The stop time of the schedule in UTC. + :type stop: str + :param rate_in_mbps: Required. The bandwidth rate in Mbps. + :type rate_in_mbps: int + :param days: Required. The days of the week when this schedule is applicable. + :type days: list[str or ~azure.mgmt.databoxedge.v2020_12_01.models.DayOfWeek] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'system_data': {'readonly': True}, + 'start': {'required': True}, + 'stop': {'required': True}, + 'rate_in_mbps': {'required': True}, + 'days': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'start': {'key': 'properties.start', 'type': 'str'}, + 'stop': {'key': 'properties.stop', 'type': 'str'}, + 'rate_in_mbps': {'key': 'properties.rateInMbps', 'type': 'int'}, + 'days': {'key': 'properties.days', 'type': '[str]'}, + } + + def __init__( + self, + *, + start: str, + stop: str, + rate_in_mbps: int, + days: List[Union[str, "DayOfWeek"]], + **kwargs + ): + super(BandwidthSchedule, self).__init__(**kwargs) + self.system_data = None + self.start = start + self.stop = stop + self.rate_in_mbps = rate_in_mbps + self.days = days + + +class BandwidthSchedulesList(msrest.serialization.Model): + """The collection of bandwidth schedules. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar value: The list of bandwidth schedules. + :vartype value: list[~azure.mgmt.databoxedge.v2020_12_01.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 ~azure.mgmt.databoxedge.v2020_12_01.models.ClientPermissionType + """ + + _validation = { + 'client': {'required': True}, + 'access_permission': {'required': True}, + } + + _attribute_map = { + 'client': {'key': 'client', 'type': 'str'}, + 'access_permission': {'key': 'accessPermission', 'type': 'str'}, + } + + def __init__( + self, + *, + client: str, + access_permission: Union[str, "ClientPermissionType"], + **kwargs + ): + super(ClientAccessRight, self).__init__(**kwargs) + self.client = client + self.access_permission = access_permission + + +class Role(ARMBaseModel): + """Compute role. + + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: CloudEdgeManagementRole, IoTRole, KubernetesRole, MECRole. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: The path ID that uniquely identifies the object. + :vartype id: str + :ivar name: The object name. + :vartype name: str + :ivar type: The hierarchical type of the object. + :vartype type: str + :param kind: Required. Role type.Constant filled by server. Possible values include: "IOT", + "ASA", "Functions", "Cognitive", "MEC", "CloudEdgeManagement", "Kubernetes". + :type kind: str or ~azure.mgmt.databoxedge.v2020_12_01.models.RoleTypes + :ivar system_data: Role configured on ASE resource. + :vartype system_data: ~azure.mgmt.databoxedge.v2020_12_01.models.SystemData + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'kind': {'required': True}, + 'system_data': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + } + + _subtype_map = { + 'kind': {'CloudEdgeManagement': 'CloudEdgeManagementRole', 'IOT': 'IoTRole', 'Kubernetes': 'KubernetesRole', 'MEC': 'MECRole'} + } + + def __init__( + self, + **kwargs + ): + super(Role, self).__init__(**kwargs) + self.kind = 'Role' # type: str + self.system_data = None + + +class CloudEdgeManagementRole(Role): + """CloudEdgeManagementRole role. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: The path ID that uniquely identifies the object. + :vartype id: str + :ivar name: The object name. + :vartype name: str + :ivar type: The hierarchical type of the object. + :vartype type: str + :param kind: Required. Role type.Constant filled by server. Possible values include: "IOT", + "ASA", "Functions", "Cognitive", "MEC", "CloudEdgeManagement", "Kubernetes". + :type kind: str or ~azure.mgmt.databoxedge.v2020_12_01.models.RoleTypes + :ivar system_data: Role configured on ASE resource. + :vartype system_data: ~azure.mgmt.databoxedge.v2020_12_01.models.SystemData + :ivar local_management_status: Local Edge Management Status. Possible values include: + "Enabled", "Disabled". + :vartype local_management_status: str or ~azure.mgmt.databoxedge.v2020_12_01.models.RoleStatus + :ivar edge_profile: Edge Profile of the resource. + :vartype edge_profile: ~azure.mgmt.databoxedge.v2020_12_01.models.EdgeProfile + :param role_status: Role status. Possible values include: "Enabled", "Disabled". + :type role_status: str or ~azure.mgmt.databoxedge.v2020_12_01.models.RoleStatus + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'kind': {'required': True}, + 'system_data': {'readonly': True}, + 'local_management_status': {'readonly': True}, + 'edge_profile': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'local_management_status': {'key': 'properties.localManagementStatus', 'type': 'str'}, + 'edge_profile': {'key': 'properties.edgeProfile', 'type': 'EdgeProfile'}, + 'role_status': {'key': 'properties.roleStatus', 'type': 'str'}, + } + + def __init__( + self, + *, + role_status: Optional[Union[str, "RoleStatus"]] = None, + **kwargs + ): + super(CloudEdgeManagementRole, self).__init__(**kwargs) + self.kind = 'CloudEdgeManagement' # type: str + self.local_management_status = None + self.edge_profile = None + self.role_status = role_status + + +class CloudErrorBody(msrest.serialization.Model): + """An error response from the service. + + :param code: An identifier for the error. Codes are invariant and are intended to be consumed + programmatically. + :type code: str + :param message: A message describing the error, intended to be suitable for display in a user + interface. + :type message: str + :param details: A list of additional details about the error. + :type details: list[~azure.mgmt.databoxedge.v2020_12_01.models.CloudErrorBody] + """ + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + 'details': {'key': 'details', 'type': '[CloudErrorBody]'}, + } + + def __init__( + self, + *, + code: Optional[str] = None, + message: Optional[str] = None, + details: Optional[List["CloudErrorBody"]] = None, + **kwargs + ): + super(CloudErrorBody, self).__init__(**kwargs) + self.code = code + self.message = message + self.details = details + + +class CniConfig(msrest.serialization.Model): + """Cni configuration. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar type: Cni type. + :vartype type: str + :ivar version: Cni version. + :vartype version: str + :ivar pod_subnet: Pod Subnet. + :vartype pod_subnet: str + :ivar service_subnet: Service subnet. + :vartype service_subnet: str + """ + + _validation = { + 'type': {'readonly': True}, + 'version': {'readonly': True}, + 'pod_subnet': {'readonly': True}, + 'service_subnet': {'readonly': True}, + } + + _attribute_map = { + 'type': {'key': 'type', 'type': 'str'}, + 'version': {'key': 'version', 'type': 'str'}, + 'pod_subnet': {'key': 'podSubnet', 'type': 'str'}, + 'service_subnet': {'key': 'serviceSubnet', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(CniConfig, self).__init__(**kwargs) + self.type = None + self.version = None + self.pod_subnet = None + self.service_subnet = None + + +class ComputeResource(msrest.serialization.Model): + """Compute infrastructure Resource. + + All required parameters must be populated in order to send to Azure. + + :param processor_count: Required. Processor count. + :type processor_count: int + :param memory_in_gb: Required. Memory in GB. + :type memory_in_gb: long + """ + + _validation = { + 'processor_count': {'required': True}, + 'memory_in_gb': {'required': True}, + } + + _attribute_map = { + 'processor_count': {'key': 'processorCount', 'type': 'int'}, + 'memory_in_gb': {'key': 'memoryInGB', 'type': 'long'}, + } + + def __init__( + self, + *, + processor_count: int, + memory_in_gb: int, + **kwargs + ): + super(ComputeResource, self).__init__(**kwargs) + self.processor_count = processor_count + self.memory_in_gb = memory_in_gb + + +class ContactDetails(msrest.serialization.Model): + """Contains all the contact details of the customer. + + All required parameters must be populated in order to send to Azure. + + :param contact_person: Required. The contact person name. + :type contact_person: str + :param company_name: Required. The name of the company. + :type company_name: str + :param phone: Required. The phone number. + :type phone: str + :param email_list: Required. The email list. + :type email_list: list[str] + """ + + _validation = { + 'contact_person': {'required': True}, + 'company_name': {'required': True}, + 'phone': {'required': True}, + 'email_list': {'required': True}, + } + + _attribute_map = { + 'contact_person': {'key': 'contactPerson', 'type': 'str'}, + 'company_name': {'key': 'companyName', 'type': 'str'}, + 'phone': {'key': 'phone', 'type': 'str'}, + 'email_list': {'key': 'emailList', 'type': '[str]'}, + } + + def __init__( + self, + *, + contact_person: str, + company_name: str, + phone: str, + email_list: List[str], + **kwargs + ): + super(ContactDetails, self).__init__(**kwargs) + self.contact_person = contact_person + self.company_name = company_name + self.phone = phone + self.email_list = email_list + + +class Container(ARMBaseModel): + """Represents a container on the Data Box Edge/Gateway device. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: The path ID that uniquely identifies the object. + :vartype id: str + :ivar name: The object name. + :vartype name: str + :ivar type: The hierarchical type of the object. + :vartype type: str + :ivar system_data: Container in DataBoxEdge Resource. + :vartype system_data: ~azure.mgmt.databoxedge.v2020_12_01.models.SystemData + :ivar container_status: Current status of the container. Possible values include: "OK", + "Offline", "Unknown", "Updating", "NeedsAttention". + :vartype container_status: str or ~azure.mgmt.databoxedge.v2020_12_01.models.ContainerStatus + :param data_format: Required. DataFormat for Container. Possible values include: "BlockBlob", + "PageBlob", "AzureFile". + :type data_format: str or ~azure.mgmt.databoxedge.v2020_12_01.models.AzureContainerDataFormat + :ivar refresh_details: Details of the refresh job on this container. + :vartype refresh_details: ~azure.mgmt.databoxedge.v2020_12_01.models.RefreshDetails + :ivar created_date_time: The UTC time when container got created. + :vartype created_date_time: ~datetime.datetime + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'system_data': {'readonly': True}, + 'container_status': {'readonly': True}, + 'data_format': {'required': True}, + 'refresh_details': {'readonly': True}, + 'created_date_time': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'container_status': {'key': 'properties.containerStatus', 'type': 'str'}, + 'data_format': {'key': 'properties.dataFormat', 'type': 'str'}, + 'refresh_details': {'key': 'properties.refreshDetails', 'type': 'RefreshDetails'}, + 'created_date_time': {'key': 'properties.createdDateTime', 'type': 'iso-8601'}, + } + + def __init__( + self, + *, + data_format: Union[str, "AzureContainerDataFormat"], + **kwargs + ): + super(Container, self).__init__(**kwargs) + self.system_data = None + self.container_status = None + self.data_format = data_format + self.refresh_details = None + self.created_date_time = None + + +class ContainerList(msrest.serialization.Model): + """Collection of all the containers on the Data Box Edge/Gateway device. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar value: The list of containers. + :vartype value: list[~azure.mgmt.databoxedge.v2020_12_01.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: ~azure.mgmt.databoxedge.v2020_12_01.models.Sku + :param etag: The etag for the devices. + :type etag: str + :param identity: Msi identity of the resource. + :type identity: ~azure.mgmt.databoxedge.v2020_12_01.models.ResourceIdentity + :ivar kind: The etag for the devices. Possible values include: "AzureDataBoxGateway", + "AzureStackEdge", "AzureStackHub", "AzureModularDataCentre". + :vartype kind: str or ~azure.mgmt.databoxedge.v2020_12_01.models.DataBoxEdgeDeviceKind + :ivar system_data: DataBoxEdge Resource. + :vartype system_data: ~azure.mgmt.databoxedge.v2020_12_01.models.SystemData + :param data_box_edge_device_status: The status of the Data Box Edge/Gateway device. Possible + values include: "ReadyToSetup", "Online", "Offline", "NeedsAttention", "Disconnected", + "PartiallyDisconnected", "Maintenance". + :type data_box_edge_device_status: str or + ~azure.mgmt.databoxedge.v2020_12_01.models.DataBoxEdgeDeviceStatus + :ivar serial_number: The Serial Number of Data Box Edge/Gateway device. + :vartype serial_number: str + :ivar description: The Description of the Data Box Edge/Gateway device. + :vartype description: str + :ivar model_description: The description of the Data Box Edge/Gateway device model. + :vartype model_description: str + :ivar device_type: The type of the Data Box Edge/Gateway device. Possible values include: + "DataBoxEdgeDevice". + :vartype device_type: str or ~azure.mgmt.databoxedge.v2020_12_01.models.DeviceType + :ivar friendly_name: The Data Box Edge/Gateway device name. + :vartype friendly_name: str + :ivar culture: The Data Box Edge/Gateway device culture. + :vartype culture: str + :ivar device_model: The Data Box Edge/Gateway device model. + :vartype device_model: str + :ivar device_software_version: The Data Box Edge/Gateway device software version. + :vartype device_software_version: str + :ivar device_local_capacity: The Data Box Edge/Gateway device local capacity in MB. + :vartype device_local_capacity: long + :ivar time_zone: The Data Box Edge/Gateway device timezone. + :vartype time_zone: str + :ivar device_hcs_version: The device software version number of the device (eg: 1.2.18105.6). + :vartype device_hcs_version: str + :ivar configured_role_types: Type of compute roles configured. + :vartype configured_role_types: list[str or + ~azure.mgmt.databoxedge.v2020_12_01.models.RoleTypes] + :ivar node_count: The number of nodes in the cluster. + :vartype node_count: int + :ivar resource_move_details: The details of the move operation on this resource. + :vartype resource_move_details: ~azure.mgmt.databoxedge.v2020_12_01.models.ResourceMoveDetails + :ivar edge_profile: The details of Edge Profile for this resource. + :vartype edge_profile: ~azure.mgmt.databoxedge.v2020_12_01.models.EdgeProfile + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': True}, + 'kind': {'readonly': True}, + 'system_data': {'readonly': True}, + 'serial_number': {'readonly': True}, + 'description': {'readonly': True}, + 'model_description': {'readonly': True}, + 'device_type': {'readonly': True}, + 'friendly_name': {'readonly': True}, + 'culture': {'readonly': True}, + 'device_model': {'readonly': True}, + 'device_software_version': {'readonly': True}, + 'device_local_capacity': {'readonly': True}, + 'time_zone': {'readonly': True}, + 'device_hcs_version': {'readonly': True}, + 'configured_role_types': {'readonly': True}, + 'node_count': {'readonly': True}, + 'resource_move_details': {'readonly': True}, + 'edge_profile': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'sku': {'key': 'sku', 'type': 'Sku'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'identity': {'key': 'identity', 'type': 'ResourceIdentity'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'data_box_edge_device_status': {'key': 'properties.dataBoxEdgeDeviceStatus', 'type': 'str'}, + 'serial_number': {'key': 'properties.serialNumber', 'type': 'str'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + 'model_description': {'key': 'properties.modelDescription', 'type': 'str'}, + 'device_type': {'key': 'properties.deviceType', 'type': 'str'}, + 'friendly_name': {'key': 'properties.friendlyName', 'type': 'str'}, + 'culture': {'key': 'properties.culture', 'type': 'str'}, + 'device_model': {'key': 'properties.deviceModel', 'type': 'str'}, + 'device_software_version': {'key': 'properties.deviceSoftwareVersion', 'type': 'str'}, + 'device_local_capacity': {'key': 'properties.deviceLocalCapacity', 'type': 'long'}, + 'time_zone': {'key': 'properties.timeZone', 'type': 'str'}, + 'device_hcs_version': {'key': 'properties.deviceHcsVersion', 'type': 'str'}, + 'configured_role_types': {'key': 'properties.configuredRoleTypes', 'type': '[str]'}, + 'node_count': {'key': 'properties.nodeCount', 'type': 'int'}, + 'resource_move_details': {'key': 'properties.resourceMoveDetails', 'type': 'ResourceMoveDetails'}, + 'edge_profile': {'key': 'properties.edgeProfile', 'type': 'EdgeProfile'}, + } + + def __init__( + self, + *, + location: str, + tags: Optional[Dict[str, str]] = None, + sku: Optional["Sku"] = None, + etag: Optional[str] = None, + identity: Optional["ResourceIdentity"] = None, + data_box_edge_device_status: Optional[Union[str, "DataBoxEdgeDeviceStatus"]] = None, + **kwargs + ): + super(DataBoxEdgeDevice, self).__init__(**kwargs) + self.location = location + self.tags = tags + self.sku = sku + self.etag = etag + self.identity = identity + self.kind = None + self.system_data = None + self.data_box_edge_device_status = data_box_edge_device_status + self.serial_number = None + self.description = None + self.model_description = None + self.device_type = None + self.friendly_name = None + self.culture = None + self.device_model = None + self.device_software_version = None + self.device_local_capacity = None + self.time_zone = None + self.device_hcs_version = None + self.configured_role_types = None + self.node_count = None + self.resource_move_details = None + self.edge_profile = None + + +class DataBoxEdgeDeviceExtendedInfo(ARMBaseModel): + """The extended Info of the Data Box Edge/Gateway device. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: The path ID that uniquely identifies the object. + :vartype id: str + :ivar name: The object name. + :vartype name: str + :ivar type: The hierarchical type of the object. + :vartype type: str + :param encryption_key_thumbprint: The digital signature of encrypted certificate. + :type encryption_key_thumbprint: str + :param encryption_key: The public part of the encryption certificate. Client uses this to + encrypt any secret. + :type encryption_key: str + :ivar resource_key: The Resource ID of the Resource. + :vartype resource_key: str + :param client_secret_store_id: The Key Vault ARM Id for client secrets. + :type client_secret_store_id: str + :param client_secret_store_url: The url to access the Client Key Vault. + :type client_secret_store_url: str + :param channel_integrity_key_name: The name of Channel Integrity Key stored in the Client Key + Vault. + :type channel_integrity_key_name: str + :param channel_integrity_key_version: The version of Channel Integrity Key stored in the Client + Key Vault. + :type channel_integrity_key_version: str + :param key_vault_sync_status: Key vault sync status. Possible values include: "KeyVaultSynced", + "KeyVaultSyncFailed", "KeyVaultNotConfigured", "KeyVaultSyncPending", "KeyVaultSyncing". + :type key_vault_sync_status: str or + ~azure.mgmt.databoxedge.v2020_12_01.models.KeyVaultSyncStatus + :ivar device_secrets: Device secrets, will be returned only with ODataFilter + $expand=deviceSecrets. + :vartype device_secrets: ~azure.mgmt.databoxedge.v2020_12_01.models.DeviceSecrets + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'resource_key': {'readonly': True}, + 'device_secrets': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'encryption_key_thumbprint': {'key': 'properties.encryptionKeyThumbprint', 'type': 'str'}, + 'encryption_key': {'key': 'properties.encryptionKey', 'type': 'str'}, + 'resource_key': {'key': 'properties.resourceKey', 'type': 'str'}, + 'client_secret_store_id': {'key': 'properties.clientSecretStoreId', 'type': 'str'}, + 'client_secret_store_url': {'key': 'properties.clientSecretStoreUrl', 'type': 'str'}, + 'channel_integrity_key_name': {'key': 'properties.channelIntegrityKeyName', 'type': 'str'}, + 'channel_integrity_key_version': {'key': 'properties.channelIntegrityKeyVersion', 'type': 'str'}, + 'key_vault_sync_status': {'key': 'properties.keyVaultSyncStatus', 'type': 'str'}, + 'device_secrets': {'key': 'properties.deviceSecrets', 'type': 'DeviceSecrets'}, + } + + def __init__( + self, + *, + encryption_key_thumbprint: Optional[str] = None, + encryption_key: Optional[str] = None, + client_secret_store_id: Optional[str] = None, + client_secret_store_url: Optional[str] = None, + channel_integrity_key_name: Optional[str] = None, + channel_integrity_key_version: Optional[str] = None, + key_vault_sync_status: Optional[Union[str, "KeyVaultSyncStatus"]] = None, + **kwargs + ): + super(DataBoxEdgeDeviceExtendedInfo, self).__init__(**kwargs) + self.encryption_key_thumbprint = encryption_key_thumbprint + self.encryption_key = encryption_key + self.resource_key = None + self.client_secret_store_id = client_secret_store_id + self.client_secret_store_url = client_secret_store_url + self.channel_integrity_key_name = channel_integrity_key_name + self.channel_integrity_key_version = channel_integrity_key_version + self.key_vault_sync_status = key_vault_sync_status + self.device_secrets = None + + +class DataBoxEdgeDeviceExtendedInfoPatch(msrest.serialization.Model): + """The Data Box Edge/Gateway device extended info patch. + + :param client_secret_store_id: The Key Vault ARM Id for client secrets. + :type client_secret_store_id: str + :param client_secret_store_url: The url to access the Client Key Vault. + :type client_secret_store_url: str + :param channel_integrity_key_name: The name for Channel Integrity Key stored in the Client Key + Vault. + :type channel_integrity_key_name: str + :param channel_integrity_key_version: The version of Channel Integrity Key stored in the Client + Key Vault. + :type channel_integrity_key_version: str + :param sync_status: For changing or to initiate the resync to key-vault set the status to + KeyVaultSyncPending, rest of the status will not be applicable. Possible values include: + "KeyVaultSynced", "KeyVaultSyncFailed", "KeyVaultNotConfigured", "KeyVaultSyncPending", + "KeyVaultSyncing". + :type sync_status: str or ~azure.mgmt.databoxedge.v2020_12_01.models.KeyVaultSyncStatus + """ + + _attribute_map = { + 'client_secret_store_id': {'key': 'clientSecretStoreId', 'type': 'str'}, + 'client_secret_store_url': {'key': 'clientSecretStoreUrl', 'type': 'str'}, + 'channel_integrity_key_name': {'key': 'channelIntegrityKeyName', 'type': 'str'}, + 'channel_integrity_key_version': {'key': 'channelIntegrityKeyVersion', 'type': 'str'}, + 'sync_status': {'key': 'syncStatus', 'type': 'str'}, + } + + def __init__( + self, + *, + client_secret_store_id: Optional[str] = None, + client_secret_store_url: Optional[str] = None, + channel_integrity_key_name: Optional[str] = None, + channel_integrity_key_version: Optional[str] = None, + sync_status: Optional[Union[str, "KeyVaultSyncStatus"]] = None, + **kwargs + ): + super(DataBoxEdgeDeviceExtendedInfoPatch, self).__init__(**kwargs) + self.client_secret_store_id = client_secret_store_id + self.client_secret_store_url = client_secret_store_url + self.channel_integrity_key_name = channel_integrity_key_name + self.channel_integrity_key_version = channel_integrity_key_version + self.sync_status = sync_status + + +class DataBoxEdgeDeviceList(msrest.serialization.Model): + """The collection of Data Box Edge/Gateway devices. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar value: The list of Data Box Edge/Gateway devices. + :vartype value: list[~azure.mgmt.databoxedge.v2020_12_01.models.DataBoxEdgeDevice] + :ivar next_link: Link to the next set of results. + :vartype next_link: str + """ + + _validation = { + 'value': {'readonly': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[DataBoxEdgeDevice]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(DataBoxEdgeDeviceList, self).__init__(**kwargs) + self.value = None + self.next_link = None + + +class DataBoxEdgeDevicePatch(msrest.serialization.Model): + """The Data Box Edge/Gateway device patch. + + :param tags: A set of tags. The tags attached to the Data Box Edge/Gateway resource. + :type tags: dict[str, str] + :param identity: Msi identity of the resource. + :type identity: ~azure.mgmt.databoxedge.v2020_12_01.models.ResourceIdentity + :param edge_profile: Edge Profile property of the Data Box Edge/Gateway device. + :type edge_profile: ~azure.mgmt.databoxedge.v2020_12_01.models.EdgeProfilePatch + """ + + _attribute_map = { + 'tags': {'key': 'tags', 'type': '{str}'}, + 'identity': {'key': 'identity', 'type': 'ResourceIdentity'}, + 'edge_profile': {'key': 'properties.edgeProfile', 'type': 'EdgeProfilePatch'}, + } + + def __init__( + self, + *, + tags: Optional[Dict[str, str]] = None, + identity: Optional["ResourceIdentity"] = None, + edge_profile: Optional["EdgeProfilePatch"] = None, + **kwargs + ): + super(DataBoxEdgeDevicePatch, self).__init__(**kwargs) + self.tags = tags + self.identity = identity + self.edge_profile = edge_profile + + +class DataBoxEdgeMoveRequest(msrest.serialization.Model): + """Resource Move details. + + All required parameters must be populated in order to send to Azure. + + :param target_resource_group: Required. Target resource group ARMId. + :type target_resource_group: str + :param resources: Required. List of resources to be moved. + :type resources: list[str] + """ + + _validation = { + 'target_resource_group': {'required': True}, + 'resources': {'required': True}, + } + + _attribute_map = { + 'target_resource_group': {'key': 'targetResourceGroup', 'type': 'str'}, + 'resources': {'key': 'resources', 'type': '[str]'}, + } + + def __init__( + self, + *, + target_resource_group: str, + resources: List[str], + **kwargs + ): + super(DataBoxEdgeMoveRequest, self).__init__(**kwargs) + self.target_resource_group = target_resource_group + self.resources = resources + + +class DataBoxEdgeSku(msrest.serialization.Model): + """The Sku information. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar resource_type: The type of the resource. + :vartype resource_type: str + :ivar name: The Sku name. Possible values include: "Gateway", "Edge", "TEA_1Node", + "TEA_1Node_UPS", "TEA_1Node_Heater", "TEA_1Node_UPS_Heater", "TEA_4Node_Heater", + "TEA_4Node_UPS_Heater", "TMA", "TDC", "TCA_Small", "GPU", "TCA_Large", "EdgeP_Base", + "EdgeP_High", "EdgePR_Base", "EdgePR_Base_UPS", "EdgeMR_Mini", "RCA_Small", "RCA_Large", "RDC". + :vartype name: str or ~azure.mgmt.databoxedge.v2020_12_01.models.SkuName + :ivar kind: The Sku kind. + :vartype kind: str + :ivar tier: The Sku tier. Possible values include: "Standard". + :vartype tier: str or ~azure.mgmt.databoxedge.v2020_12_01.models.SkuTier + :ivar size: The Sku kind. + :vartype size: str + :ivar family: The Sku family. + :vartype family: str + :ivar locations: Availability of the Sku for the region. + :vartype locations: list[str] + :ivar api_versions: The API versions in which Sku is available. + :vartype api_versions: list[str] + :ivar location_info: Availability of the Sku for the location/zone/site. + :vartype location_info: list[~azure.mgmt.databoxedge.v2020_12_01.models.SkuLocationInfo] + :ivar costs: The pricing info of the Sku. + :vartype costs: list[~azure.mgmt.databoxedge.v2020_12_01.models.SkuCost] + :ivar signup_option: Sku can be signed up by customer or not. Possible values include: "None", + "Available". + :vartype signup_option: str or ~azure.mgmt.databoxedge.v2020_12_01.models.SkuSignupOption + :ivar version: Availability of the Sku as preview/stable. Possible values include: "Stable", + "Preview". + :vartype version: str or ~azure.mgmt.databoxedge.v2020_12_01.models.SkuVersion + :ivar availability: Links to the next set of results. Possible values include: "Available", + "Unavailable". + :vartype availability: str or ~azure.mgmt.databoxedge.v2020_12_01.models.SkuAvailability + :ivar shipment_types: List of Shipment Types supported by this SKU. + :vartype shipment_types: list[str or ~azure.mgmt.databoxedge.v2020_12_01.models.ShipmentType] + :ivar capabilities: The capability info of the SKU. + :vartype capabilities: list[~azure.mgmt.databoxedge.v2020_12_01.models.SkuCapability] + """ + + _validation = { + 'resource_type': {'readonly': True}, + 'name': {'readonly': True}, + 'kind': {'readonly': True}, + 'tier': {'readonly': True}, + 'size': {'readonly': True}, + 'family': {'readonly': True}, + 'locations': {'readonly': True}, + 'api_versions': {'readonly': True}, + 'location_info': {'readonly': True}, + 'costs': {'readonly': True}, + 'signup_option': {'readonly': True}, + 'version': {'readonly': True}, + 'availability': {'readonly': True}, + 'shipment_types': {'readonly': True}, + 'capabilities': {'readonly': True}, + } + + _attribute_map = { + 'resource_type': {'key': 'resourceType', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'tier': {'key': 'tier', 'type': 'str'}, + 'size': {'key': 'size', 'type': 'str'}, + 'family': {'key': 'family', 'type': 'str'}, + 'locations': {'key': 'locations', 'type': '[str]'}, + 'api_versions': {'key': 'apiVersions', 'type': '[str]'}, + 'location_info': {'key': 'locationInfo', 'type': '[SkuLocationInfo]'}, + 'costs': {'key': 'costs', 'type': '[SkuCost]'}, + 'signup_option': {'key': 'signupOption', 'type': 'str'}, + 'version': {'key': 'version', 'type': 'str'}, + 'availability': {'key': 'availability', 'type': 'str'}, + 'shipment_types': {'key': 'shipmentTypes', 'type': '[str]'}, + 'capabilities': {'key': 'capabilities', 'type': '[SkuCapability]'}, + } + + def __init__( + self, + **kwargs + ): + super(DataBoxEdgeSku, self).__init__(**kwargs) + self.resource_type = None + self.name = None + self.kind = None + self.tier = None + self.size = None + self.family = None + self.locations = None + self.api_versions = None + self.location_info = None + self.costs = None + self.signup_option = None + self.version = None + self.availability = None + self.shipment_types = None + self.capabilities = None + + +class DataBoxEdgeSkuList(msrest.serialization.Model): + """List of SKU Information objects. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar value: List of ResourceType Sku. + :vartype value: list[~azure.mgmt.databoxedge.v2020_12_01.models.DataBoxEdgeSku] + :ivar next_link: Links to the next set of results. + :vartype next_link: str + """ + + _validation = { + 'value': {'readonly': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[DataBoxEdgeSku]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(DataBoxEdgeSkuList, self).__init__(**kwargs) + self.value = None + self.next_link = None + + +class DCAccessCode(msrest.serialization.Model): + """DC Access code in the case of Self Managed Shipping. + + :param auth_code: DCAccess Code for the Self Managed shipment. + :type auth_code: str + """ + + _attribute_map = { + 'auth_code': {'key': 'properties.authCode', 'type': 'str'}, + } + + def __init__( + self, + *, + auth_code: Optional[str] = None, + **kwargs + ): + super(DCAccessCode, self).__init__(**kwargs) + self.auth_code = auth_code + + +class DeviceSecrets(msrest.serialization.Model): + """Device Secrets. + + :param hcs_data_volume_bit_locker_external_key: Keyvault Id of + HcsDataVolumeBitLockerExternalKey. + :type hcs_data_volume_bit_locker_external_key: + ~azure.mgmt.databoxedge.v2020_12_01.models.Secret + :param hcs_internal_volume_bit_locker_external_key: Keyvault Id of + HcsInternalVolumeBitLockerExternalKey. + :type hcs_internal_volume_bit_locker_external_key: + ~azure.mgmt.databoxedge.v2020_12_01.models.Secret + :param system_volume_bit_locker_recovery_key: Keyvault Id of SystemVolumeBitLockerRecoveryKey. + :type system_volume_bit_locker_recovery_key: ~azure.mgmt.databoxedge.v2020_12_01.models.Secret + :param sed_encryption_external_key_id: Keyvault Id of SEDEncryptionExternalKeyId. + :type sed_encryption_external_key_id: ~azure.mgmt.databoxedge.v2020_12_01.models.Secret + :param sed_encryption_external_key: Keyvault Id of SEDEncryptionExternalKey. + :type sed_encryption_external_key: ~azure.mgmt.databoxedge.v2020_12_01.models.Secret + :param bmc_default_user_password: Keyvault Id of BMCDefaultUserPassword. + :type bmc_default_user_password: ~azure.mgmt.databoxedge.v2020_12_01.models.Secret + :param rotate_key_for_data_volume_bitlocker: Keyvault Id of RotateKeyForDataVolumeBitlocker. + :type rotate_key_for_data_volume_bitlocker: ~azure.mgmt.databoxedge.v2020_12_01.models.Secret + :param rotate_keys_for_sed_drives_serialized: Keyvault Id of RotateKeysForSedDrivesSerialized. + :type rotate_keys_for_sed_drives_serialized: ~azure.mgmt.databoxedge.v2020_12_01.models.Secret + """ + + _attribute_map = { + 'hcs_data_volume_bit_locker_external_key': {'key': 'hcsDataVolumeBitLockerExternalKey', 'type': 'Secret'}, + 'hcs_internal_volume_bit_locker_external_key': {'key': 'hcsInternalVolumeBitLockerExternalKey', 'type': 'Secret'}, + 'system_volume_bit_locker_recovery_key': {'key': 'systemVolumeBitLockerRecoveryKey', 'type': 'Secret'}, + 'sed_encryption_external_key_id': {'key': 'sedEncryptionExternalKeyId', 'type': 'Secret'}, + 'sed_encryption_external_key': {'key': 'sedEncryptionExternalKey', 'type': 'Secret'}, + 'bmc_default_user_password': {'key': 'bmcDefaultUserPassword', 'type': 'Secret'}, + 'rotate_key_for_data_volume_bitlocker': {'key': 'rotateKeyForDataVolumeBitlocker', 'type': 'Secret'}, + 'rotate_keys_for_sed_drives_serialized': {'key': 'rotateKeysForSedDrivesSerialized', 'type': 'Secret'}, + } + + def __init__( + self, + *, + hcs_data_volume_bit_locker_external_key: Optional["Secret"] = None, + hcs_internal_volume_bit_locker_external_key: Optional["Secret"] = None, + system_volume_bit_locker_recovery_key: Optional["Secret"] = None, + sed_encryption_external_key_id: Optional["Secret"] = None, + sed_encryption_external_key: Optional["Secret"] = None, + bmc_default_user_password: Optional["Secret"] = None, + rotate_key_for_data_volume_bitlocker: Optional["Secret"] = None, + rotate_keys_for_sed_drives_serialized: Optional["Secret"] = None, + **kwargs + ): + super(DeviceSecrets, self).__init__(**kwargs) + self.hcs_data_volume_bit_locker_external_key = hcs_data_volume_bit_locker_external_key + self.hcs_internal_volume_bit_locker_external_key = hcs_internal_volume_bit_locker_external_key + self.system_volume_bit_locker_recovery_key = system_volume_bit_locker_recovery_key + self.sed_encryption_external_key_id = sed_encryption_external_key_id + self.sed_encryption_external_key = sed_encryption_external_key + self.bmc_default_user_password = bmc_default_user_password + self.rotate_key_for_data_volume_bitlocker = rotate_key_for_data_volume_bitlocker + self.rotate_keys_for_sed_drives_serialized = rotate_keys_for_sed_drives_serialized + + +class EdgeProfile(msrest.serialization.Model): + """Details about Edge Profile for the resource. + + :param subscription: Edge Profile Subscription. + :type subscription: ~azure.mgmt.databoxedge.v2020_12_01.models.EdgeProfileSubscription + """ + + _attribute_map = { + 'subscription': {'key': 'subscription', 'type': 'EdgeProfileSubscription'}, + } + + def __init__( + self, + *, + subscription: Optional["EdgeProfileSubscription"] = None, + **kwargs + ): + super(EdgeProfile, self).__init__(**kwargs) + self.subscription = subscription + + +class EdgeProfilePatch(msrest.serialization.Model): + """The Data Box Edge/Gateway Edge Profile patch. + + :param subscription: The Data Box Edge/Gateway Edge Profile Subscription patch. + :type subscription: ~azure.mgmt.databoxedge.v2020_12_01.models.EdgeProfileSubscriptionPatch + """ + + _attribute_map = { + 'subscription': {'key': 'subscription', 'type': 'EdgeProfileSubscriptionPatch'}, + } + + def __init__( + self, + *, + subscription: Optional["EdgeProfileSubscriptionPatch"] = None, + **kwargs + ): + super(EdgeProfilePatch, self).__init__(**kwargs) + self.subscription = subscription + + +class EdgeProfileSubscription(msrest.serialization.Model): + """Subscription details for the Edge Profile. + + :param registration_id: Edge Subscription Registration ID. + :type registration_id: str + :param id: ARM ID of the subscription. + :type id: str + :param state: Possible values include: "Registered", "Warned", "Suspended", "Deleted", + "Unregistered". + :type state: str or ~azure.mgmt.databoxedge.v2020_12_01.models.SubscriptionState + :param registration_date: + :type registration_date: str + :param subscription_id: + :type subscription_id: str + :param tenant_id: + :type tenant_id: str + :param location_placement_id: + :type location_placement_id: str + :param quota_id: + :type quota_id: str + :param serialized_details: + :type serialized_details: str + :param registered_features: + :type registered_features: + list[~azure.mgmt.databoxedge.v2020_12_01.models.SubscriptionRegisteredFeatures] + """ + + _attribute_map = { + 'registration_id': {'key': 'registrationId', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + 'state': {'key': 'state', 'type': 'str'}, + 'registration_date': {'key': 'registrationDate', 'type': 'str'}, + 'subscription_id': {'key': 'subscriptionId', 'type': 'str'}, + 'tenant_id': {'key': 'properties.tenantId', 'type': 'str'}, + 'location_placement_id': {'key': 'properties.locationPlacementId', 'type': 'str'}, + 'quota_id': {'key': 'properties.quotaId', 'type': 'str'}, + 'serialized_details': {'key': 'properties.serializedDetails', 'type': 'str'}, + 'registered_features': {'key': 'properties.registeredFeatures', 'type': '[SubscriptionRegisteredFeatures]'}, + } + + def __init__( + self, + *, + registration_id: Optional[str] = None, + id: Optional[str] = None, + state: Optional[Union[str, "SubscriptionState"]] = None, + registration_date: Optional[str] = None, + subscription_id: Optional[str] = None, + tenant_id: Optional[str] = None, + location_placement_id: Optional[str] = None, + quota_id: Optional[str] = None, + serialized_details: Optional[str] = None, + registered_features: Optional[List["SubscriptionRegisteredFeatures"]] = None, + **kwargs + ): + super(EdgeProfileSubscription, self).__init__(**kwargs) + self.registration_id = registration_id + self.id = id + self.state = state + self.registration_date = registration_date + self.subscription_id = subscription_id + self.tenant_id = tenant_id + self.location_placement_id = location_placement_id + self.quota_id = quota_id + self.serialized_details = serialized_details + self.registered_features = registered_features + + +class EdgeProfileSubscriptionPatch(msrest.serialization.Model): + """The Data Box Edge/Gateway Edge Profile Subscription patch. + + :param id: The path ID that uniquely identifies the subscription of the edge profile. + :type id: str + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + } + + def __init__( + self, + *, + id: Optional[str] = None, + **kwargs + ): + super(EdgeProfileSubscriptionPatch, self).__init__(**kwargs) + self.id = id + + +class EtcdInfo(msrest.serialization.Model): + """Etcd configuration. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar type: Etcd type. + :vartype type: str + :ivar version: Etcd version. + :vartype version: str + """ + + _validation = { + 'type': {'readonly': True}, + 'version': {'readonly': True}, + } + + _attribute_map = { + 'type': {'key': 'type', 'type': 'str'}, + 'version': {'key': 'version', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(EtcdInfo, self).__init__(**kwargs) + self.type = None + self.version = None + + +class Trigger(ARMBaseModel): + """Trigger details. + + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: FileEventTrigger, PeriodicTimerEventTrigger. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: The path ID that uniquely identifies the object. + :vartype id: str + :ivar name: The object name. + :vartype name: str + :ivar type: The hierarchical type of the object. + :vartype type: str + :ivar system_data: Trigger in DataBoxEdge Resource. + :vartype system_data: ~azure.mgmt.databoxedge.v2020_12_01.models.SystemData + :param kind: Required. Trigger Kind.Constant filled by server. Possible values include: + "FileEvent", "PeriodicTimerEvent". + :type kind: str or ~azure.mgmt.databoxedge.v2020_12_01.models.TriggerEventType + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'system_data': {'readonly': True}, + 'kind': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'kind': {'key': 'kind', 'type': 'str'}, + } + + _subtype_map = { + 'kind': {'FileEvent': 'FileEventTrigger', 'PeriodicTimerEvent': 'PeriodicTimerEventTrigger'} + } + + def __init__( + self, + **kwargs + ): + super(Trigger, self).__init__(**kwargs) + self.system_data = None + self.kind = 'Trigger' # type: str + + +class FileEventTrigger(Trigger): + """Trigger details. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: The path ID that uniquely identifies the object. + :vartype id: str + :ivar name: The object name. + :vartype name: str + :ivar type: The hierarchical type of the object. + :vartype type: str + :ivar system_data: Trigger in DataBoxEdge Resource. + :vartype system_data: ~azure.mgmt.databoxedge.v2020_12_01.models.SystemData + :param kind: Required. Trigger Kind.Constant filled by server. Possible values include: + "FileEvent", "PeriodicTimerEvent". + :type kind: str or ~azure.mgmt.databoxedge.v2020_12_01.models.TriggerEventType + :param source_info: Required. File event source details. + :type source_info: ~azure.mgmt.databoxedge.v2020_12_01.models.FileSourceInfo + :param sink_info: Required. Role sink info. + :type sink_info: ~azure.mgmt.databoxedge.v2020_12_01.models.RoleSinkInfo + :param custom_context_tag: A custom context tag typically used to correlate the trigger against + its usage. For example, if a periodic timer trigger is intended for certain specific IoT + modules in the device, the tag can be the name or the image URL of the module. + :type custom_context_tag: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'system_data': {'readonly': True}, + 'kind': {'required': True}, + 'source_info': {'required': True}, + 'sink_info': {'required': True}, + 'custom_context_tag': {'max_length': 192, 'min_length': 0}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'source_info': {'key': 'properties.sourceInfo', 'type': 'FileSourceInfo'}, + 'sink_info': {'key': 'properties.sinkInfo', 'type': 'RoleSinkInfo'}, + 'custom_context_tag': {'key': 'properties.customContextTag', 'type': 'str'}, + } + + def __init__( + self, + *, + source_info: "FileSourceInfo", + sink_info: "RoleSinkInfo", + custom_context_tag: Optional[str] = None, + **kwargs + ): + super(FileEventTrigger, self).__init__(**kwargs) + self.kind = 'FileEvent' # type: str + self.source_info = source_info + self.sink_info = sink_info + self.custom_context_tag = custom_context_tag + + +class FileSourceInfo(msrest.serialization.Model): + """File source details. + + All required parameters must be populated in order to send to Azure. + + :param share_id: Required. File share ID. + :type share_id: str + """ + + _validation = { + 'share_id': {'required': True}, + } + + _attribute_map = { + 'share_id': {'key': 'shareId', 'type': 'str'}, + } + + def __init__( + self, + *, + share_id: str, + **kwargs + ): + super(FileSourceInfo, self).__init__(**kwargs) + self.share_id = share_id + + +class GenerateCertResponse(msrest.serialization.Model): + """Used in activation key generation flow. + + :param public_key: Gets or sets base64 encoded certificate raw data, + this is the public part needed to be uploaded to cert vault. + :type public_key: str + :param private_key: Gets or sets base64 encoded private part of the certificate, + needed to form the activation key. + :type private_key: str + :param expiry_time_in_utc: Gets or sets expiry time in UTC. + :type expiry_time_in_utc: str + """ + + _attribute_map = { + 'public_key': {'key': 'publicKey', 'type': 'str'}, + 'private_key': {'key': 'privateKey', 'type': 'str'}, + 'expiry_time_in_utc': {'key': 'expiryTimeInUTC', 'type': 'str'}, + } + + def __init__( + self, + *, + public_key: Optional[str] = None, + private_key: Optional[str] = None, + expiry_time_in_utc: Optional[str] = None, + **kwargs + ): + super(GenerateCertResponse, self).__init__(**kwargs) + self.public_key = public_key + self.private_key = private_key + self.expiry_time_in_utc = expiry_time_in_utc + + +class ImageRepositoryCredential(msrest.serialization.Model): + """Image repository credential. + + All required parameters must be populated in order to send to Azure. + + :param image_repository_url: Required. Image repository url (e.g.: mcr.microsoft.com). + :type image_repository_url: str + :param user_name: Required. Repository user name. + :type user_name: str + :param password: Repository user password. + :type password: ~azure.mgmt.databoxedge.v2020_12_01.models.AsymmetricEncryptedSecret + """ + + _validation = { + 'image_repository_url': {'required': True}, + 'user_name': {'required': True}, + } + + _attribute_map = { + 'image_repository_url': {'key': 'imageRepositoryUrl', 'type': 'str'}, + 'user_name': {'key': 'userName', 'type': 'str'}, + 'password': {'key': 'password', 'type': 'AsymmetricEncryptedSecret'}, + } + + def __init__( + self, + *, + image_repository_url: str, + user_name: str, + password: Optional["AsymmetricEncryptedSecret"] = None, + **kwargs + ): + super(ImageRepositoryCredential, self).__init__(**kwargs) + self.image_repository_url = image_repository_url + self.user_name = user_name + self.password = password + + +class IoTAddon(Addon): + """IoT Addon. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: The path ID that uniquely identifies the object. + :vartype id: str + :ivar name: The object name. + :vartype name: str + :ivar type: The hierarchical type of the object. + :vartype type: str + :param kind: Required. Addon type.Constant filled by server. Possible values include: + "IotEdge", "ArcForKubernetes". + :type kind: str or ~azure.mgmt.databoxedge.v2020_12_01.models.AddonType + :ivar system_data: Addon type. + :vartype system_data: ~azure.mgmt.databoxedge.v2020_12_01.models.SystemData + :param io_t_device_details: Required. IoT device metadata to which appliance needs to be + connected. + :type io_t_device_details: ~azure.mgmt.databoxedge.v2020_12_01.models.IoTDeviceInfo + :param io_t_edge_device_details: Required. IoT edge device to which the IoT Addon needs to be + configured. + :type io_t_edge_device_details: ~azure.mgmt.databoxedge.v2020_12_01.models.IoTDeviceInfo + :ivar version: Version of IoT running on the appliance. + :vartype version: str + :ivar host_platform: Host OS supported by the IoT addon. Possible values include: "Windows", + "Linux". + :vartype host_platform: str or ~azure.mgmt.databoxedge.v2020_12_01.models.PlatformType + :ivar host_platform_type: Platform where the runtime is hosted. Possible values include: + "KubernetesCluster", "LinuxVM". + :vartype host_platform_type: str or ~azure.mgmt.databoxedge.v2020_12_01.models.HostPlatformType + :ivar provisioning_state: Addon Provisioning State. Possible values include: "Invalid", + "Creating", "Created", "Updating", "Reconfiguring", "Failed", "Deleting". + :vartype provisioning_state: str or ~azure.mgmt.databoxedge.v2020_12_01.models.AddonState + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'kind': {'required': True}, + 'system_data': {'readonly': True}, + 'io_t_device_details': {'required': True}, + 'io_t_edge_device_details': {'required': True}, + 'version': {'readonly': True}, + 'host_platform': {'readonly': True}, + 'host_platform_type': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'io_t_device_details': {'key': 'properties.ioTDeviceDetails', 'type': 'IoTDeviceInfo'}, + 'io_t_edge_device_details': {'key': 'properties.ioTEdgeDeviceDetails', 'type': 'IoTDeviceInfo'}, + 'version': {'key': 'properties.version', 'type': 'str'}, + 'host_platform': {'key': 'properties.hostPlatform', 'type': 'str'}, + 'host_platform_type': {'key': 'properties.hostPlatformType', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + } + + def __init__( + self, + *, + io_t_device_details: "IoTDeviceInfo", + io_t_edge_device_details: "IoTDeviceInfo", + **kwargs + ): + super(IoTAddon, self).__init__(**kwargs) + self.kind = 'IotEdge' # type: str + self.io_t_device_details = io_t_device_details + self.io_t_edge_device_details = io_t_edge_device_details + self.version = None + self.host_platform = None + self.host_platform_type = None + self.provisioning_state = None + + +class IoTDeviceInfo(msrest.serialization.Model): + """Metadata of IoT device/IoT Edge device to be configured. + + All required parameters must be populated in order to send to Azure. + + :param device_id: Required. ID of the IoT device/edge device. + :type device_id: str + :param io_t_host_hub: Required. Host name for the IoT hub associated to the device. + :type io_t_host_hub: str + :param io_t_host_hub_id: Id for the IoT hub associated to the device. + :type io_t_host_hub_id: str + :param authentication: Encrypted IoT device/IoT edge device connection string. + :type authentication: ~azure.mgmt.databoxedge.v2020_12_01.models.Authentication + """ + + _validation = { + 'device_id': {'required': True}, + 'io_t_host_hub': {'required': True}, + } + + _attribute_map = { + 'device_id': {'key': 'deviceId', 'type': 'str'}, + 'io_t_host_hub': {'key': 'ioTHostHub', 'type': 'str'}, + 'io_t_host_hub_id': {'key': 'ioTHostHubId', 'type': 'str'}, + 'authentication': {'key': 'authentication', 'type': 'Authentication'}, + } + + def __init__( + self, + *, + device_id: str, + io_t_host_hub: str, + io_t_host_hub_id: Optional[str] = None, + authentication: Optional["Authentication"] = None, + **kwargs + ): + super(IoTDeviceInfo, self).__init__(**kwargs) + self.device_id = device_id + self.io_t_host_hub = io_t_host_hub + self.io_t_host_hub_id = io_t_host_hub_id + self.authentication = authentication + + +class IoTEdgeAgentInfo(msrest.serialization.Model): + """IoT edge agent details is optional, this will be used for download system Agent module while bootstrapping IoT Role if specified. + + All required parameters must be populated in order to send to Azure. + + :param image_name: Required. Name of the IoT edge agent image. + :type image_name: str + :param tag: Required. Image Tag. + :type tag: str + :param image_repository: Image repository details. + :type image_repository: ~azure.mgmt.databoxedge.v2020_12_01.models.ImageRepositoryCredential + """ + + _validation = { + 'image_name': {'required': True}, + 'tag': {'required': True}, + } + + _attribute_map = { + 'image_name': {'key': 'imageName', 'type': 'str'}, + 'tag': {'key': 'tag', 'type': 'str'}, + 'image_repository': {'key': 'imageRepository', 'type': 'ImageRepositoryCredential'}, + } + + def __init__( + self, + *, + image_name: str, + tag: str, + image_repository: Optional["ImageRepositoryCredential"] = None, + **kwargs + ): + super(IoTEdgeAgentInfo, self).__init__(**kwargs) + self.image_name = image_name + self.tag = tag + self.image_repository = image_repository + + +class IoTRole(Role): + """Compute role. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: The path ID that uniquely identifies the object. + :vartype id: str + :ivar name: The object name. + :vartype name: str + :ivar type: The hierarchical type of the object. + :vartype type: str + :param kind: Required. Role type.Constant filled by server. Possible values include: "IOT", + "ASA", "Functions", "Cognitive", "MEC", "CloudEdgeManagement", "Kubernetes". + :type kind: str or ~azure.mgmt.databoxedge.v2020_12_01.models.RoleTypes + :ivar system_data: Role configured on ASE resource. + :vartype system_data: ~azure.mgmt.databoxedge.v2020_12_01.models.SystemData + :param host_platform: Host OS supported by the IoT role. Possible values include: "Windows", + "Linux". + :type host_platform: str or ~azure.mgmt.databoxedge.v2020_12_01.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: ~azure.mgmt.databoxedge.v2020_12_01.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: ~azure.mgmt.databoxedge.v2020_12_01.models.IoTDeviceInfo + :param share_mappings: Mount points of shares in role(s). + :type share_mappings: list[~azure.mgmt.databoxedge.v2020_12_01.models.MountPointMap] + :param io_t_edge_agent_info: Iot edge agent details to download the agent and bootstrap iot + runtime. + :type io_t_edge_agent_info: ~azure.mgmt.databoxedge.v2020_12_01.models.IoTEdgeAgentInfo + :ivar host_platform_type: Platform where the Iot runtime is hosted. Possible values include: + "KubernetesCluster", "LinuxVM". + :vartype host_platform_type: str or ~azure.mgmt.databoxedge.v2020_12_01.models.HostPlatformType + :param compute_resource: Resource allocation. + :type compute_resource: ~azure.mgmt.databoxedge.v2020_12_01.models.ComputeResource + :param role_status: Role status. Possible values include: "Enabled", "Disabled". + :type role_status: str or ~azure.mgmt.databoxedge.v2020_12_01.models.RoleStatus + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'kind': {'required': True}, + 'system_data': {'readonly': True}, + 'host_platform_type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'host_platform': {'key': 'properties.hostPlatform', 'type': 'str'}, + 'io_t_device_details': {'key': 'properties.ioTDeviceDetails', 'type': 'IoTDeviceInfo'}, + 'io_t_edge_device_details': {'key': 'properties.ioTEdgeDeviceDetails', 'type': 'IoTDeviceInfo'}, + 'share_mappings': {'key': 'properties.shareMappings', 'type': '[MountPointMap]'}, + 'io_t_edge_agent_info': {'key': 'properties.ioTEdgeAgentInfo', 'type': 'IoTEdgeAgentInfo'}, + 'host_platform_type': {'key': 'properties.hostPlatformType', 'type': 'str'}, + 'compute_resource': {'key': 'properties.computeResource', 'type': 'ComputeResource'}, + 'role_status': {'key': 'properties.roleStatus', 'type': 'str'}, + } + + def __init__( + self, + *, + host_platform: Optional[Union[str, "PlatformType"]] = None, + io_t_device_details: Optional["IoTDeviceInfo"] = None, + io_t_edge_device_details: Optional["IoTDeviceInfo"] = None, + share_mappings: Optional[List["MountPointMap"]] = None, + io_t_edge_agent_info: Optional["IoTEdgeAgentInfo"] = None, + compute_resource: Optional["ComputeResource"] = None, + role_status: Optional[Union[str, "RoleStatus"]] = None, + **kwargs + ): + super(IoTRole, self).__init__(**kwargs) + self.kind = 'IOT' # type: str + self.host_platform = host_platform + self.io_t_device_details = io_t_device_details + self.io_t_edge_device_details = io_t_edge_device_details + self.share_mappings = share_mappings + self.io_t_edge_agent_info = io_t_edge_agent_info + self.host_platform_type = None + self.compute_resource = compute_resource + self.role_status = role_status + + +class Ipv4Config(msrest.serialization.Model): + """Details related to the IPv4 address configuration. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar ip_address: The IPv4 address of the network adapter. + :vartype ip_address: str + :ivar subnet: The IPv4 subnet of the network adapter. + :vartype subnet: str + :ivar gateway: The IPv4 gateway of the network adapter. + :vartype gateway: str + """ + + _validation = { + 'ip_address': {'readonly': True}, + 'subnet': {'readonly': True}, + 'gateway': {'readonly': True}, + } + + _attribute_map = { + 'ip_address': {'key': 'ipAddress', 'type': 'str'}, + 'subnet': {'key': 'subnet', 'type': 'str'}, + 'gateway': {'key': 'gateway', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(Ipv4Config, self).__init__(**kwargs) + self.ip_address = None + self.subnet = None + self.gateway = None + + +class Ipv6Config(msrest.serialization.Model): + """Details related to the IPv6 address configuration. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar ip_address: The IPv6 address of the network adapter. + :vartype ip_address: str + :ivar prefix_length: The IPv6 prefix of the network adapter. + :vartype prefix_length: int + :ivar gateway: The IPv6 gateway of the network adapter. + :vartype gateway: str + """ + + _validation = { + 'ip_address': {'readonly': True}, + 'prefix_length': {'readonly': True}, + 'gateway': {'readonly': True}, + } + + _attribute_map = { + 'ip_address': {'key': 'ipAddress', 'type': 'str'}, + 'prefix_length': {'key': 'prefixLength', 'type': 'int'}, + 'gateway': {'key': 'gateway', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(Ipv6Config, self).__init__(**kwargs) + self.ip_address = None + self.prefix_length = None + self.gateway = None + + +class Job(msrest.serialization.Model): + """A device job. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: The path ID that uniquely identifies the object. + :vartype id: str + :ivar name: The name of the object. + :vartype name: str + :ivar type: The hierarchical type of the object. + :vartype type: str + :ivar status: The current status of the job. Possible values include: "Invalid", "Running", + "Succeeded", "Failed", "Canceled", "Paused", "Scheduled". + :vartype status: str or ~azure.mgmt.databoxedge.v2020_12_01.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: ~azure.mgmt.databoxedge.v2020_12_01.models.JobErrorDetails + :ivar job_type: The type of the job. Possible values include: "Invalid", "ScanForUpdates", + "DownloadUpdates", "InstallUpdates", "RefreshShare", "RefreshContainer", "Backup", "Restore", + "TriggerSupportPackage". + :vartype job_type: str or ~azure.mgmt.databoxedge.v2020_12_01.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 ~azure.mgmt.databoxedge.v2020_12_01.models.UpdateOperationStage + :ivar download_progress: The download progress. + :vartype download_progress: ~azure.mgmt.databoxedge.v2020_12_01.models.UpdateDownloadProgress + :ivar install_progress: The install progress. + :vartype install_progress: ~azure.mgmt.databoxedge.v2020_12_01.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[~azure.mgmt.databoxedge.v2020_12_01.models.JobErrorItem] + :ivar code: The code intended for programmatic access. + :vartype code: str + :ivar message: The message that describes the error in detail. + :vartype message: str + """ + + _validation = { + 'error_details': {'readonly': True}, + 'code': {'readonly': True}, + 'message': {'readonly': True}, + } + + _attribute_map = { + 'error_details': {'key': 'errorDetails', 'type': '[JobErrorItem]'}, + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(JobErrorDetails, self).__init__(**kwargs) + self.error_details = None + self.code = None + self.message = None + + +class JobErrorItem(msrest.serialization.Model): + """The job error items. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar recommendations: The recommended actions. + :vartype recommendations: list[str] + :ivar code: The code intended for programmatic access. + :vartype code: str + :ivar message: The message that describes the error in detail. + :vartype message: str + """ + + _validation = { + 'recommendations': {'readonly': True}, + 'code': {'readonly': True}, + 'message': {'readonly': True}, + } + + _attribute_map = { + 'recommendations': {'key': 'recommendations', 'type': '[str]'}, + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(JobErrorItem, self).__init__(**kwargs) + self.recommendations = None + self.code = None + self.message = None + + +class KubernetesClusterInfo(msrest.serialization.Model): + """Kubernetes cluster configuration. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar etcd_info: Etcd configuration. + :vartype etcd_info: ~azure.mgmt.databoxedge.v2020_12_01.models.EtcdInfo + :ivar nodes: Kubernetes cluster nodes. + :vartype nodes: list[~azure.mgmt.databoxedge.v2020_12_01.models.NodeInfo] + :param version: Required. Kubernetes cluster version. + :type version: str + """ + + _validation = { + 'etcd_info': {'readonly': True}, + 'nodes': {'readonly': True}, + 'version': {'required': True}, + } + + _attribute_map = { + 'etcd_info': {'key': 'etcdInfo', 'type': 'EtcdInfo'}, + 'nodes': {'key': 'nodes', 'type': '[NodeInfo]'}, + 'version': {'key': 'version', 'type': 'str'}, + } + + def __init__( + self, + *, + version: str, + **kwargs + ): + super(KubernetesClusterInfo, self).__init__(**kwargs) + self.etcd_info = None + self.nodes = None + self.version = version + + +class KubernetesIPConfiguration(msrest.serialization.Model): + """Kubernetes node IP configuration. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar port: Port of the Kubernetes node. + :vartype port: str + :param ip_address: IP address of the Kubernetes node. + :type ip_address: str + """ + + _validation = { + 'port': {'readonly': True}, + } + + _attribute_map = { + 'port': {'key': 'port', 'type': 'str'}, + 'ip_address': {'key': 'ipAddress', 'type': 'str'}, + } + + def __init__( + self, + *, + ip_address: Optional[str] = None, + **kwargs + ): + super(KubernetesIPConfiguration, self).__init__(**kwargs) + self.port = None + self.ip_address = ip_address + + +class KubernetesRole(Role): + """Kubernetes role. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: The path ID that uniquely identifies the object. + :vartype id: str + :ivar name: The object name. + :vartype name: str + :ivar type: The hierarchical type of the object. + :vartype type: str + :param kind: Required. Role type.Constant filled by server. Possible values include: "IOT", + "ASA", "Functions", "Cognitive", "MEC", "CloudEdgeManagement", "Kubernetes". + :type kind: str or ~azure.mgmt.databoxedge.v2020_12_01.models.RoleTypes + :ivar system_data: Role configured on ASE resource. + :vartype system_data: ~azure.mgmt.databoxedge.v2020_12_01.models.SystemData + :param host_platform: Host OS supported by the Kubernetes role. Possible values include: + "Windows", "Linux". + :type host_platform: str or ~azure.mgmt.databoxedge.v2020_12_01.models.PlatformType + :ivar provisioning_state: State of Kubernetes deployment. Possible values include: "Invalid", + "Creating", "Created", "Updating", "Reconfiguring", "Failed", "Deleting". + :vartype provisioning_state: str or ~azure.mgmt.databoxedge.v2020_12_01.models.KubernetesState + :ivar host_platform_type: Platform where the runtime is hosted. Possible values include: + "KubernetesCluster", "LinuxVM". + :vartype host_platform_type: str or ~azure.mgmt.databoxedge.v2020_12_01.models.HostPlatformType + :param kubernetes_cluster_info: Kubernetes cluster configuration. + :type kubernetes_cluster_info: ~azure.mgmt.databoxedge.v2020_12_01.models.KubernetesClusterInfo + :param kubernetes_role_resources: Kubernetes role resources. + :type kubernetes_role_resources: + ~azure.mgmt.databoxedge.v2020_12_01.models.KubernetesRoleResources + :param role_status: Role status. Possible values include: "Enabled", "Disabled". + :type role_status: str or ~azure.mgmt.databoxedge.v2020_12_01.models.RoleStatus + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'kind': {'required': True}, + 'system_data': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + 'host_platform_type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'host_platform': {'key': 'properties.hostPlatform', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'host_platform_type': {'key': 'properties.hostPlatformType', 'type': 'str'}, + 'kubernetes_cluster_info': {'key': 'properties.kubernetesClusterInfo', 'type': 'KubernetesClusterInfo'}, + 'kubernetes_role_resources': {'key': 'properties.kubernetesRoleResources', 'type': 'KubernetesRoleResources'}, + 'role_status': {'key': 'properties.roleStatus', 'type': 'str'}, + } + + def __init__( + self, + *, + host_platform: Optional[Union[str, "PlatformType"]] = None, + kubernetes_cluster_info: Optional["KubernetesClusterInfo"] = None, + kubernetes_role_resources: Optional["KubernetesRoleResources"] = None, + role_status: Optional[Union[str, "RoleStatus"]] = None, + **kwargs + ): + super(KubernetesRole, self).__init__(**kwargs) + self.kind = 'Kubernetes' # type: str + self.host_platform = host_platform + self.provisioning_state = None + self.host_platform_type = None + self.kubernetes_cluster_info = kubernetes_cluster_info + self.kubernetes_role_resources = kubernetes_role_resources + self.role_status = role_status + + +class KubernetesRoleCompute(msrest.serialization.Model): + """Kubernetes role compute resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :param vm_profile: Required. VM profile. + :type vm_profile: str + :ivar memory_in_bytes: Memory in bytes. + :vartype memory_in_bytes: long + :ivar processor_count: Processor count. + :vartype processor_count: int + """ + + _validation = { + 'vm_profile': {'required': True}, + 'memory_in_bytes': {'readonly': True}, + 'processor_count': {'readonly': True}, + } + + _attribute_map = { + 'vm_profile': {'key': 'vmProfile', 'type': 'str'}, + 'memory_in_bytes': {'key': 'memoryInBytes', 'type': 'long'}, + 'processor_count': {'key': 'processorCount', 'type': 'int'}, + } + + def __init__( + self, + *, + vm_profile: str, + **kwargs + ): + super(KubernetesRoleCompute, self).__init__(**kwargs) + self.vm_profile = vm_profile + self.memory_in_bytes = None + self.processor_count = None + + +class KubernetesRoleNetwork(msrest.serialization.Model): + """Kubernetes role network resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar cni_config: Cni configuration. + :vartype cni_config: ~azure.mgmt.databoxedge.v2020_12_01.models.CniConfig + :ivar load_balancer_config: Load balancer configuration. + :vartype load_balancer_config: ~azure.mgmt.databoxedge.v2020_12_01.models.LoadBalancerConfig + """ + + _validation = { + 'cni_config': {'readonly': True}, + 'load_balancer_config': {'readonly': True}, + } + + _attribute_map = { + 'cni_config': {'key': 'cniConfig', 'type': 'CniConfig'}, + 'load_balancer_config': {'key': 'loadBalancerConfig', 'type': 'LoadBalancerConfig'}, + } + + def __init__( + self, + **kwargs + ): + super(KubernetesRoleNetwork, self).__init__(**kwargs) + self.cni_config = None + self.load_balancer_config = None + + +class KubernetesRoleResources(msrest.serialization.Model): + """Kubernetes role resources. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :param storage: Kubernetes role storage resource. + :type storage: ~azure.mgmt.databoxedge.v2020_12_01.models.KubernetesRoleStorage + :param compute: Required. Kubernetes role compute resource. + :type compute: ~azure.mgmt.databoxedge.v2020_12_01.models.KubernetesRoleCompute + :ivar network: Kubernetes role network resource. + :vartype network: ~azure.mgmt.databoxedge.v2020_12_01.models.KubernetesRoleNetwork + """ + + _validation = { + 'compute': {'required': True}, + 'network': {'readonly': True}, + } + + _attribute_map = { + 'storage': {'key': 'storage', 'type': 'KubernetesRoleStorage'}, + 'compute': {'key': 'compute', 'type': 'KubernetesRoleCompute'}, + 'network': {'key': 'network', 'type': 'KubernetesRoleNetwork'}, + } + + def __init__( + self, + *, + compute: "KubernetesRoleCompute", + storage: Optional["KubernetesRoleStorage"] = None, + **kwargs + ): + super(KubernetesRoleResources, self).__init__(**kwargs) + self.storage = storage + self.compute = compute + self.network = None + + +class KubernetesRoleStorage(msrest.serialization.Model): + """Kubernetes role storage resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar storage_classes: Kubernetes storage class info. + :vartype storage_classes: + list[~azure.mgmt.databoxedge.v2020_12_01.models.KubernetesRoleStorageClassInfo] + :param endpoints: Mount points of shares in role(s). + :type endpoints: list[~azure.mgmt.databoxedge.v2020_12_01.models.MountPointMap] + """ + + _validation = { + 'storage_classes': {'readonly': True}, + } + + _attribute_map = { + 'storage_classes': {'key': 'storageClasses', 'type': '[KubernetesRoleStorageClassInfo]'}, + 'endpoints': {'key': 'endpoints', 'type': '[MountPointMap]'}, + } + + def __init__( + self, + *, + endpoints: Optional[List["MountPointMap"]] = None, + **kwargs + ): + super(KubernetesRoleStorage, self).__init__(**kwargs) + self.storage_classes = None + self.endpoints = endpoints + + +class KubernetesRoleStorageClassInfo(msrest.serialization.Model): + """Kubernetes storage class info. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar name: Storage class name. + :vartype name: str + :ivar type: Storage class type. + :vartype type: str + :ivar posix_compliant: If provisioned storage is posix compliant. Possible values include: + "Invalid", "Enabled", "Disabled". + :vartype posix_compliant: str or + ~azure.mgmt.databoxedge.v2020_12_01.models.PosixComplianceStatus + """ + + _validation = { + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'posix_compliant': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'posix_compliant': {'key': 'posixCompliant', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(KubernetesRoleStorageClassInfo, self).__init__(**kwargs) + self.name = None + self.type = None + self.posix_compliant = None + + +class LoadBalancerConfig(msrest.serialization.Model): + """Load balancer configuration. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar type: Load balancer type. + :vartype type: str + :ivar version: Load balancer version. + :vartype version: str + """ + + _validation = { + 'type': {'readonly': True}, + 'version': {'readonly': True}, + } + + _attribute_map = { + 'type': {'key': 'type', 'type': 'str'}, + 'version': {'key': 'version', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(LoadBalancerConfig, self).__init__(**kwargs) + self.type = None + self.version = None + + +class MECRole(Role): + """MEC role. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: The path ID that uniquely identifies the object. + :vartype id: str + :ivar name: The object name. + :vartype name: str + :ivar type: The hierarchical type of the object. + :vartype type: str + :param kind: Required. Role type.Constant filled by server. Possible values include: "IOT", + "ASA", "Functions", "Cognitive", "MEC", "CloudEdgeManagement", "Kubernetes". + :type kind: str or ~azure.mgmt.databoxedge.v2020_12_01.models.RoleTypes + :ivar system_data: Role configured on ASE resource. + :vartype system_data: ~azure.mgmt.databoxedge.v2020_12_01.models.SystemData + :param connection_string: Activation key of the MEC. + :type connection_string: ~azure.mgmt.databoxedge.v2020_12_01.models.AsymmetricEncryptedSecret + :param role_status: Role status. Possible values include: "Enabled", "Disabled". + :type role_status: str or ~azure.mgmt.databoxedge.v2020_12_01.models.RoleStatus + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'kind': {'required': True}, + 'system_data': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'connection_string': {'key': 'properties.connectionString', 'type': 'AsymmetricEncryptedSecret'}, + 'role_status': {'key': 'properties.roleStatus', 'type': 'str'}, + } + + def __init__( + self, + *, + connection_string: Optional["AsymmetricEncryptedSecret"] = None, + role_status: Optional[Union[str, "RoleStatus"]] = None, + **kwargs + ): + super(MECRole, self).__init__(**kwargs) + self.kind = 'MEC' # type: str + self.connection_string = connection_string + self.role_status = role_status + + +class MetricConfiguration(msrest.serialization.Model): + """Metric configuration. + + All required parameters must be populated in order to send to Azure. + + :param resource_id: Required. The Resource ID on which the metrics should be pushed. + :type resource_id: str + :param mdm_account: The MDM account to which the counters should be pushed. + :type mdm_account: str + :param metric_name_space: The MDM namespace to which the counters should be pushed. This is + required if MDMAccount is specified. + :type metric_name_space: str + :param counter_sets: Required. Host name for the IoT hub associated to the device. + :type counter_sets: list[~azure.mgmt.databoxedge.v2020_12_01.models.MetricCounterSet] + """ + + _validation = { + 'resource_id': {'required': True}, + 'counter_sets': {'required': True}, + } + + _attribute_map = { + 'resource_id': {'key': 'resourceId', 'type': 'str'}, + 'mdm_account': {'key': 'mdmAccount', 'type': 'str'}, + 'metric_name_space': {'key': 'metricNameSpace', 'type': 'str'}, + 'counter_sets': {'key': 'counterSets', 'type': '[MetricCounterSet]'}, + } + + def __init__( + self, + *, + resource_id: str, + counter_sets: List["MetricCounterSet"], + mdm_account: Optional[str] = None, + metric_name_space: Optional[str] = None, + **kwargs + ): + super(MetricConfiguration, self).__init__(**kwargs) + self.resource_id = resource_id + self.mdm_account = mdm_account + self.metric_name_space = metric_name_space + self.counter_sets = counter_sets + + +class MetricCounter(msrest.serialization.Model): + """The metric counter. + + All required parameters must be populated in order to send to Azure. + + :param name: Required. The counter name. + :type name: str + :param instance: The instance from which counter should be collected. + :type instance: str + :param dimension_filter: The dimension filter. + :type dimension_filter: list[~azure.mgmt.databoxedge.v2020_12_01.models.MetricDimension] + :param additional_dimensions: The additional dimensions to be added to metric. + :type additional_dimensions: list[~azure.mgmt.databoxedge.v2020_12_01.models.MetricDimension] + """ + + _validation = { + 'name': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'instance': {'key': 'instance', 'type': 'str'}, + 'dimension_filter': {'key': 'dimensionFilter', 'type': '[MetricDimension]'}, + 'additional_dimensions': {'key': 'additionalDimensions', 'type': '[MetricDimension]'}, + } + + def __init__( + self, + *, + name: str, + instance: Optional[str] = None, + dimension_filter: Optional[List["MetricDimension"]] = None, + additional_dimensions: Optional[List["MetricDimension"]] = None, + **kwargs + ): + super(MetricCounter, self).__init__(**kwargs) + self.name = name + self.instance = instance + self.dimension_filter = dimension_filter + self.additional_dimensions = additional_dimensions + + +class MetricCounterSet(msrest.serialization.Model): + """The metric counter set. + + All required parameters must be populated in order to send to Azure. + + :param counters: Required. The counters that should be collected in this set. + :type counters: list[~azure.mgmt.databoxedge.v2020_12_01.models.MetricCounter] + """ + + _validation = { + 'counters': {'required': True}, + } + + _attribute_map = { + 'counters': {'key': 'counters', 'type': '[MetricCounter]'}, + } + + def __init__( + self, + *, + counters: List["MetricCounter"], + **kwargs + ): + super(MetricCounterSet, self).__init__(**kwargs) + self.counters = counters + + +class MetricDimension(msrest.serialization.Model): + """The metric dimension. + + All required parameters must be populated in order to send to Azure. + + :param source_type: Required. The dimension type. + :type source_type: str + :param source_name: Required. The dimension value. + :type source_name: str + """ + + _validation = { + 'source_type': {'required': True}, + 'source_name': {'required': True}, + } + + _attribute_map = { + 'source_type': {'key': 'sourceType', 'type': 'str'}, + 'source_name': {'key': 'sourceName', 'type': 'str'}, + } + + def __init__( + self, + *, + source_type: str, + source_name: str, + **kwargs + ): + super(MetricDimension, self).__init__(**kwargs) + self.source_type = source_type + self.source_name = source_name + + +class MetricDimensionV1(msrest.serialization.Model): + """Metric Dimension v1. + + :param name: Name of the metrics dimension. + :type name: str + :param display_name: Display name of the metrics dimension. + :type display_name: str + :param to_be_exported_for_shoebox: To be exported to shoe box. + :type to_be_exported_for_shoebox: bool + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'display_name': {'key': 'displayName', 'type': 'str'}, + 'to_be_exported_for_shoebox': {'key': 'toBeExportedForShoebox', 'type': 'bool'}, + } + + def __init__( + self, + *, + name: Optional[str] = None, + display_name: Optional[str] = None, + to_be_exported_for_shoebox: Optional[bool] = None, + **kwargs + ): + super(MetricDimensionV1, self).__init__(**kwargs) + self.name = name + self.display_name = display_name + self.to_be_exported_for_shoebox = to_be_exported_for_shoebox + + +class MetricSpecificationV1(msrest.serialization.Model): + """Metric specification version 1. + + :param name: Name of the metric. + :type name: str + :param display_name: Display name of the metric. + :type display_name: str + :param display_description: Description of the metric to be displayed. + :type display_description: str + :param unit: Metric units. Possible values include: "NotSpecified", "Percent", "Count", + "Seconds", "Milliseconds", "Bytes", "BytesPerSecond", "CountPerSecond". + :type unit: str or ~azure.mgmt.databoxedge.v2020_12_01.models.MetricUnit + :param aggregation_type: Metric aggregation type. Possible values include: "NotSpecified", + "None", "Average", "Minimum", "Maximum", "Total", "Count". + :type aggregation_type: str or ~azure.mgmt.databoxedge.v2020_12_01.models.MetricAggregationType + :param dimensions: Metric dimensions, other than default dimension which is resource. + :type dimensions: list[~azure.mgmt.databoxedge.v2020_12_01.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 ~azure.mgmt.databoxedge.v2020_12_01.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 + ~azure.mgmt.databoxedge.v2020_12_01.models.TimeGrain] + :param supported_aggregation_types: Support metric aggregation type. + :type supported_aggregation_types: list[str or + ~azure.mgmt.databoxedge.v2020_12_01.models.MetricAggregationType] + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'display_name': {'key': 'displayName', 'type': 'str'}, + 'display_description': {'key': 'displayDescription', 'type': 'str'}, + 'unit': {'key': 'unit', 'type': 'str'}, + 'aggregation_type': {'key': 'aggregationType', 'type': 'str'}, + 'dimensions': {'key': 'dimensions', 'type': '[MetricDimensionV1]'}, + 'fill_gap_with_zero': {'key': 'fillGapWithZero', 'type': 'bool'}, + 'category': {'key': 'category', 'type': 'str'}, + 'resource_id_dimension_name_override': {'key': 'resourceIdDimensionNameOverride', 'type': 'str'}, + 'supported_time_grain_types': {'key': 'supportedTimeGrainTypes', 'type': '[str]'}, + 'supported_aggregation_types': {'key': 'supportedAggregationTypes', 'type': '[str]'}, + } + + def __init__( + self, + *, + name: Optional[str] = None, + display_name: Optional[str] = None, + display_description: Optional[str] = None, + unit: Optional[Union[str, "MetricUnit"]] = None, + aggregation_type: Optional[Union[str, "MetricAggregationType"]] = None, + dimensions: Optional[List["MetricDimensionV1"]] = None, + fill_gap_with_zero: Optional[bool] = None, + category: Optional[Union[str, "MetricCategory"]] = None, + resource_id_dimension_name_override: Optional[str] = None, + supported_time_grain_types: Optional[List[Union[str, "TimeGrain"]]] = None, + supported_aggregation_types: Optional[List[Union[str, "MetricAggregationType"]]] = None, + **kwargs + ): + super(MetricSpecificationV1, self).__init__(**kwargs) + self.name = name + self.display_name = display_name + self.display_description = display_description + self.unit = unit + self.aggregation_type = aggregation_type + self.dimensions = dimensions + self.fill_gap_with_zero = fill_gap_with_zero + self.category = category + self.resource_id_dimension_name_override = resource_id_dimension_name_override + self.supported_time_grain_types = supported_time_grain_types + self.supported_aggregation_types = supported_aggregation_types + + +class MonitoringMetricConfiguration(ARMBaseModel): + """The metric setting details for the role. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: The path ID that uniquely identifies the object. + :vartype id: str + :ivar name: The object name. + :vartype name: str + :ivar type: The hierarchical type of the object. + :vartype type: str + :param metric_configurations: Required. The metrics configuration details. + :type metric_configurations: + list[~azure.mgmt.databoxedge.v2020_12_01.models.MetricConfiguration] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'metric_configurations': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'metric_configurations': {'key': 'properties.metricConfigurations', 'type': '[MetricConfiguration]'}, + } + + def __init__( + self, + *, + metric_configurations: List["MetricConfiguration"], + **kwargs + ): + super(MonitoringMetricConfiguration, self).__init__(**kwargs) + self.metric_configurations = metric_configurations + + +class MonitoringMetricConfigurationList(msrest.serialization.Model): + """Collection of metric configurations. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar value: The list of metric configurations. + :vartype value: list[~azure.mgmt.databoxedge.v2020_12_01.models.MonitoringMetricConfiguration] + :ivar next_link: Link to the next set of results. + :vartype next_link: str + """ + + _validation = { + 'value': {'readonly': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[MonitoringMetricConfiguration]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(MonitoringMetricConfigurationList, self).__init__(**kwargs) + self.value = None + self.next_link = None + + +class MountPointMap(msrest.serialization.Model): + """The share mount point. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :param share_id: Required. ID of the share mounted to the role VM. + :type share_id: str + :ivar role_id: ID of the role to which share is mounted. + :vartype role_id: str + :ivar mount_point: Mount point for the share. + :vartype mount_point: str + :ivar mount_type: Mounting type. Possible values include: "Volume", "HostPath". + :vartype mount_type: str or ~azure.mgmt.databoxedge.v2020_12_01.models.MountType + :ivar role_type: Role type. Possible values include: "IOT", "ASA", "Functions", "Cognitive", + "MEC", "CloudEdgeManagement", "Kubernetes". + :vartype role_type: str or ~azure.mgmt.databoxedge.v2020_12_01.models.RoleTypes + """ + + _validation = { + 'share_id': {'required': True}, + 'role_id': {'readonly': True}, + 'mount_point': {'readonly': True}, + 'mount_type': {'readonly': True}, + 'role_type': {'readonly': True}, + } + + _attribute_map = { + 'share_id': {'key': 'shareId', 'type': 'str'}, + 'role_id': {'key': 'roleId', 'type': 'str'}, + 'mount_point': {'key': 'mountPoint', 'type': 'str'}, + 'mount_type': {'key': 'mountType', 'type': 'str'}, + 'role_type': {'key': 'roleType', 'type': 'str'}, + } + + def __init__( + self, + *, + share_id: str, + **kwargs + ): + super(MountPointMap, self).__init__(**kwargs) + self.share_id = share_id + self.role_id = None + self.mount_point = None + self.mount_type = None + self.role_type = None + + +class NetworkAdapter(msrest.serialization.Model): + """Represents the networkAdapter on a device. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar adapter_id: Instance ID of network adapter. + :vartype adapter_id: str + :ivar adapter_position: Hardware position of network adapter. + :vartype adapter_position: ~azure.mgmt.databoxedge.v2020_12_01.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 ~azure.mgmt.databoxedge.v2020_12_01.models.NetworkAdapterStatus + :param rdma_status: Value indicating whether this adapter is RDMA capable. Possible values + include: "Incapable", "Capable". + :type rdma_status: str or ~azure.mgmt.databoxedge.v2020_12_01.models.NetworkAdapterRDMAStatus + :param dhcp_status: Value indicating whether this adapter has DHCP enabled. Possible values + include: "Disabled", "Enabled". + :type dhcp_status: str or ~azure.mgmt.databoxedge.v2020_12_01.models.NetworkAdapterDHCPStatus + :ivar ipv4_configuration: The IPv4 configuration of the network adapter. + :vartype ipv4_configuration: ~azure.mgmt.databoxedge.v2020_12_01.models.Ipv4Config + :ivar ipv6_configuration: The IPv6 configuration of the network adapter. + :vartype ipv6_configuration: ~azure.mgmt.databoxedge.v2020_12_01.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 ~azure.mgmt.databoxedge.v2020_12_01.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[~azure.mgmt.databoxedge.v2020_12_01.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 ~azure.mgmt.databoxedge.v2020_12_01.models.NodeStatus + :ivar node_chassis_serial_number: Serial number of the Chassis. + :vartype node_chassis_serial_number: str + :ivar node_serial_number: Serial number of the individual node. + :vartype node_serial_number: str + :ivar node_display_name: Display Name of the individual node. + :vartype node_display_name: str + :ivar node_friendly_software_version: Friendly software version name that is currently + installed on the node. + :vartype node_friendly_software_version: str + :ivar node_hcs_version: HCS version that is currently installed on the node. + :vartype node_hcs_version: str + :ivar node_instance_id: Guid instance id of the node. + :vartype node_instance_id: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'node_status': {'readonly': True}, + 'node_chassis_serial_number': {'readonly': True}, + 'node_serial_number': {'readonly': True}, + 'node_display_name': {'readonly': True}, + 'node_friendly_software_version': {'readonly': True}, + 'node_hcs_version': {'readonly': True}, + 'node_instance_id': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'node_status': {'key': 'properties.nodeStatus', 'type': 'str'}, + 'node_chassis_serial_number': {'key': 'properties.nodeChassisSerialNumber', 'type': 'str'}, + 'node_serial_number': {'key': 'properties.nodeSerialNumber', 'type': 'str'}, + 'node_display_name': {'key': 'properties.nodeDisplayName', 'type': 'str'}, + 'node_friendly_software_version': {'key': 'properties.nodeFriendlySoftwareVersion', 'type': 'str'}, + 'node_hcs_version': {'key': 'properties.nodeHcsVersion', 'type': 'str'}, + 'node_instance_id': {'key': 'properties.nodeInstanceId', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(Node, self).__init__(**kwargs) + self.node_status = None + self.node_chassis_serial_number = None + self.node_serial_number = None + self.node_display_name = None + self.node_friendly_software_version = None + self.node_hcs_version = None + self.node_instance_id = None + + +class NodeInfo(msrest.serialization.Model): + """Kubernetes node info. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar name: Node name. + :vartype name: str + :ivar type: Node type - Master/Worker. Possible values include: "Invalid", "Master", "Worker". + :vartype type: str or ~azure.mgmt.databoxedge.v2020_12_01.models.KubernetesNodeType + :param ip_configuration: IP Configuration of the Kubernetes node. + :type ip_configuration: + list[~azure.mgmt.databoxedge.v2020_12_01.models.KubernetesIPConfiguration] + """ + + _validation = { + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'ip_configuration': {'key': 'ipConfiguration', 'type': '[KubernetesIPConfiguration]'}, + } + + def __init__( + self, + *, + ip_configuration: Optional[List["KubernetesIPConfiguration"]] = None, + **kwargs + ): + super(NodeInfo, self).__init__(**kwargs) + self.name = None + self.type = None + self.ip_configuration = ip_configuration + + +class NodeList(msrest.serialization.Model): + """Collection of Nodes. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar value: The list of Nodes. + :vartype value: list[~azure.mgmt.databoxedge.v2020_12_01.models.Node] + :param next_link: Link to the next set of results. + :type next_link: str + """ + + _validation = { + 'value': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[Node]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + next_link: Optional[str] = None, + **kwargs + ): + super(NodeList, self).__init__(**kwargs) + self.value = None + self.next_link = next_link + + +class Operation(msrest.serialization.Model): + """Operations. + + :param name: Name of the operation. + :type name: str + :param is_data_action: Is data action. + :type is_data_action: bool + :param display: Properties displayed for the operation. + :type display: ~azure.mgmt.databoxedge.v2020_12_01.models.OperationDisplay + :param origin: Origin of the operation. + :type origin: str + :param service_specification: Service specification. + :type service_specification: ~azure.mgmt.databoxedge.v2020_12_01.models.ServiceSpecification + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'is_data_action': {'key': 'isDataAction', 'type': 'bool'}, + 'display': {'key': 'display', 'type': 'OperationDisplay'}, + 'origin': {'key': 'origin', 'type': 'str'}, + 'service_specification': {'key': 'properties.serviceSpecification', 'type': 'ServiceSpecification'}, + } + + def __init__( + self, + *, + name: Optional[str] = None, + is_data_action: Optional[bool] = None, + display: Optional["OperationDisplay"] = None, + origin: Optional[str] = None, + service_specification: Optional["ServiceSpecification"] = None, + **kwargs + ): + super(Operation, self).__init__(**kwargs) + self.name = name + self.is_data_action = is_data_action + self.display = display + self.origin = origin + self.service_specification = service_specification + + +class OperationDisplay(msrest.serialization.Model): + """Operation display properties. + + :param provider: Provider name. + :type provider: str + :param resource: The type of resource in which the operation is performed. + :type resource: str + :param operation: Operation to be performed on the resource. + :type operation: str + :param description: Description of the operation to be performed. + :type description: str + """ + + _attribute_map = { + 'provider': {'key': 'provider', 'type': 'str'}, + 'resource': {'key': 'resource', 'type': 'str'}, + 'operation': {'key': 'operation', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + } + + def __init__( + self, + *, + provider: Optional[str] = None, + resource: Optional[str] = None, + operation: Optional[str] = None, + description: Optional[str] = None, + **kwargs + ): + super(OperationDisplay, self).__init__(**kwargs) + self.provider = provider + self.resource = resource + self.operation = operation + self.description = description + + +class OperationsList(msrest.serialization.Model): + """The list of operations used for the discovery of available provider operations. + + All required parameters must be populated in order to send to Azure. + + :param value: Required. The value. + :type value: list[~azure.mgmt.databoxedge.v2020_12_01.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: ~azure.mgmt.databoxedge.v2020_12_01.models.ContactDetails + :param shipping_address: The shipping address. + :type shipping_address: ~azure.mgmt.databoxedge.v2020_12_01.models.Address + :ivar current_status: Current status of the order. + :vartype current_status: ~azure.mgmt.databoxedge.v2020_12_01.models.OrderStatus + :ivar order_history: List of status changes in the order. + :vartype order_history: list[~azure.mgmt.databoxedge.v2020_12_01.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[~azure.mgmt.databoxedge.v2020_12_01.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[~azure.mgmt.databoxedge.v2020_12_01.models.TrackingInfo] + :param shipment_type: ShipmentType of the order. Possible values include: "NotApplicable", + "ShippedToCustomer", "SelfPickup". + :type shipment_type: str or ~azure.mgmt.databoxedge.v2020_12_01.models.ShipmentType + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'current_status': {'readonly': True}, + 'order_history': {'readonly': True}, + 'serial_number': {'readonly': True}, + 'delivery_tracking_info': {'readonly': True}, + 'return_tracking_info': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'contact_information': {'key': 'properties.contactInformation', 'type': 'ContactDetails'}, + 'shipping_address': {'key': 'properties.shippingAddress', 'type': 'Address'}, + 'current_status': {'key': 'properties.currentStatus', 'type': 'OrderStatus'}, + 'order_history': {'key': 'properties.orderHistory', 'type': '[OrderStatus]'}, + 'serial_number': {'key': 'properties.serialNumber', 'type': 'str'}, + 'delivery_tracking_info': {'key': 'properties.deliveryTrackingInfo', 'type': '[TrackingInfo]'}, + 'return_tracking_info': {'key': 'properties.returnTrackingInfo', 'type': '[TrackingInfo]'}, + 'shipment_type': {'key': 'properties.shipmentType', 'type': 'str'}, + } + + def __init__( + self, + *, + contact_information: Optional["ContactDetails"] = None, + shipping_address: Optional["Address"] = None, + shipment_type: Optional[Union[str, "ShipmentType"]] = None, + **kwargs + ): + super(Order, self).__init__(**kwargs) + self.contact_information = contact_information + self.shipping_address = shipping_address + self.current_status = None + self.order_history = None + self.serial_number = None + self.delivery_tracking_info = None + self.return_tracking_info = None + self.shipment_type = shipment_type + + +class OrderList(msrest.serialization.Model): + """List of order entities. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar value: The list of orders. + :vartype value: list[~azure.mgmt.databoxedge.v2020_12_01.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", + "AwaitingPickup", "PickupCompleted", "AwaitingDrop". + :type status: str or ~azure.mgmt.databoxedge.v2020_12_01.models.OrderState + :ivar update_date_time: Time of status update. + :vartype update_date_time: ~datetime.datetime + :param comments: Comments related to this status change. + :type comments: str + :ivar tracking_information: Tracking information related to the state in the ordering flow. + :vartype tracking_information: ~azure.mgmt.databoxedge.v2020_12_01.models.TrackingInfo + :ivar additional_order_details: Dictionary to hold generic information which is not stored + by the already existing properties. + :vartype additional_order_details: dict[str, str] + """ + + _validation = { + 'status': {'required': True}, + 'update_date_time': {'readonly': True}, + 'tracking_information': {'readonly': True}, + 'additional_order_details': {'readonly': True}, + } + + _attribute_map = { + 'status': {'key': 'status', 'type': 'str'}, + 'update_date_time': {'key': 'updateDateTime', 'type': 'iso-8601'}, + 'comments': {'key': 'comments', 'type': 'str'}, + 'tracking_information': {'key': 'trackingInformation', 'type': 'TrackingInfo'}, + 'additional_order_details': {'key': 'additionalOrderDetails', 'type': '{str}'}, + } + + def __init__( + self, + *, + status: Union[str, "OrderState"], + comments: Optional[str] = None, + **kwargs + ): + super(OrderStatus, self).__init__(**kwargs) + self.status = status + self.update_date_time = None + self.comments = comments + self.tracking_information = None + self.additional_order_details = None + + +class PeriodicTimerEventTrigger(Trigger): + """Trigger details. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: The path ID that uniquely identifies the object. + :vartype id: str + :ivar name: The object name. + :vartype name: str + :ivar type: The hierarchical type of the object. + :vartype type: str + :ivar system_data: Trigger in DataBoxEdge Resource. + :vartype system_data: ~azure.mgmt.databoxedge.v2020_12_01.models.SystemData + :param kind: Required. Trigger Kind.Constant filled by server. Possible values include: + "FileEvent", "PeriodicTimerEvent". + :type kind: str or ~azure.mgmt.databoxedge.v2020_12_01.models.TriggerEventType + :param source_info: Required. Periodic timer details. + :type source_info: ~azure.mgmt.databoxedge.v2020_12_01.models.PeriodicTimerSourceInfo + :param sink_info: Required. Role Sink information. + :type sink_info: ~azure.mgmt.databoxedge.v2020_12_01.models.RoleSinkInfo + :param custom_context_tag: A custom context tag typically used to correlate the trigger against + its usage. For example, if a periodic timer trigger is intended for certain specific IoT + modules in the device, the tag can be the name or the image URL of the module. + :type custom_context_tag: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'system_data': {'readonly': True}, + 'kind': {'required': True}, + 'source_info': {'required': True}, + 'sink_info': {'required': True}, + 'custom_context_tag': {'max_length': 192, 'min_length': 0}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'source_info': {'key': 'properties.sourceInfo', 'type': 'PeriodicTimerSourceInfo'}, + 'sink_info': {'key': 'properties.sinkInfo', 'type': 'RoleSinkInfo'}, + 'custom_context_tag': {'key': 'properties.customContextTag', 'type': 'str'}, + } + + def __init__( + self, + *, + source_info: "PeriodicTimerSourceInfo", + sink_info: "RoleSinkInfo", + custom_context_tag: Optional[str] = None, + **kwargs + ): + super(PeriodicTimerEventTrigger, self).__init__(**kwargs) + self.kind = 'PeriodicTimerEvent' # type: str + self.source_info = source_info + self.sink_info = sink_info + self.custom_context_tag = custom_context_tag + + +class PeriodicTimerSourceInfo(msrest.serialization.Model): + """Periodic timer event source. + + All required parameters must be populated in order to send to Azure. + + :param start_time: Required. The time of the day that results in a valid trigger. Schedule is + computed with reference to the time specified upto seconds. If timezone is not specified the + time will considered to be in device timezone. The value will always be returned as UTC time. + :type start_time: ~datetime.datetime + :param schedule: Required. Periodic frequency at which timer event needs to be raised. Supports + daily, hourly, minutes, and seconds. + :type schedule: str + :param topic: Topic where periodic events are published to IoT device. + :type topic: str + """ + + _validation = { + 'start_time': {'required': True}, + 'schedule': {'required': True}, + } + + _attribute_map = { + 'start_time': {'key': 'startTime', 'type': 'iso-8601'}, + 'schedule': {'key': 'schedule', 'type': 'str'}, + 'topic': {'key': 'topic', 'type': 'str'}, + } + + def __init__( + self, + *, + start_time: datetime.datetime, + schedule: str, + topic: Optional[str] = None, + **kwargs + ): + super(PeriodicTimerSourceInfo, self).__init__(**kwargs) + self.start_time = start_time + self.schedule = schedule + self.topic = topic + + +class RefreshDetails(msrest.serialization.Model): + """Fields for tracking refresh job on the share or container. + + :param in_progress_refresh_job_id: If a refresh job is currently in progress on this share or + container, this field indicates the ARM resource ID of that job. The field is empty if no job + is in progress. + :type in_progress_refresh_job_id: str + :param last_completed_refresh_job_time_in_utc: Indicates the completed time for the last + refresh job on this particular share or container, if any.This could be a failed job or a + successful job. + :type last_completed_refresh_job_time_in_utc: ~datetime.datetime + :param error_manifest_file: Indicates the relative path of the error xml for the last refresh + job on this particular share or container, if any. This could be a failed job or a successful + job. + :type error_manifest_file: str + :param last_job: Indicates the id of the last refresh job on this particular share or + container,if any. This could be a failed job or a successful job. + :type last_job: str + """ + + _attribute_map = { + 'in_progress_refresh_job_id': {'key': 'inProgressRefreshJobId', 'type': 'str'}, + 'last_completed_refresh_job_time_in_utc': {'key': 'lastCompletedRefreshJobTimeInUTC', 'type': 'iso-8601'}, + 'error_manifest_file': {'key': 'errorManifestFile', 'type': 'str'}, + 'last_job': {'key': 'lastJob', 'type': 'str'}, + } + + def __init__( + self, + *, + in_progress_refresh_job_id: Optional[str] = None, + last_completed_refresh_job_time_in_utc: Optional[datetime.datetime] = None, + error_manifest_file: Optional[str] = None, + last_job: Optional[str] = None, + **kwargs + ): + super(RefreshDetails, self).__init__(**kwargs) + self.in_progress_refresh_job_id = in_progress_refresh_job_id + self.last_completed_refresh_job_time_in_utc = last_completed_refresh_job_time_in_utc + self.error_manifest_file = error_manifest_file + self.last_job = last_job + + +class ResourceIdentity(msrest.serialization.Model): + """Msi identity details of the resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param type: Identity type. Possible values include: "None", "SystemAssigned", "UserAssigned". + :type type: str or ~azure.mgmt.databoxedge.v2020_12_01.models.MsiIdentityType + :ivar principal_id: Service Principal Id backing the Msi. + :vartype principal_id: str + :ivar tenant_id: Home Tenant Id. + :vartype tenant_id: str + """ + + _validation = { + 'principal_id': {'readonly': True}, + 'tenant_id': {'readonly': True}, + } + + _attribute_map = { + 'type': {'key': 'type', 'type': 'str'}, + 'principal_id': {'key': 'principalId', 'type': 'str'}, + 'tenant_id': {'key': 'tenantId', 'type': 'str'}, + } + + def __init__( + self, + *, + type: Optional[Union[str, "MsiIdentityType"]] = None, + **kwargs + ): + super(ResourceIdentity, self).__init__(**kwargs) + self.type = type + self.principal_id = None + self.tenant_id = None + + +class ResourceMoveDetails(msrest.serialization.Model): + """Fields for tracking resource move. + + :param operation_in_progress: Denotes whether move operation is in progress. Possible values + include: "None", "ResourceMoveInProgress", "ResourceMoveFailed". + :type operation_in_progress: str or + ~azure.mgmt.databoxedge.v2020_12_01.models.ResourceMoveStatus + :param operation_in_progress_lock_timeout_in_utc: Denotes the timeout of the operation to + finish. + :type operation_in_progress_lock_timeout_in_utc: ~datetime.datetime + """ + + _attribute_map = { + 'operation_in_progress': {'key': 'operationInProgress', 'type': 'str'}, + 'operation_in_progress_lock_timeout_in_utc': {'key': 'operationInProgressLockTimeoutInUTC', 'type': 'iso-8601'}, + } + + def __init__( + self, + *, + operation_in_progress: Optional[Union[str, "ResourceMoveStatus"]] = None, + operation_in_progress_lock_timeout_in_utc: Optional[datetime.datetime] = None, + **kwargs + ): + super(ResourceMoveDetails, self).__init__(**kwargs) + self.operation_in_progress = operation_in_progress + self.operation_in_progress_lock_timeout_in_utc = operation_in_progress_lock_timeout_in_utc + + +class ResourceTypeSku(msrest.serialization.Model): + """Resource type Sku object. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar resource_type: The resource type. + :vartype resource_type: str + :ivar skus: The skus. + :vartype skus: list[~azure.mgmt.databoxedge.v2020_12_01.models.SkuInformation] + """ + + _validation = { + 'resource_type': {'readonly': True}, + 'skus': {'readonly': True}, + } + + _attribute_map = { + 'resource_type': {'key': 'resourceType', 'type': 'str'}, + 'skus': {'key': 'skus', 'type': '[SkuInformation]'}, + } + + def __init__( + self, + **kwargs + ): + super(ResourceTypeSku, self).__init__(**kwargs) + self.resource_type = None + self.skus = None + + +class RoleList(msrest.serialization.Model): + """Collection of all the roles on the Data Box Edge device. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar value: The Value. + :vartype value: list[~azure.mgmt.databoxedge.v2020_12_01.models.Role] + :ivar next_link: Link to the next set of results. + :vartype next_link: str + """ + + _validation = { + 'value': {'readonly': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[Role]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(RoleList, self).__init__(**kwargs) + self.value = None + self.next_link = None + + +class RoleSinkInfo(msrest.serialization.Model): + """Compute role against which events will be raised. + + All required parameters must be populated in order to send to Azure. + + :param role_id: Required. Compute role ID. + :type role_id: str + """ + + _validation = { + 'role_id': {'required': True}, + } + + _attribute_map = { + 'role_id': {'key': 'roleId', 'type': 'str'}, + } + + def __init__( + self, + *, + role_id: str, + **kwargs + ): + super(RoleSinkInfo, self).__init__(**kwargs) + self.role_id = role_id + + +class Secret(msrest.serialization.Model): + """Holds device secret either as a KeyVault reference or as an encrypted value. + + :param encrypted_secret: Encrypted (using device public key) secret value. + :type encrypted_secret: ~azure.mgmt.databoxedge.v2020_12_01.models.AsymmetricEncryptedSecret + :param key_vault_id: Id of the Key-Vault where secret is stored (ex: + secrets/AuthClientSecret/82ef4346187a4033a10d629cde07d740). + :type key_vault_id: str + """ + + _attribute_map = { + 'encrypted_secret': {'key': 'encryptedSecret', 'type': 'AsymmetricEncryptedSecret'}, + 'key_vault_id': {'key': 'keyVaultId', 'type': 'str'}, + } + + def __init__( + self, + *, + encrypted_secret: Optional["AsymmetricEncryptedSecret"] = None, + key_vault_id: Optional[str] = None, + **kwargs + ): + super(Secret, self).__init__(**kwargs) + self.encrypted_secret = encrypted_secret + self.key_vault_id = key_vault_id + + +class SecuritySettings(ARMBaseModel): + """The security settings of a device. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: The path ID that uniquely identifies the object. + :vartype id: str + :ivar name: The object name. + :vartype name: str + :ivar type: The hierarchical type of the object. + :vartype type: str + :param device_admin_password: Required. Device administrator password as an encrypted string + (encrypted using RSA PKCS #1) is used to sign into the local web UI of the device. The Actual + password should have at least 8 characters that are a combination of uppercase, lowercase, + numeric, and special characters. + :type device_admin_password: + ~azure.mgmt.databoxedge.v2020_12_01.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[~azure.mgmt.databoxedge.v2020_12_01.models.MetricSpecificationV1] + """ + + _attribute_map = { + 'metric_specifications': {'key': 'metricSpecifications', 'type': '[MetricSpecificationV1]'}, + } + + def __init__( + self, + *, + metric_specifications: Optional[List["MetricSpecificationV1"]] = None, + **kwargs + ): + super(ServiceSpecification, self).__init__(**kwargs) + self.metric_specifications = metric_specifications + + +class Share(ARMBaseModel): + """Represents a share on the Data Box Edge/Gateway device. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: The path ID that uniquely identifies the object. + :vartype id: str + :ivar name: The object name. + :vartype name: str + :ivar type: The hierarchical type of the object. + :vartype type: str + :ivar system_data: Share on ASE device. + :vartype system_data: ~azure.mgmt.databoxedge.v2020_12_01.models.SystemData + :param description: Description for the share. + :type description: str + :param share_status: Required. Current status of the share. Possible values include: "Offline", + "Unknown", "OK", "Updating", "NeedsAttention". + :type share_status: str or ~azure.mgmt.databoxedge.v2020_12_01.models.ShareStatus + :param monitoring_status: Required. Current monitoring status of the share. Possible values + include: "Enabled", "Disabled". + :type monitoring_status: str or ~azure.mgmt.databoxedge.v2020_12_01.models.MonitoringStatus + :param azure_container_info: Azure container mapping for the share. + :type azure_container_info: ~azure.mgmt.databoxedge.v2020_12_01.models.AzureContainerInfo + :param access_protocol: Required. Access protocol to be used by the share. Possible values + include: "SMB", "NFS". + :type access_protocol: str or ~azure.mgmt.databoxedge.v2020_12_01.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[~azure.mgmt.databoxedge.v2020_12_01.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[~azure.mgmt.databoxedge.v2020_12_01.models.ClientAccessRight] + :param refresh_details: Details of the refresh job on this share. + :type refresh_details: ~azure.mgmt.databoxedge.v2020_12_01.models.RefreshDetails + :ivar share_mappings: Share mount point to the role. + :vartype share_mappings: list[~azure.mgmt.databoxedge.v2020_12_01.models.MountPointMap] + :param data_policy: Data policy of the share. Possible values include: "Cloud", "Local". + :type data_policy: str or ~azure.mgmt.databoxedge.v2020_12_01.models.DataPolicy + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'system_data': {'readonly': True}, + 'share_status': {'required': True}, + 'monitoring_status': {'required': True}, + 'access_protocol': {'required': True}, + 'share_mappings': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + 'share_status': {'key': 'properties.shareStatus', 'type': 'str'}, + 'monitoring_status': {'key': 'properties.monitoringStatus', 'type': 'str'}, + 'azure_container_info': {'key': 'properties.azureContainerInfo', 'type': 'AzureContainerInfo'}, + 'access_protocol': {'key': 'properties.accessProtocol', 'type': 'str'}, + 'user_access_rights': {'key': 'properties.userAccessRights', 'type': '[UserAccessRight]'}, + 'client_access_rights': {'key': 'properties.clientAccessRights', 'type': '[ClientAccessRight]'}, + 'refresh_details': {'key': 'properties.refreshDetails', 'type': 'RefreshDetails'}, + 'share_mappings': {'key': 'properties.shareMappings', 'type': '[MountPointMap]'}, + 'data_policy': {'key': 'properties.dataPolicy', 'type': 'str'}, + } + + def __init__( + self, + *, + share_status: Union[str, "ShareStatus"], + monitoring_status: Union[str, "MonitoringStatus"], + access_protocol: Union[str, "ShareAccessProtocol"], + description: Optional[str] = None, + azure_container_info: Optional["AzureContainerInfo"] = None, + user_access_rights: Optional[List["UserAccessRight"]] = None, + client_access_rights: Optional[List["ClientAccessRight"]] = None, + refresh_details: Optional["RefreshDetails"] = None, + data_policy: Optional[Union[str, "DataPolicy"]] = None, + **kwargs + ): + super(Share, self).__init__(**kwargs) + self.system_data = None + self.description = description + self.share_status = share_status + self.monitoring_status = monitoring_status + self.azure_container_info = azure_container_info + self.access_protocol = access_protocol + self.user_access_rights = user_access_rights + self.client_access_rights = client_access_rights + self.refresh_details = refresh_details + self.share_mappings = None + self.data_policy = data_policy + + +class ShareAccessRight(msrest.serialization.Model): + """Specifies the mapping between this particular user and the type of access he has on shares on this device. + + All required parameters must be populated in order to send to Azure. + + :param share_id: Required. The share ID. + :type share_id: str + :param access_type: Required. Type of access to be allowed on the share for this user. Possible + values include: "Change", "Read", "Custom". + :type access_type: str or ~azure.mgmt.databoxedge.v2020_12_01.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[~azure.mgmt.databoxedge.v2020_12_01.models.Share] + :ivar next_link: Link to the next set of results. + :vartype next_link: str + """ + + _validation = { + 'value': {'readonly': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[Share]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ShareList, self).__init__(**kwargs) + self.value = None + self.next_link = None + + +class Sku(msrest.serialization.Model): + """The SKU type. + + :param name: SKU name. Possible values include: "Gateway", "Edge", "TEA_1Node", + "TEA_1Node_UPS", "TEA_1Node_Heater", "TEA_1Node_UPS_Heater", "TEA_4Node_Heater", + "TEA_4Node_UPS_Heater", "TMA", "TDC", "TCA_Small", "GPU", "TCA_Large", "EdgeP_Base", + "EdgeP_High", "EdgePR_Base", "EdgePR_Base_UPS", "EdgeMR_Mini", "RCA_Small", "RCA_Large", "RDC". + :type name: str or ~azure.mgmt.databoxedge.v2020_12_01.models.SkuName + :param tier: The SKU tier. This is based on the SKU name. Possible values include: "Standard". + :type tier: str or ~azure.mgmt.databoxedge.v2020_12_01.models.SkuTier + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'tier': {'key': 'tier', 'type': 'str'}, + } + + def __init__( + self, + *, + name: Optional[Union[str, "SkuName"]] = None, + tier: Optional[Union[str, "SkuTier"]] = None, + **kwargs + ): + super(Sku, self).__init__(**kwargs) + self.name = name + self.tier = tier + + +class SkuCapability(msrest.serialization.Model): + """The metadata to describe the capability. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar name: An invariant to describe the feature. + :vartype name: str + :ivar value: An invariant if the feature is measured by quantity. + :vartype value: str + """ + + _validation = { + 'name': {'readonly': True}, + 'value': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'value': {'key': 'value', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(SkuCapability, self).__init__(**kwargs) + self.name = None + self.value = None + + +class SkuCost(msrest.serialization.Model): + """The metadata for retrieving price info. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar meter_id: Used for querying price from commerce. + :vartype meter_id: str + :ivar quantity: The cost quantity. + :vartype quantity: long + :ivar extended_unit: The extended unit. + :vartype extended_unit: str + """ + + _validation = { + 'meter_id': {'readonly': True}, + 'quantity': {'readonly': True}, + 'extended_unit': {'readonly': True}, + } + + _attribute_map = { + 'meter_id': {'key': 'meterId', 'type': 'str'}, + 'quantity': {'key': 'quantity', 'type': 'long'}, + 'extended_unit': {'key': 'extendedUnit', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(SkuCost, self).__init__(**kwargs) + self.meter_id = None + self.quantity = None + self.extended_unit = None + + +class SkuInformation(msrest.serialization.Model): + """Sku information. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar name: The sku name. + :vartype name: str + :ivar tier: The sku tier. + :vartype tier: str + :ivar kind: The sku kind. + :vartype kind: str + :ivar family: The Sku family. + :vartype family: str + :ivar costs: The pricing info of the Sku. + :vartype costs: list[~azure.mgmt.databoxedge.v2020_12_01.models.SkuCost] + :ivar locations: The locations where Sku is available. + :vartype locations: list[str] + :ivar location_info: The locations where Sku is available with zones and sites info. + :vartype location_info: list[~azure.mgmt.databoxedge.v2020_12_01.models.SkuLocationInfo] + :ivar required_quota_ids: The required quotaIds for the sku to be available. + :vartype required_quota_ids: list[str] + :ivar required_features: The required features for the sku to be available. + :vartype required_features: list[str] + """ + + _validation = { + 'name': {'readonly': True}, + 'tier': {'readonly': True}, + 'kind': {'readonly': True}, + 'family': {'readonly': True}, + 'costs': {'readonly': True}, + 'locations': {'readonly': True}, + 'location_info': {'readonly': True}, + 'required_quota_ids': {'readonly': True}, + 'required_features': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'tier': {'key': 'tier', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'family': {'key': 'family', 'type': 'str'}, + 'costs': {'key': 'costs', 'type': '[SkuCost]'}, + 'locations': {'key': 'locations', 'type': '[str]'}, + 'location_info': {'key': 'locationInfo', 'type': '[SkuLocationInfo]'}, + 'required_quota_ids': {'key': 'requiredQuotaIds', 'type': '[str]'}, + 'required_features': {'key': 'requiredFeatures', 'type': '[str]'}, + } + + def __init__( + self, + **kwargs + ): + super(SkuInformation, self).__init__(**kwargs) + self.name = None + self.tier = None + self.kind = None + self.family = None + self.costs = None + self.locations = None + self.location_info = None + self.required_quota_ids = None + self.required_features = None + + +class SkuInformationList(msrest.serialization.Model): + """List of SKU Information objects. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar value: List of ResourceTypeSku objects. + :vartype value: list[~azure.mgmt.databoxedge.v2020_12_01.models.ResourceTypeSku] + :ivar next_link: Links to the next set of results. + :vartype next_link: str + """ + + _validation = { + 'value': {'readonly': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[ResourceTypeSku]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(SkuInformationList, self).__init__(**kwargs) + self.value = None + self.next_link = None + + +class SkuLocationInfo(msrest.serialization.Model): + """The location info. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar location: The location. + :vartype location: str + :ivar zones: The zones. + :vartype zones: list[str] + :ivar sites: The sites. + :vartype sites: list[str] + """ + + _validation = { + 'location': {'readonly': True}, + 'zones': {'readonly': True}, + 'sites': {'readonly': True}, + } + + _attribute_map = { + 'location': {'key': 'location', 'type': 'str'}, + 'zones': {'key': 'zones', 'type': '[str]'}, + 'sites': {'key': 'sites', 'type': '[str]'}, + } + + def __init__( + self, + **kwargs + ): + super(SkuLocationInfo, self).__init__(**kwargs) + self.location = None + self.zones = None + self.sites = None + + +class StorageAccount(ARMBaseModel): + """Represents a Storage Account on the Data Box Edge/Gateway device. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: The path ID that uniquely identifies the object. + :vartype id: str + :ivar name: The object name. + :vartype name: str + :ivar type: The hierarchical type of the object. + :vartype type: str + :ivar system_data: StorageAccount object on ASE device. + :vartype system_data: ~azure.mgmt.databoxedge.v2020_12_01.models.SystemData + :param description: Description for the storage Account. + :type description: str + :param storage_account_status: Current status of the storage account. Possible values include: + "OK", "Offline", "Unknown", "Updating", "NeedsAttention". + :type storage_account_status: str or + ~azure.mgmt.databoxedge.v2020_12_01.models.StorageAccountStatus + :param data_policy: Required. Data policy of the storage Account. Possible values include: + "Cloud", "Local". + :type data_policy: str or ~azure.mgmt.databoxedge.v2020_12_01.models.DataPolicy + :param storage_account_credential_id: Storage Account Credential Id. + :type storage_account_credential_id: str + :ivar blob_endpoint: BlobEndpoint of Storage Account. + :vartype blob_endpoint: str + :ivar container_count: The Container Count. Present only for Storage Accounts with DataPolicy + set to Cloud. + :vartype container_count: int + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'system_data': {'readonly': True}, + 'data_policy': {'required': True}, + 'blob_endpoint': {'readonly': True}, + 'container_count': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + 'storage_account_status': {'key': 'properties.storageAccountStatus', 'type': 'str'}, + 'data_policy': {'key': 'properties.dataPolicy', 'type': 'str'}, + 'storage_account_credential_id': {'key': 'properties.storageAccountCredentialId', 'type': 'str'}, + 'blob_endpoint': {'key': 'properties.blobEndpoint', 'type': 'str'}, + 'container_count': {'key': 'properties.containerCount', 'type': 'int'}, + } + + def __init__( + self, + *, + data_policy: Union[str, "DataPolicy"], + description: Optional[str] = None, + storage_account_status: Optional[Union[str, "StorageAccountStatus"]] = None, + storage_account_credential_id: Optional[str] = None, + **kwargs + ): + super(StorageAccount, self).__init__(**kwargs) + self.system_data = None + self.description = description + self.storage_account_status = storage_account_status + self.data_policy = data_policy + self.storage_account_credential_id = storage_account_credential_id + self.blob_endpoint = None + self.container_count = None + + +class StorageAccountCredential(ARMBaseModel): + """The storage account credential. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: The path ID that uniquely identifies the object. + :vartype id: str + :ivar name: The object name. + :vartype name: str + :ivar type: The hierarchical type of the object. + :vartype type: str + :ivar system_data: StorageAccountCredential object. + :vartype system_data: ~azure.mgmt.databoxedge.v2020_12_01.models.SystemData + :param alias: Required. Alias for the storage account. + :type alias: str + :param user_name: Username for the storage account. + :type user_name: str + :param account_key: Encrypted storage key. + :type account_key: ~azure.mgmt.databoxedge.v2020_12_01.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 ~azure.mgmt.databoxedge.v2020_12_01.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 ~azure.mgmt.databoxedge.v2020_12_01.models.AccountType + :param storage_account_id: Id of the storage account. + :type storage_account_id: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'system_data': {'readonly': True}, + 'alias': {'required': True}, + 'ssl_status': {'required': True}, + 'account_type': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'alias': {'key': 'properties.alias', 'type': 'str'}, + 'user_name': {'key': 'properties.userName', 'type': 'str'}, + 'account_key': {'key': 'properties.accountKey', 'type': 'AsymmetricEncryptedSecret'}, + 'connection_string': {'key': 'properties.connectionString', 'type': 'str'}, + 'ssl_status': {'key': 'properties.sslStatus', 'type': 'str'}, + 'blob_domain_name': {'key': 'properties.blobDomainName', 'type': 'str'}, + 'account_type': {'key': 'properties.accountType', 'type': 'str'}, + 'storage_account_id': {'key': 'properties.storageAccountId', 'type': 'str'}, + } + + def __init__( + self, + *, + alias: str, + ssl_status: Union[str, "SSLStatus"], + account_type: Union[str, "AccountType"], + user_name: Optional[str] = None, + account_key: Optional["AsymmetricEncryptedSecret"] = None, + connection_string: Optional[str] = None, + blob_domain_name: Optional[str] = None, + storage_account_id: Optional[str] = None, + **kwargs + ): + super(StorageAccountCredential, self).__init__(**kwargs) + self.system_data = None + self.alias = alias + self.user_name = user_name + self.account_key = account_key + self.connection_string = connection_string + self.ssl_status = ssl_status + self.blob_domain_name = blob_domain_name + self.account_type = account_type + self.storage_account_id = storage_account_id + + +class StorageAccountCredentialList(msrest.serialization.Model): + """The collection of storage account credentials. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar value: The value. + :vartype value: list[~azure.mgmt.databoxedge.v2020_12_01.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[~azure.mgmt.databoxedge.v2020_12_01.models.StorageAccount] + :ivar next_link: Link to the next set of results. + :vartype next_link: str + """ + + _validation = { + 'value': {'readonly': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[StorageAccount]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(StorageAccountList, self).__init__(**kwargs) + self.value = None + self.next_link = None + + +class SubscriptionRegisteredFeatures(msrest.serialization.Model): + """SubscriptionRegisteredFeatures. + + :param name: + :type name: str + :param state: + :type state: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'state': {'key': 'state', 'type': 'str'}, + } + + def __init__( + self, + *, + name: Optional[str] = None, + state: Optional[str] = None, + **kwargs + ): + super(SubscriptionRegisteredFeatures, self).__init__(**kwargs) + self.name = name + self.state = state + + +class SymmetricKey(msrest.serialization.Model): + """Symmetric key for authentication. + + :param connection_string: Connection string based on the symmetric key. + :type connection_string: ~azure.mgmt.databoxedge.v2020_12_01.models.AsymmetricEncryptedSecret + """ + + _attribute_map = { + 'connection_string': {'key': 'connectionString', 'type': 'AsymmetricEncryptedSecret'}, + } + + def __init__( + self, + *, + connection_string: Optional["AsymmetricEncryptedSecret"] = None, + **kwargs + ): + super(SymmetricKey, self).__init__(**kwargs) + self.connection_string = connection_string + + +class SystemData(msrest.serialization.Model): + """Metadata pertaining to creation and last modification of the resource. + + :param created_by: The identity that created the resource. + :type created_by: str + :param created_by_type: The type of identity that created the resource. Possible values + include: "User", "Application", "ManagedIdentity", "Key". + :type created_by_type: str or ~azure.mgmt.databoxedge.v2020_12_01.models.CreatedByType + :param created_at: The timestamp of resource creation (UTC). + :type created_at: ~datetime.datetime + :param last_modified_by: The identity that last modified the resource. + :type last_modified_by: str + :param last_modified_by_type: The type of identity that last modified the resource. Possible + values include: "User", "Application", "ManagedIdentity", "Key". + :type last_modified_by_type: str or ~azure.mgmt.databoxedge.v2020_12_01.models.CreatedByType + :param last_modified_at: The type of identity that last modified the resource. + :type last_modified_at: ~datetime.datetime + """ + + _attribute_map = { + 'created_by': {'key': 'createdBy', 'type': 'str'}, + 'created_by_type': {'key': 'createdByType', 'type': 'str'}, + 'created_at': {'key': 'createdAt', 'type': 'iso-8601'}, + 'last_modified_by': {'key': 'lastModifiedBy', 'type': 'str'}, + 'last_modified_by_type': {'key': 'lastModifiedByType', 'type': 'str'}, + 'last_modified_at': {'key': 'lastModifiedAt', 'type': 'iso-8601'}, + } + + def __init__( + self, + *, + created_by: Optional[str] = None, + created_by_type: Optional[Union[str, "CreatedByType"]] = None, + created_at: Optional[datetime.datetime] = None, + last_modified_by: Optional[str] = None, + last_modified_by_type: Optional[Union[str, "CreatedByType"]] = None, + last_modified_at: Optional[datetime.datetime] = None, + **kwargs + ): + super(SystemData, self).__init__(**kwargs) + self.created_by = created_by + self.created_by_type = created_by_type + self.created_at = created_at + self.last_modified_by = last_modified_by + self.last_modified_by_type = last_modified_by_type + self.last_modified_at = last_modified_at + + +class TrackingInfo(msrest.serialization.Model): + """Tracking courier information. + + :param serial_number: Serial number of the device being tracked. + :type serial_number: str + :param carrier_name: Name of the carrier used in the delivery. + :type carrier_name: str + :param tracking_id: Tracking ID of the shipment. + :type tracking_id: str + :param tracking_url: Tracking URL of the shipment. + :type tracking_url: str + """ + + _attribute_map = { + 'serial_number': {'key': 'serialNumber', 'type': 'str'}, + 'carrier_name': {'key': 'carrierName', 'type': 'str'}, + 'tracking_id': {'key': 'trackingId', 'type': 'str'}, + 'tracking_url': {'key': 'trackingUrl', 'type': 'str'}, + } + + def __init__( + self, + *, + serial_number: Optional[str] = None, + carrier_name: Optional[str] = None, + tracking_id: Optional[str] = None, + tracking_url: Optional[str] = None, + **kwargs + ): + super(TrackingInfo, self).__init__(**kwargs) + self.serial_number = serial_number + self.carrier_name = carrier_name + self.tracking_id = tracking_id + self.tracking_url = tracking_url + + +class TriggerList(msrest.serialization.Model): + """Collection of all trigger on the data box edge device. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar value: The list of triggers. + :vartype value: list[~azure.mgmt.databoxedge.v2020_12_01.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 ~azure.mgmt.databoxedge.v2020_12_01.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 + ~azure.mgmt.databoxedge.v2020_12_01.models.InstallRebootBehavior + :ivar ongoing_update_operation: The current update operation. Possible values include: "None", + "Scan", "Download", "Install". + :vartype ongoing_update_operation: str or + ~azure.mgmt.databoxedge.v2020_12_01.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 ~azure.mgmt.databoxedge.v2020_12_01.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 ~azure.mgmt.databoxedge.v2020_12_01.models.AuthenticationType + :ivar resource_id: The resource ID of the Data Box Edge/Gateway device. + :vartype resource_id: str + :ivar aad_authority: Azure Active Directory tenant authority. + :vartype aad_authority: str + :ivar aad_tenant_id: Azure Active Directory tenant ID. + :vartype aad_tenant_id: str + :ivar service_principal_client_id: Azure Active Directory service principal client ID. + :vartype service_principal_client_id: str + :ivar service_principal_object_id: Azure Active Directory service principal object ID. + :vartype service_principal_object_id: str + :ivar azure_management_endpoint_audience: The azure management endpoint audience. + :vartype azure_management_endpoint_audience: str + :ivar aad_audience: Identifier of the target resource that is the recipient of the requested + token. + :vartype aad_audience: str + """ + + _validation = { + 'resource_id': {'readonly': True}, + 'aad_authority': {'readonly': True}, + 'aad_tenant_id': {'readonly': True}, + 'service_principal_client_id': {'readonly': True}, + 'service_principal_object_id': {'readonly': True}, + 'azure_management_endpoint_audience': {'readonly': True}, + 'aad_audience': {'readonly': True}, + } + + _attribute_map = { + 'auth_type': {'key': 'authType', 'type': 'str'}, + 'resource_id': {'key': 'resourceId', 'type': 'str'}, + 'aad_authority': {'key': 'aadAuthority', 'type': 'str'}, + 'aad_tenant_id': {'key': 'aadTenantId', 'type': 'str'}, + 'service_principal_client_id': {'key': 'servicePrincipalClientId', 'type': 'str'}, + 'service_principal_object_id': {'key': 'servicePrincipalObjectId', 'type': 'str'}, + 'azure_management_endpoint_audience': {'key': 'azureManagementEndpointAudience', 'type': 'str'}, + 'aad_audience': {'key': 'aadAudience', 'type': 'str'}, + } + + def __init__( + self, + *, + auth_type: Optional[Union[str, "AuthenticationType"]] = None, + **kwargs + ): + super(UploadCertificateResponse, self).__init__(**kwargs) + self.auth_type = auth_type + self.resource_id = None + self.aad_authority = None + self.aad_tenant_id = None + self.service_principal_client_id = None + self.service_principal_object_id = None + self.azure_management_endpoint_audience = None + self.aad_audience = None + + +class User(ARMBaseModel): + """Represents a user who has access to one or more shares on the Data Box Edge/Gateway device. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: The path ID that uniquely identifies the object. + :vartype id: str + :ivar name: The object name. + :vartype name: str + :ivar type: The hierarchical type of the object. + :vartype type: str + :ivar system_data: User in DataBoxEdge Resource. + :vartype system_data: ~azure.mgmt.databoxedge.v2020_12_01.models.SystemData + :param encrypted_password: The password details. + :type encrypted_password: ~azure.mgmt.databoxedge.v2020_12_01.models.AsymmetricEncryptedSecret + :ivar share_access_rights: List of shares that the user has rights on. This field should not be + specified during user creation. + :vartype share_access_rights: list[~azure.mgmt.databoxedge.v2020_12_01.models.ShareAccessRight] + :param user_type: Required. Type of the user. Possible values include: "Share", + "LocalManagement", "ARM". + :type user_type: str or ~azure.mgmt.databoxedge.v2020_12_01.models.UserType + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'system_data': {'readonly': True}, + 'share_access_rights': {'readonly': True}, + 'user_type': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'encrypted_password': {'key': 'properties.encryptedPassword', 'type': 'AsymmetricEncryptedSecret'}, + 'share_access_rights': {'key': 'properties.shareAccessRights', 'type': '[ShareAccessRight]'}, + 'user_type': {'key': 'properties.userType', 'type': 'str'}, + } + + def __init__( + self, + *, + user_type: Union[str, "UserType"], + encrypted_password: Optional["AsymmetricEncryptedSecret"] = None, + **kwargs + ): + super(User, self).__init__(**kwargs) + self.system_data = None + self.encrypted_password = encrypted_password + self.share_access_rights = None + self.user_type = user_type + + +class UserAccessRight(msrest.serialization.Model): + """The mapping between a particular user and the access type on the SMB share. + + All required parameters must be populated in order to send to Azure. + + :param user_id: Required. User ID (already existing in the device). + :type user_id: str + :param access_type: Required. Type of access to be allowed for the user. Possible values + include: "Change", "Read", "Custom". + :type access_type: str or ~azure.mgmt.databoxedge.v2020_12_01.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[~azure.mgmt.databoxedge.v2020_12_01.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/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/datab/operations/__init__.py b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/datab/operations/__init__.py new file mode 100644 index 000000000000..d70057be6458 --- /dev/null +++ b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/datab/operations/__init__.py @@ -0,0 +1,47 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from ._operations import Operations +from ._available_skus_operations import AvailableSkusOperations +from ._devices_operations import DevicesOperations +from ._alerts_operations import AlertsOperations +from ._bandwidth_schedules_operations import BandwidthSchedulesOperations +from ._jobs_operations import JobsOperations +from ._nodes_operations import NodesOperations +from ._operations_status_operations import OperationsStatusOperations +from ._orders_operations import OrdersOperations +from ._roles_operations import RolesOperations +from ._addons_operations import AddonsOperations +from ._monitoring_config_operations import MonitoringConfigOperations +from ._shares_operations import SharesOperations +from ._storage_account_credentials_operations import StorageAccountCredentialsOperations +from ._storage_accounts_operations import StorageAccountsOperations +from ._containers_operations import ContainersOperations +from ._triggers_operations import TriggersOperations +from ._users_operations import UsersOperations + +__all__ = [ + 'Operations', + 'AvailableSkusOperations', + 'DevicesOperations', + 'AlertsOperations', + 'BandwidthSchedulesOperations', + 'JobsOperations', + 'NodesOperations', + 'OperationsStatusOperations', + 'OrdersOperations', + 'RolesOperations', + 'AddonsOperations', + 'MonitoringConfigOperations', + 'SharesOperations', + 'StorageAccountCredentialsOperations', + 'StorageAccountsOperations', + 'ContainersOperations', + 'TriggersOperations', + 'UsersOperations', +] diff --git a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/datab/operations/_addons_operations.py b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/datab/operations/_addons_operations.py new file mode 100644 index 000000000000..09c62f5d0066 --- /dev/null +++ b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/datab/operations/_addons_operations.py @@ -0,0 +1,460 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.core.polling import LROPoller, NoPolling, PollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.arm_polling import ARMPolling + +from .. import models as _models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class AddonsOperations(object): + """AddonsOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.databoxedge.v2020_12_01.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list_by_role( + self, + device_name, # type: str + role_name, # type: str + resource_group_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.AddonList"] + """Lists all the addons configured in the role. + + :param device_name: The device name. + :type device_name: str + :param role_name: The role name. + :type role_name: str + :param resource_group_name: The resource group name. + :type resource_group_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either AddonList or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.databoxedge.v2020_12_01.models.AddonList] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.AddonList"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-12-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_by_role.metadata['url'] # type: ignore + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'roleName': self._serialize.url("role_name", role_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('AddonList', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_by_role.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/roles/{roleName}/addons'} # type: ignore + + def get( + self, + device_name, # type: str + role_name, # type: str + addon_name, # type: str + resource_group_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.Addon" + """Gets a specific addon by name. + + :param device_name: The device name. + :type device_name: str + :param role_name: The role name. + :type role_name: str + :param addon_name: The addon name. + :type addon_name: str + :param resource_group_name: The resource group name. + :type resource_group_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: Addon, or the result of cls(response) + :rtype: ~azure.mgmt.databoxedge.v2020_12_01.models.Addon + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.Addon"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-12-01" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'roleName': self._serialize.url("role_name", role_name, 'str'), + 'addonName': self._serialize.url("addon_name", addon_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('Addon', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/roles/{roleName}/addons/{addonName}'} # type: ignore + + def _create_or_update_initial( + self, + device_name, # type: str + role_name, # type: str + addon_name, # type: str + resource_group_name, # type: str + addon, # type: "_models.Addon" + **kwargs # type: Any + ): + # type: (...) -> Optional["_models.Addon"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.Addon"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-12-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._create_or_update_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'roleName': self._serialize.url("role_name", role_name, 'str'), + 'addonName': self._serialize.url("addon_name", addon_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(addon, 'Addon') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('Addon', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/roles/{roleName}/addons/{addonName}'} # type: ignore + + def begin_create_or_update( + self, + device_name, # type: str + role_name, # type: str + addon_name, # type: str + resource_group_name, # type: str + addon, # type: "_models.Addon" + **kwargs # type: Any + ): + # type: (...) -> LROPoller["_models.Addon"] + """Create or update a addon. + + :param device_name: The device name. + :type device_name: str + :param role_name: The role name. + :type role_name: str + :param addon_name: The addon name. + :type addon_name: str + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param addon: The addon properties. + :type addon: ~azure.mgmt.databoxedge.v2020_12_01.models.Addon + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: Pass in True if you'd like the ARMPolling polling method, + False for no polling, or your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either Addon or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.databoxedge.v2020_12_01.models.Addon] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Addon"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._create_or_update_initial( + device_name=device_name, + role_name=role_name, + addon_name=addon_name, + resource_group_name=resource_group_name, + addon=addon, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('Addon', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'roleName': self._serialize.url("role_name", role_name, 'str'), + 'addonName': self._serialize.url("addon_name", addon_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/roles/{roleName}/addons/{addonName}'} # type: ignore + + def _delete_initial( + self, + device_name, # type: str + role_name, # type: str + addon_name, # type: str + resource_group_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-12-01" + accept = "application/json" + + # Construct URL + url = self._delete_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'roleName': self._serialize.url("role_name", role_name, 'str'), + 'addonName': self._serialize.url("addon_name", addon_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/roles/{roleName}/addons/{addonName}'} # type: ignore + + def begin_delete( + self, + device_name, # type: str + role_name, # type: str + addon_name, # type: str + resource_group_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> LROPoller[None] + """Deletes the addon on the device. + + :param device_name: The device name. + :type device_name: str + :param role_name: The role name. + :type role_name: str + :param addon_name: The addon name. + :type addon_name: str + :param resource_group_name: The resource group name. + :type resource_group_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: Pass in True if you'd like the ARMPolling polling method, + False for no polling, or your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._delete_initial( + device_name=device_name, + role_name=role_name, + addon_name=addon_name, + resource_group_name=resource_group_name, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'roleName': self._serialize.url("role_name", role_name, 'str'), + 'addonName': self._serialize.url("addon_name", addon_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/roles/{roleName}/addons/{addonName}'} # type: ignore diff --git a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/datab/operations/_alerts_operations.py b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/datab/operations/_alerts_operations.py new file mode 100644 index 000000000000..f77ba9c4b82e --- /dev/null +++ b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/datab/operations/_alerts_operations.py @@ -0,0 +1,186 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.mgmt.core.exceptions import ARMErrorFormat + +from .. import models as _models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class AlertsOperations(object): + """AlertsOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.databoxedge.v2020_12_01.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[~azure.mgmt.databoxedge.v2020_12_01.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 = "2020-12-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: ~azure.mgmt.databoxedge.v2020_12_01.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 = "2020-12-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/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/datab/operations/_available_skus_operations.py b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/datab/operations/_available_skus_operations.py new file mode 100644 index 000000000000..36b72ea14e57 --- /dev/null +++ b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/datab/operations/_available_skus_operations.py @@ -0,0 +1,115 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.mgmt.core.exceptions import ARMErrorFormat + +from .. import models as _models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class AvailableSkusOperations(object): + """AvailableSkusOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.databoxedge.v2020_12_01.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list( + self, + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.DataBoxEdgeSkuList"] + """List all the available Skus and information related to them. + + List all the available Skus and information related to them. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either DataBoxEdgeSkuList or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.databoxedge.v2020_12_01.models.DataBoxEdgeSkuList] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.DataBoxEdgeSkuList"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-12-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('DataBoxEdgeSkuList', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.DataBoxEdge/availableSkus'} # type: ignore diff --git a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/datab/operations/_bandwidth_schedules_operations.py b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/datab/operations/_bandwidth_schedules_operations.py new file mode 100644 index 000000000000..3d7a92ff7fdb --- /dev/null +++ b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/datab/operations/_bandwidth_schedules_operations.py @@ -0,0 +1,438 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.core.polling import LROPoller, NoPolling, PollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.arm_polling import ARMPolling + +from .. import models as _models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class BandwidthSchedulesOperations(object): + """BandwidthSchedulesOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.databoxedge.v2020_12_01.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[~azure.mgmt.databoxedge.v2020_12_01.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 = "2020-12-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: ~azure.mgmt.databoxedge.v2020_12_01.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 = "2020-12-01" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('BandwidthSchedule', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/bandwidthSchedules/{name}'} # type: ignore + + def _create_or_update_initial( + self, + device_name, # type: str + name, # type: str + resource_group_name, # type: str + parameters, # type: "_models.BandwidthSchedule" + **kwargs # type: Any + ): + # type: (...) -> Optional["_models.BandwidthSchedule"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.BandwidthSchedule"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-12-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._create_or_update_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, 'BandwidthSchedule') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('BandwidthSchedule', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/bandwidthSchedules/{name}'} # type: ignore + + def begin_create_or_update( + self, + device_name, # type: str + name, # type: str + resource_group_name, # type: str + parameters, # type: "_models.BandwidthSchedule" + **kwargs # type: Any + ): + # type: (...) -> LROPoller["_models.BandwidthSchedule"] + """Creates or updates a bandwidth schedule. + + :param device_name: The device name. + :type device_name: str + :param name: The bandwidth schedule name which needs to be added/updated. + :type name: str + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param parameters: The bandwidth schedule to be added or updated. + :type parameters: ~azure.mgmt.databoxedge.v2020_12_01.models.BandwidthSchedule + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: Pass in True if you'd like the ARMPolling polling method, + False for no polling, or your own initialized polling object for a 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[~azure.mgmt.databoxedge.v2020_12_01.models.BandwidthSchedule] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.BandwidthSchedule"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._create_or_update_initial( + device_name=device_name, + name=name, + resource_group_name=resource_group_name, + parameters=parameters, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('BandwidthSchedule', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/bandwidthSchedules/{name}'} # type: ignore + + def _delete_initial( + self, + device_name, # type: str + name, # type: str + resource_group_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-12-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: Pass in True if you'd like the ARMPolling polling method, + False for no polling, or your own initialized polling object for a 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/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/datab/operations/_containers_operations.py b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/datab/operations/_containers_operations.py new file mode 100644 index 000000000000..43552ff41f6d --- /dev/null +++ b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/datab/operations/_containers_operations.py @@ -0,0 +1,592 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.core.polling import LROPoller, NoPolling, PollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.arm_polling import ARMPolling + +from .. import models as _models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class ContainersOperations(object): + """ContainersOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.databoxedge.v2020_12_01.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[~azure.mgmt.databoxedge.v2020_12_01.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 = "2020-12-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: ~azure.mgmt.databoxedge.v2020_12_01.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 = "2020-12-01" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'storageAccountName': self._serialize.url("storage_account_name", storage_account_name, 'str'), + 'containerName': self._serialize.url("container_name", container_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('Container', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/storageAccounts/{storageAccountName}/containers/{containerName}'} # type: ignore + + def _create_or_update_initial( + self, + device_name, # type: str + storage_account_name, # type: str + container_name, # type: str + resource_group_name, # type: str + container, # type: "_models.Container" + **kwargs # type: Any + ): + # type: (...) -> Optional["_models.Container"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.Container"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-12-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._create_or_update_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'storageAccountName': self._serialize.url("storage_account_name", storage_account_name, 'str'), + 'containerName': self._serialize.url("container_name", container_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(container, 'Container') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('Container', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/storageAccounts/{storageAccountName}/containers/{containerName}'} # type: ignore + + def begin_create_or_update( + self, + device_name, # type: str + storage_account_name, # type: str + container_name, # type: str + resource_group_name, # type: str + container, # type: "_models.Container" + **kwargs # type: Any + ): + # type: (...) -> LROPoller["_models.Container"] + """Creates a new container or updates an existing container on the device. + + Creates a new container or updates an existing container on the device. + + :param device_name: The device name. + :type device_name: str + :param storage_account_name: The Storage Account Name. + :type storage_account_name: str + :param container_name: The container name. + :type container_name: str + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param container: The container properties. + :type container: ~azure.mgmt.databoxedge.v2020_12_01.models.Container + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: Pass in True if you'd like the ARMPolling polling method, + False for no polling, or your own initialized polling object for a 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[~azure.mgmt.databoxedge.v2020_12_01.models.Container] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Container"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._create_or_update_initial( + device_name=device_name, + storage_account_name=storage_account_name, + container_name=container_name, + resource_group_name=resource_group_name, + container=container, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('Container', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'storageAccountName': self._serialize.url("storage_account_name", storage_account_name, 'str'), + 'containerName': self._serialize.url("container_name", container_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/storageAccounts/{storageAccountName}/containers/{containerName}'} # type: ignore + + def _delete_initial( + self, + device_name, # type: str + storage_account_name, # type: str + container_name, # type: str + resource_group_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-12-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: Pass in True if you'd like the ARMPolling polling method, + False for no polling, or your own initialized polling object for a 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 = "2020-12-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: Pass in True if you'd like the ARMPolling polling method, + False for no polling, or your own initialized polling object for a 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/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/datab/operations/_devices_operations.py b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/datab/operations/_devices_operations.py new file mode 100644 index 000000000000..ff371ee8fd4a --- /dev/null +++ b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/datab/operations/_devices_operations.py @@ -0,0 +1,1389 @@ +# 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 as _models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class DevicesOperations(object): + """DevicesOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.databoxedge.v2020_12_01.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[~azure.mgmt.databoxedge.v2020_12_01.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 = "2020-12-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[~azure.mgmt.databoxedge.v2020_12_01.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 = "2020-12-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: ~azure.mgmt.databoxedge.v2020_12_01.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 = "2020-12-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 + data_box_edge_device, # type: "_models.DataBoxEdgeDevice" + **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', {})) + api_version = "2020-12-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 + data_box_edge_device, # type: "_models.DataBoxEdgeDevice" + **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 data_box_edge_device: The resource object. + :type data_box_edge_device: ~azure.mgmt.databoxedge.v2020_12_01.models.DataBoxEdgeDevice + :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: Pass in True if you'd like the ARMPolling polling method, + False for no polling, or your own initialized polling object for a 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[~azure.mgmt.databoxedge.v2020_12_01.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, + data_box_edge_device=data_box_edge_device, + 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 = "2020-12-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: Pass in True if you'd like the ARMPolling polling method, + False for no polling, or your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._delete_initial( + device_name=device_name, + resource_group_name=resource_group_name, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}'} # type: ignore + + def update( + self, + device_name, # type: str + resource_group_name, # type: str + parameters, # type: "_models.DataBoxEdgeDevicePatch" + **kwargs # type: Any + ): + # type: (...) -> "_models.DataBoxEdgeDevice" + """Modifies a Data Box Edge/Data Box Gateway resource. + + :param device_name: The device name. + :type device_name: str + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param parameters: The resource parameters. + :type parameters: ~azure.mgmt.databoxedge.v2020_12_01.models.DataBoxEdgeDevicePatch + :keyword callable cls: A custom type or function that will be passed the direct response + :return: DataBoxEdgeDevice, or the result of cls(response) + :rtype: ~azure.mgmt.databoxedge.v2020_12_01.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 = "2020-12-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update.metadata['url'] # type: ignore + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, 'DataBoxEdgeDevicePatch') + body_content_kwargs['content'] = body_content + request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('DataBoxEdgeDevice', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}'} # type: ignore + + def _download_updates_initial( + self, + device_name, # type: str + resource_group_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-12-01" + accept = "application/json" + + # Construct URL + url = self._download_updates_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _download_updates_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/downloadUpdates'} # type: ignore + + def begin_download_updates( + self, + device_name, # type: str + resource_group_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> LROPoller[None] + """Downloads the updates on a Data Box Edge/Data Box Gateway device. + + Downloads the updates on a Data Box Edge/Data Box Gateway device. + + :param device_name: The device name. + :type device_name: str + :param resource_group_name: The resource group name. + :type resource_group_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: Pass in True if you'd like the ARMPolling polling method, + False for no polling, or your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._download_updates_initial( + device_name=device_name, + resource_group_name=resource_group_name, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_download_updates.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/downloadUpdates'} # type: ignore + + def generate_certificate( + self, + device_name, # type: str + resource_group_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.GenerateCertResponse" + """Generates certificate for activation key. + + :param device_name: The device name. + :type device_name: str + :param resource_group_name: The resource group name. + :type resource_group_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: GenerateCertResponse, or the result of cls(response) + :rtype: ~azure.mgmt.databoxedge.v2020_12_01.models.GenerateCertResponse + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.GenerateCertResponse"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-12-01" + accept = "application/json" + + # Construct URL + url = self.generate_certificate.metadata['url'] # type: ignore + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('GenerateCertResponse', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + generate_certificate.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/generateCertificate'} # type: ignore + + def get_extended_information( + self, + device_name, # type: str + resource_group_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.DataBoxEdgeDeviceExtendedInfo" + """Gets additional information for the specified Azure Stack Edge/Data Box Gateway device. + + :param device_name: The device name. + :type device_name: str + :param resource_group_name: The resource group name. + :type resource_group_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: DataBoxEdgeDeviceExtendedInfo, or the result of cls(response) + :rtype: ~azure.mgmt.databoxedge.v2020_12_01.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 = "2020-12-01" + accept = "application/json" + + # Construct URL + url = self.get_extended_information.metadata['url'] # type: ignore + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('DataBoxEdgeDeviceExtendedInfo', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_extended_information.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/getExtendedInformation'} # type: ignore + + def _install_updates_initial( + self, + device_name, # type: str + resource_group_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-12-01" + accept = "application/json" + + # Construct URL + url = self._install_updates_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _install_updates_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/installUpdates'} # type: ignore + + def begin_install_updates( + self, + device_name, # type: str + resource_group_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> LROPoller[None] + """Installs the updates on the Data Box Edge/Data Box Gateway device. + + Installs the updates on the Data Box Edge/Data Box Gateway device. + + :param device_name: The device name. + :type device_name: str + :param resource_group_name: The resource group name. + :type resource_group_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: Pass in True if you'd like the ARMPolling polling method, + False for no polling, or your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._install_updates_initial( + device_name=device_name, + resource_group_name=resource_group_name, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_install_updates.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/installUpdates'} # type: ignore + + def get_network_settings( + self, + device_name, # type: str + resource_group_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.NetworkSettings" + """Gets the network settings of the specified Data Box Edge/Data Box Gateway device. + + :param device_name: The device name. + :type device_name: str + :param resource_group_name: The resource group name. + :type resource_group_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: NetworkSettings, or the result of cls(response) + :rtype: ~azure.mgmt.databoxedge.v2020_12_01.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 = "2020-12-01" + accept = "application/json" + + # Construct URL + url = self.get_network_settings.metadata['url'] # type: ignore + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('NetworkSettings', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_network_settings.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/networkSettings/default'} # type: ignore + + def _scan_for_updates_initial( + self, + device_name, # type: str + resource_group_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-12-01" + accept = "application/json" + + # Construct URL + url = self._scan_for_updates_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _scan_for_updates_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/scanForUpdates'} # type: ignore + + def begin_scan_for_updates( + self, + device_name, # type: str + resource_group_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> LROPoller[None] + """Scans for updates on a Data Box Edge/Data Box Gateway device. + + Scans for updates on a Data Box Edge/Data Box Gateway device. + + :param device_name: The device name. + :type device_name: str + :param resource_group_name: The resource group name. + :type resource_group_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: Pass in True if you'd like the ARMPolling polling method, + False for no polling, or your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._scan_for_updates_initial( + device_name=device_name, + resource_group_name=resource_group_name, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_scan_for_updates.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/scanForUpdates'} # type: ignore + + def _create_or_update_security_settings_initial( + self, + device_name, # type: str + resource_group_name, # type: str + security_settings, # type: "_models.SecuritySettings" + **kwargs # type: Any + ): + # type: (...) -> None + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-12-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._create_or_update_security_settings_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(security_settings, 'SecuritySettings') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _create_or_update_security_settings_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/securitySettings/default/update'} # type: ignore + + def begin_create_or_update_security_settings( + self, + device_name, # type: str + resource_group_name, # type: str + security_settings, # type: "_models.SecuritySettings" + **kwargs # type: Any + ): + # type: (...) -> LROPoller[None] + """Updates the security settings on a Data Box Edge/Data Box Gateway device. + + :param device_name: The device name. + :type device_name: str + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param security_settings: The security settings. + :type security_settings: ~azure.mgmt.databoxedge.v2020_12_01.models.SecuritySettings + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: Pass in True if you'd like the ARMPolling polling method, + False for no polling, or your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._create_or_update_security_settings_initial( + device_name=device_name, + resource_group_name=resource_group_name, + security_settings=security_settings, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create_or_update_security_settings.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/securitySettings/default/update'} # type: ignore + + def update_extended_information( + self, + device_name, # type: str + resource_group_name, # type: str + parameters, # type: "_models.DataBoxEdgeDeviceExtendedInfoPatch" + **kwargs # type: Any + ): + # type: (...) -> "_models.DataBoxEdgeDeviceExtendedInfo" + """Gets additional information for the specified Data Box Edge/Data Box Gateway device. + + :param device_name: The device name. + :type device_name: str + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param parameters: The patch object. + :type parameters: ~azure.mgmt.databoxedge.v2020_12_01.models.DataBoxEdgeDeviceExtendedInfoPatch + :keyword callable cls: A custom type or function that will be passed the direct response + :return: DataBoxEdgeDeviceExtendedInfo, or the result of cls(response) + :rtype: ~azure.mgmt.databoxedge.v2020_12_01.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 = "2020-12-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update_extended_information.metadata['url'] # type: ignore + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, 'DataBoxEdgeDeviceExtendedInfoPatch') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('DataBoxEdgeDeviceExtendedInfo', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update_extended_information.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/updateExtendedInformation'} # type: ignore + + def get_update_summary( + self, + device_name, # type: str + resource_group_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.UpdateSummary" + """Gets information about the availability of updates based on the last scan of the device. It also gets information about any ongoing download or install jobs on the device. + + Gets information about the availability of updates based on the last scan of the device. It + also gets information about any ongoing download or install jobs on the device. + + :param device_name: The device name. + :type device_name: str + :param resource_group_name: The resource group name. + :type resource_group_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: UpdateSummary, or the result of cls(response) + :rtype: ~azure.mgmt.databoxedge.v2020_12_01.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 = "2020-12-01" + accept = "application/json" + + # Construct URL + url = self.get_update_summary.metadata['url'] # type: ignore + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('UpdateSummary', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_update_summary.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/updateSummary/default'} # type: ignore + + def upload_certificate( + self, + device_name, # type: str + resource_group_name, # type: str + parameters, # type: "_models.UploadCertificateRequest" + **kwargs # type: Any + ): + # type: (...) -> "_models.UploadCertificateResponse" + """Uploads registration certificate for the device. + + :param device_name: The device name. + :type device_name: str + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param parameters: The upload certificate request. + :type parameters: ~azure.mgmt.databoxedge.v2020_12_01.models.UploadCertificateRequest + :keyword callable cls: A custom type or function that will be passed the direct response + :return: UploadCertificateResponse, or the result of cls(response) + :rtype: ~azure.mgmt.databoxedge.v2020_12_01.models.UploadCertificateResponse + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.UploadCertificateResponse"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-12-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/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/datab/operations/_jobs_operations.py b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/datab/operations/_jobs_operations.py new file mode 100644 index 000000000000..0f247c2dadde --- /dev/null +++ b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/datab/operations/_jobs_operations.py @@ -0,0 +1,110 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.mgmt.core.exceptions import ARMErrorFormat + +from .. import models as _models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Optional, TypeVar + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class JobsOperations(object): + """JobsOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.databoxedge.v2020_12_01.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: ~azure.mgmt.databoxedge.v2020_12_01.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 = "2020-12-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/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/datab/operations/_monitoring_config_operations.py b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/datab/operations/_monitoring_config_operations.py new file mode 100644 index 000000000000..b7a1149d557f --- /dev/null +++ b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/datab/operations/_monitoring_config_operations.py @@ -0,0 +1,450 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.core.polling import LROPoller, NoPolling, PollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.arm_polling import ARMPolling + +from .. import models as _models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class MonitoringConfigOperations(object): + """MonitoringConfigOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.databoxedge.v2020_12_01.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list( + self, + device_name, # type: str + role_name, # type: str + resource_group_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.MonitoringMetricConfigurationList"] + """Lists metric configurations in a role. + + Lists metric configurations in a role. + + :param device_name: The device name. + :type device_name: str + :param role_name: The role name. + :type role_name: str + :param resource_group_name: The resource group name. + :type resource_group_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either MonitoringMetricConfigurationList or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.databoxedge.v2020_12_01.models.MonitoringMetricConfigurationList] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.MonitoringMetricConfigurationList"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-12-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list.metadata['url'] # type: ignore + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'roleName': self._serialize.url("role_name", role_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('MonitoringMetricConfigurationList', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/roles/{roleName}/monitoringConfig'} # type: ignore + + def get( + self, + device_name, # type: str + role_name, # type: str + resource_group_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.MonitoringMetricConfiguration" + """Gets a metric configuration of a role. + + Gets a metric configuration of a role. + + :param device_name: The device name. + :type device_name: str + :param role_name: The role name. + :type role_name: str + :param resource_group_name: The resource group name. + :type resource_group_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: MonitoringMetricConfiguration, or the result of cls(response) + :rtype: ~azure.mgmt.databoxedge.v2020_12_01.models.MonitoringMetricConfiguration + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.MonitoringMetricConfiguration"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-12-01" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'roleName': self._serialize.url("role_name", role_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('MonitoringMetricConfiguration', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/roles/{roleName}/monitoringConfig/default'} # type: ignore + + def _create_or_update_initial( + self, + device_name, # type: str + role_name, # type: str + resource_group_name, # type: str + monitoring_metric_configuration, # type: "_models.MonitoringMetricConfiguration" + **kwargs # type: Any + ): + # type: (...) -> Optional["_models.MonitoringMetricConfiguration"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.MonitoringMetricConfiguration"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-12-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._create_or_update_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'roleName': self._serialize.url("role_name", role_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(monitoring_metric_configuration, 'MonitoringMetricConfiguration') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('MonitoringMetricConfiguration', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/roles/{roleName}/monitoringConfig/default'} # type: ignore + + def begin_create_or_update( + self, + device_name, # type: str + role_name, # type: str + resource_group_name, # type: str + monitoring_metric_configuration, # type: "_models.MonitoringMetricConfiguration" + **kwargs # type: Any + ): + # type: (...) -> LROPoller["_models.MonitoringMetricConfiguration"] + """Creates a new metric configuration or updates an existing one for a role. + + Creates a new metric configuration or updates an existing one for a role. + + :param device_name: The device name. + :type device_name: str + :param role_name: The role name. + :type role_name: str + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param monitoring_metric_configuration: The metric configuration. + :type monitoring_metric_configuration: ~azure.mgmt.databoxedge.v2020_12_01.models.MonitoringMetricConfiguration + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: Pass in True if you'd like the ARMPolling polling method, + False for no polling, or your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either MonitoringMetricConfiguration or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.databoxedge.v2020_12_01.models.MonitoringMetricConfiguration] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.MonitoringMetricConfiguration"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._create_or_update_initial( + device_name=device_name, + role_name=role_name, + resource_group_name=resource_group_name, + monitoring_metric_configuration=monitoring_metric_configuration, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('MonitoringMetricConfiguration', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'roleName': self._serialize.url("role_name", role_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/roles/{roleName}/monitoringConfig/default'} # type: ignore + + def _delete_initial( + self, + device_name, # type: str + role_name, # type: str + resource_group_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-12-01" + accept = "application/json" + + # Construct URL + url = self._delete_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'roleName': self._serialize.url("role_name", role_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/roles/{roleName}/monitoringConfig/default'} # type: ignore + + def begin_delete( + self, + device_name, # type: str + role_name, # type: str + resource_group_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> LROPoller[None] + """deletes a new metric configuration for a role. + + deletes a new metric configuration for a role. + + :param device_name: The device name. + :type device_name: str + :param role_name: The role name. + :type role_name: str + :param resource_group_name: The resource group name. + :type resource_group_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: Pass in True if you'd like the ARMPolling polling method, + False for no polling, or your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._delete_initial( + device_name=device_name, + role_name=role_name, + resource_group_name=resource_group_name, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'roleName': self._serialize.url("role_name", role_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/roles/{roleName}/monitoringConfig/default'} # type: ignore diff --git a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/datab/operations/_nodes_operations.py b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/datab/operations/_nodes_operations.py new file mode 100644 index 000000000000..78229359702b --- /dev/null +++ b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/datab/operations/_nodes_operations.py @@ -0,0 +1,121 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.mgmt.core.exceptions import ARMErrorFormat + +from .. import models as _models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class NodesOperations(object): + """NodesOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.databoxedge.v2020_12_01.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[~azure.mgmt.databoxedge.v2020_12_01.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 = "2020-12-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_by_data_box_edge_device.metadata['url'] # type: ignore + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('NodeList', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_by_data_box_edge_device.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/nodes'} # type: ignore diff --git a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/datab/operations/_operations.py b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/datab/operations/_operations.py new file mode 100644 index 000000000000..90ce016c463a --- /dev/null +++ b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/datab/operations/_operations.py @@ -0,0 +1,111 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.mgmt.core.exceptions import ARMErrorFormat + +from .. import models as _models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class Operations(object): + """Operations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.databoxedge.v2020_12_01.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[~azure.mgmt.databoxedge.v2020_12_01.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 = "2020-12-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/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/datab/operations/_operations_status_operations.py b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/datab/operations/_operations_status_operations.py new file mode 100644 index 000000000000..f1f15e5aa3c9 --- /dev/null +++ b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/datab/operations/_operations_status_operations.py @@ -0,0 +1,110 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.mgmt.core.exceptions import ARMErrorFormat + +from .. import models as _models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Optional, TypeVar + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class OperationsStatusOperations(object): + """OperationsStatusOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.databoxedge.v2020_12_01.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: ~azure.mgmt.databoxedge.v2020_12_01.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 = "2020-12-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/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/datab/operations/_orders_operations.py b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/datab/operations/_orders_operations.py new file mode 100644 index 000000000000..6895a9da9339 --- /dev/null +++ b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/datab/operations/_orders_operations.py @@ -0,0 +1,489 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.core.polling import LROPoller, NoPolling, PollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.arm_polling import ARMPolling + +from .. import models as _models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class OrdersOperations(object): + """OrdersOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.databoxedge.v2020_12_01.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[~azure.mgmt.databoxedge.v2020_12_01.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 = "2020-12-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: ~azure.mgmt.databoxedge.v2020_12_01.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 = "2020-12-01" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('Order', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/orders/default'} # type: ignore + + def _create_or_update_initial( + self, + device_name, # type: str + resource_group_name, # type: str + order, # type: "_models.Order" + **kwargs # type: Any + ): + # type: (...) -> Optional["_models.Order"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.Order"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-12-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._create_or_update_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(order, 'Order') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('Order', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/orders/default'} # type: ignore + + def begin_create_or_update( + self, + device_name, # type: str + resource_group_name, # type: str + order, # type: "_models.Order" + **kwargs # type: Any + ): + # type: (...) -> LROPoller["_models.Order"] + """Creates or updates an order. + + Creates or updates an order. + + :param device_name: The order details of a device. + :type device_name: str + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param order: The order to be created or updated. + :type order: ~azure.mgmt.databoxedge.v2020_12_01.models.Order + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: Pass in True if you'd like the ARMPolling polling method, + False for no polling, or your own initialized polling object for a 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[~azure.mgmt.databoxedge.v2020_12_01.models.Order] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Order"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._create_or_update_initial( + device_name=device_name, + resource_group_name=resource_group_name, + order=order, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('Order', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/orders/default'} # type: ignore + + def _delete_initial( + self, + device_name, # type: str + resource_group_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-12-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: Pass in True if you'd like the ARMPolling polling method, + False for no polling, or your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._delete_initial( + device_name=device_name, + resource_group_name=resource_group_name, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/orders/default'} # type: ignore + + def list_dc_access_code( + self, + device_name, # type: str + resource_group_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.DCAccessCode" + """Gets the DCAccess Code. + + Gets the DCAccess Code. + + :param device_name: The device name. + :type device_name: str + :param resource_group_name: The resource group name. + :type resource_group_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: DCAccessCode, or the result of cls(response) + :rtype: ~azure.mgmt.databoxedge.v2020_12_01.models.DCAccessCode + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.DCAccessCode"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-12-01" + accept = "application/json" + + # Construct URL + url = self.list_dc_access_code.metadata['url'] # type: ignore + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('DCAccessCode', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + list_dc_access_code.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/orders/default/listDCAccessCode'} # type: ignore diff --git a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/datab/operations/_roles_operations.py b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/datab/operations/_roles_operations.py new file mode 100644 index 000000000000..3d7eaba27c8a --- /dev/null +++ b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/datab/operations/_roles_operations.py @@ -0,0 +1,438 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.core.polling import LROPoller, NoPolling, PollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.arm_polling import ARMPolling + +from .. import models as _models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class RolesOperations(object): + """RolesOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.databoxedge.v2020_12_01.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[~azure.mgmt.databoxedge.v2020_12_01.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 = "2020-12-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: ~azure.mgmt.databoxedge.v2020_12_01.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 = "2020-12-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 = "2020-12-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: ~azure.mgmt.databoxedge.v2020_12_01.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: Pass in True if you'd like the ARMPolling polling method, + False for no polling, or your own initialized polling object for a 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[~azure.mgmt.databoxedge.v2020_12_01.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 = "2020-12-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: Pass in True if you'd like the ARMPolling polling method, + False for no polling, or your own initialized polling object for a 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/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/datab/operations/_shares_operations.py b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/datab/operations/_shares_operations.py new file mode 100644 index 000000000000..d0bb45caa897 --- /dev/null +++ b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/datab/operations/_shares_operations.py @@ -0,0 +1,563 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.core.polling import LROPoller, NoPolling, PollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.arm_polling import ARMPolling + +from .. import models as _models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class SharesOperations(object): + """SharesOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.databoxedge.v2020_12_01.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[~azure.mgmt.databoxedge.v2020_12_01.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 = "2020-12-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: ~azure.mgmt.databoxedge.v2020_12_01.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 = "2020-12-01" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('Share', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/shares/{name}'} # type: ignore + + def _create_or_update_initial( + self, + device_name, # type: str + name, # type: str + resource_group_name, # type: str + share, # type: "_models.Share" + **kwargs # type: Any + ): + # type: (...) -> Optional["_models.Share"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.Share"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-12-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._create_or_update_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(share, 'Share') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('Share', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/shares/{name}'} # type: ignore + + def begin_create_or_update( + self, + device_name, # type: str + name, # type: str + resource_group_name, # type: str + share, # type: "_models.Share" + **kwargs # type: Any + ): + # type: (...) -> LROPoller["_models.Share"] + """Creates a new share or updates an existing share on the device. + + Creates a new share or updates an existing share on the device. + + :param device_name: The device name. + :type device_name: str + :param name: The share name. + :type name: str + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param share: The share properties. + :type share: ~azure.mgmt.databoxedge.v2020_12_01.models.Share + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: Pass in True if you'd like the ARMPolling polling method, + False for no polling, or your own initialized polling object for a 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[~azure.mgmt.databoxedge.v2020_12_01.models.Share] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Share"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._create_or_update_initial( + device_name=device_name, + name=name, + resource_group_name=resource_group_name, + share=share, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('Share', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/shares/{name}'} # type: ignore + + def _delete_initial( + self, + device_name, # type: str + name, # type: str + resource_group_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-12-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: Pass in True if you'd like the ARMPolling polling method, + False for no polling, or your own initialized polling object for a 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 = "2020-12-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: Pass in True if you'd like the ARMPolling polling method, + False for no polling, or your own initialized polling object for a 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/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/datab/operations/_storage_account_credentials_operations.py b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/datab/operations/_storage_account_credentials_operations.py new file mode 100644 index 000000000000..77dd4662c491 --- /dev/null +++ b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/datab/operations/_storage_account_credentials_operations.py @@ -0,0 +1,440 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.core.polling import LROPoller, NoPolling, PollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.arm_polling import ARMPolling + +from .. import models as _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: ~azure.mgmt.databoxedge.v2020_12_01.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[~azure.mgmt.databoxedge.v2020_12_01.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 = "2020-12-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: ~azure.mgmt.databoxedge.v2020_12_01.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 = "2020-12-01" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('StorageAccountCredential', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/storageAccountCredentials/{name}'} # type: ignore + + def _create_or_update_initial( + self, + device_name, # type: str + name, # type: str + resource_group_name, # type: str + storage_account_credential, # type: "_models.StorageAccountCredential" + **kwargs # type: Any + ): + # type: (...) -> Optional["_models.StorageAccountCredential"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.StorageAccountCredential"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-12-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._create_or_update_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(storage_account_credential, 'StorageAccountCredential') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('StorageAccountCredential', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/storageAccountCredentials/{name}'} # type: ignore + + def begin_create_or_update( + self, + device_name, # type: str + name, # type: str + resource_group_name, # type: str + storage_account_credential, # type: "_models.StorageAccountCredential" + **kwargs # type: Any + ): + # type: (...) -> LROPoller["_models.StorageAccountCredential"] + """Creates or updates the storage account credential. + + :param device_name: The device name. + :type device_name: str + :param name: The storage account credential name. + :type name: str + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param storage_account_credential: The storage account credential. + :type storage_account_credential: ~azure.mgmt.databoxedge.v2020_12_01.models.StorageAccountCredential + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: Pass in True if you'd like the ARMPolling polling method, + False for no polling, or your own initialized polling object for a 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[~azure.mgmt.databoxedge.v2020_12_01.models.StorageAccountCredential] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.StorageAccountCredential"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._create_or_update_initial( + device_name=device_name, + name=name, + resource_group_name=resource_group_name, + storage_account_credential=storage_account_credential, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('StorageAccountCredential', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/storageAccountCredentials/{name}'} # type: ignore + + def _delete_initial( + self, + device_name, # type: str + name, # type: str + resource_group_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-12-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: Pass in True if you'd like the ARMPolling polling method, + False for no polling, or your own initialized polling object for a 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/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/datab/operations/_storage_accounts_operations.py b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/datab/operations/_storage_accounts_operations.py new file mode 100644 index 000000000000..e62921192cf6 --- /dev/null +++ b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/datab/operations/_storage_accounts_operations.py @@ -0,0 +1,444 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.core.polling import LROPoller, NoPolling, PollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.arm_polling import ARMPolling + +from .. import models as _models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class StorageAccountsOperations(object): + """StorageAccountsOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.databoxedge.v2020_12_01.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list_by_data_box_edge_device( + self, + device_name, # type: str + resource_group_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.StorageAccountList"] + """Lists all the StorageAccounts in a Data Box Edge/Data Box Gateway device. + + Lists all the StorageAccounts in a Data Box Edge/Data Box Gateway device. + + :param device_name: The device name. + :type device_name: str + :param resource_group_name: The resource group name. + :type resource_group_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either StorageAccountList or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.databoxedge.v2020_12_01.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 = "2020-12-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: ~azure.mgmt.databoxedge.v2020_12_01.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 = "2020-12-01" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'storageAccountName': self._serialize.url("storage_account_name", storage_account_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('StorageAccount', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/storageAccounts/{storageAccountName}'} # type: ignore + + def _create_or_update_initial( + self, + device_name, # type: str + storage_account_name, # type: str + resource_group_name, # type: str + storage_account, # type: "_models.StorageAccount" + **kwargs # type: Any + ): + # type: (...) -> Optional["_models.StorageAccount"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.StorageAccount"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-12-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._create_or_update_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'storageAccountName': self._serialize.url("storage_account_name", storage_account_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(storage_account, 'StorageAccount') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('StorageAccount', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/storageAccounts/{storageAccountName}'} # type: ignore + + def begin_create_or_update( + self, + device_name, # type: str + storage_account_name, # type: str + resource_group_name, # type: str + storage_account, # type: "_models.StorageAccount" + **kwargs # type: Any + ): + # type: (...) -> LROPoller["_models.StorageAccount"] + """Creates a new StorageAccount or updates an existing StorageAccount on the device. + + Creates a new StorageAccount or updates an existing StorageAccount on the device. + + :param device_name: The device name. + :type device_name: str + :param storage_account_name: The StorageAccount name. + :type storage_account_name: str + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param storage_account: The StorageAccount properties. + :type storage_account: ~azure.mgmt.databoxedge.v2020_12_01.models.StorageAccount + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: Pass in True if you'd like the ARMPolling polling method, + False for no polling, or your own initialized polling object for a 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[~azure.mgmt.databoxedge.v2020_12_01.models.StorageAccount] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.StorageAccount"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._create_or_update_initial( + device_name=device_name, + storage_account_name=storage_account_name, + resource_group_name=resource_group_name, + storage_account=storage_account, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('StorageAccount', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'storageAccountName': self._serialize.url("storage_account_name", storage_account_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/storageAccounts/{storageAccountName}'} # type: ignore + + def _delete_initial( + self, + device_name, # type: str + storage_account_name, # type: str + resource_group_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-12-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: Pass in True if you'd like the ARMPolling polling method, + False for no polling, or your own initialized polling object for a 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/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/datab/operations/_triggers_operations.py b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/datab/operations/_triggers_operations.py new file mode 100644 index 000000000000..121a94ea9905 --- /dev/null +++ b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/datab/operations/_triggers_operations.py @@ -0,0 +1,444 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.core.polling import LROPoller, NoPolling, PollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.arm_polling import ARMPolling + +from .. import models as _models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class TriggersOperations(object): + """TriggersOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.databoxedge.v2020_12_01.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[~azure.mgmt.databoxedge.v2020_12_01.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 = "2020-12-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: ~azure.mgmt.databoxedge.v2020_12_01.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 = "2020-12-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 = "2020-12-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: ~azure.mgmt.databoxedge.v2020_12_01.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: Pass in True if you'd like the ARMPolling polling method, + False for no polling, or your own initialized polling object for a 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[~azure.mgmt.databoxedge.v2020_12_01.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 = "2020-12-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: Pass in True if you'd like the ARMPolling polling method, + False for no polling, or your own initialized polling object for a 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/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/datab/operations/_users_operations.py b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/datab/operations/_users_operations.py new file mode 100644 index 000000000000..774e1ad9db56 --- /dev/null +++ b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/datab/operations/_users_operations.py @@ -0,0 +1,444 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.core.polling import LROPoller, NoPolling, PollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.arm_polling import ARMPolling + +from .. import models as _models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class UsersOperations(object): + """UsersOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.databoxedge.v2020_12_01.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list_by_data_box_edge_device( + self, + device_name, # type: str + resource_group_name, # type: str + filter=None, # type: Optional[str] + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.UserList"] + """Gets all the users registered on a Data Box Edge/Data Box Gateway device. + + :param device_name: The device name. + :type device_name: str + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param filter: Specify $filter='Type eq :code:``' to filter on user type property. + :type filter: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either UserList or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.databoxedge.v2020_12_01.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 = "2020-12-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: ~azure.mgmt.databoxedge.v2020_12_01.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 = "2020-12-01" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('User', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/users/{name}'} # type: ignore + + def _create_or_update_initial( + self, + device_name, # type: str + name, # type: str + resource_group_name, # type: str + user, # type: "_models.User" + **kwargs # type: Any + ): + # type: (...) -> Optional["_models.User"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.User"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-12-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._create_or_update_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(user, 'User') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('User', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/users/{name}'} # type: ignore + + def begin_create_or_update( + self, + device_name, # type: str + name, # type: str + resource_group_name, # type: str + user, # type: "_models.User" + **kwargs # type: Any + ): + # type: (...) -> LROPoller["_models.User"] + """Creates a new user or updates an existing user's information on a Data Box Edge/Data Box + Gateway device. + + :param device_name: The device name. + :type device_name: str + :param name: The user name. + :type name: str + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param user: The user details. + :type user: ~azure.mgmt.databoxedge.v2020_12_01.models.User + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: Pass in True if you'd like the ARMPolling polling method, + False for no polling, or your own initialized polling object for a 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[~azure.mgmt.databoxedge.v2020_12_01.models.User] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.User"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._create_or_update_initial( + device_name=device_name, + name=name, + resource_group_name=resource_group_name, + user=user, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('User', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/users/{name}'} # type: ignore + + def _delete_initial( + self, + device_name, # type: str + name, # type: str + resource_group_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-12-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: Pass in True if you'd like the ARMPolling polling method, + False for no polling, or your own initialized polling object for a 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/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/datab/py.typed b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/datab/py.typed new file mode 100644 index 000000000000..e5aff4f83af8 --- /dev/null +++ b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/datab/py.typed @@ -0,0 +1 @@ +# Marker file for PEP 561. \ No newline at end of file diff --git a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/_configuration.py b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/_configuration.py index 739a6465e6e6..58d4b497e3aa 100644 --- a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/_configuration.py +++ b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/_configuration.py @@ -8,7 +8,7 @@ # Changes may cause incorrect behavior and will be lost if the code is # regenerated. # -------------------------------------------------------------------------- -from typing import Any +from typing import TYPE_CHECKING from azure.core.configuration import Configuration from azure.core.pipeline import policies @@ -16,6 +16,11 @@ from ._version import VERSION +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any + + from azure.core.credentials import TokenCredential class DataBoxEdgeManagementClientConfiguration(Configuration): """Configuration for DataBoxEdgeManagementClient. diff --git a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/_data_box_edge_management_client.py b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/_data_box_edge_management_client.py index 62b25226810b..cc262d6f2e12 100644 --- a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/_data_box_edge_management_client.py +++ b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/_data_box_edge_management_client.py @@ -9,13 +9,22 @@ # regenerated. # -------------------------------------------------------------------------- -from azure.mgmt.core import ARMPipelineClient -from msrest import Serializer, Deserializer +from typing import TYPE_CHECKING +from azure.mgmt.core import ARMPipelineClient from azure.profiles import KnownProfiles, ProfileDefinition from azure.profiles.multiapiclient import MultiApiClientMixin +from msrest import Deserializer, Serializer + from ._configuration import DataBoxEdgeManagementClientConfiguration +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Optional + + from azure.core.credentials import TokenCredential + from azure.core.pipeline.transport import HttpRequest, HttpResponse + class _SDKClient(object): def __init__(self, *args, **kwargs): """This is a fake class to support current implemetation of MultiApiClientMixin." @@ -38,19 +47,21 @@ class DataBoxEdgeManagementClient(MultiApiClientMixin, _SDKClient): :type credential: ~azure.core.credentials.TokenCredential :param subscription_id: The subscription ID. :type subscription_id: str - :param str api_version: API version to use if no profile is provided, or if - missing in profile. - :param str base_url: Service URL + :param api_version: API version to use if no profile is provided, or if missing in profile. + :type api_version: str + :param base_url: Service URL + :type base_url: str :param profile: A profile definition, from KnownProfiles to dict. :type profile: azure.profiles.KnownProfiles :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. """ - DEFAULT_API_VERSION = '2019-08-01' + DEFAULT_API_VERSION = '2020-09-01' _PROFILE_TAG = "azure.mgmt.databoxedge.DataBoxEdgeManagementClient" LATEST_PROFILE = ProfileDefinition({ _PROFILE_TAG: { None: DEFAULT_API_VERSION, + 'skus': '2019-08-01', }}, _PROFILE_TAG + " latest" ) @@ -59,9 +70,9 @@ def __init__( self, credential, # type: "TokenCredential" subscription_id, # type: str - api_version=None, - base_url=None, - profile=KnownProfiles.default, + api_version=None, # type: Optional[str] + base_url=None, # type: Optional[str] + profile=KnownProfiles.default, # type: KnownProfiles **kwargs # type: Any ): if not base_url: @@ -85,6 +96,9 @@ def models(cls, api_version=DEFAULT_API_VERSION): * 2019-07-01: :mod:`v2019_07_01.models` * 2019-08-01: :mod:`v2019_08_01.models` * 2020-05-01-preview: :mod:`v2020_05_01_preview.models` + * 2020-09-01: :mod:`v2020_09_01.models` + * 2020-09-01-preview: :mod:`v2020_09_01_preview.models` + * 2021-02-01-preview: :mod:`v2021_02_01_preview.models` """ if api_version == '2019-03-01': from .v2019_03_01 import models @@ -98,8 +112,36 @@ def models(cls, api_version=DEFAULT_API_VERSION): elif api_version == '2020-05-01-preview': from .v2020_05_01_preview import models return models + elif api_version == '2020-09-01': + from .v2020_09_01 import models + return models + elif api_version == '2020-09-01-preview': + from .v2020_09_01_preview import models + return models + elif api_version == '2021-02-01-preview': + from .v2021_02_01_preview import models + return models raise ValueError("API version {} is not available".format(api_version)) + @property + def addons(self): + """Instance depends on the API version: + + * 2020-09-01: :class:`AddonsOperations` + * 2020-09-01-preview: :class:`AddonsOperations` + * 2021-02-01-preview: :class:`AddonsOperations` + """ + api_version = self._get_api_version('addons') + if api_version == '2020-09-01': + from .v2020_09_01.operations import AddonsOperations as OperationClass + elif api_version == '2020-09-01-preview': + from .v2020_09_01_preview.operations import AddonsOperations as OperationClass + elif api_version == '2021-02-01-preview': + from .v2021_02_01_preview.operations import AddonsOperations as OperationClass + else: + raise ValueError("API version {} does not have operation group 'addons'".format(api_version)) + return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) + @property def alerts(self): """Instance depends on the API version: @@ -108,6 +150,9 @@ def alerts(self): * 2019-07-01: :class:`AlertsOperations` * 2019-08-01: :class:`AlertsOperations` * 2020-05-01-preview: :class:`AlertsOperations` + * 2020-09-01: :class:`AlertsOperations` + * 2020-09-01-preview: :class:`AlertsOperations` + * 2021-02-01-preview: :class:`AlertsOperations` """ api_version = self._get_api_version('alerts') if api_version == '2019-03-01': @@ -118,6 +163,12 @@ def alerts(self): from .v2019_08_01.operations import AlertsOperations as OperationClass elif api_version == '2020-05-01-preview': from .v2020_05_01_preview.operations import AlertsOperations as OperationClass + elif api_version == '2020-09-01': + from .v2020_09_01.operations import AlertsOperations as OperationClass + elif api_version == '2020-09-01-preview': + from .v2020_09_01_preview.operations import AlertsOperations as OperationClass + elif api_version == '2021-02-01-preview': + from .v2021_02_01_preview.operations import AlertsOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'alerts'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -127,10 +178,19 @@ def available_skus(self): """Instance depends on the API version: * 2020-05-01-preview: :class:`AvailableSkusOperations` + * 2020-09-01: :class:`AvailableSkusOperations` + * 2020-09-01-preview: :class:`AvailableSkusOperations` + * 2021-02-01-preview: :class:`AvailableSkusOperations` """ api_version = self._get_api_version('available_skus') if api_version == '2020-05-01-preview': from .v2020_05_01_preview.operations import AvailableSkusOperations as OperationClass + elif api_version == '2020-09-01': + from .v2020_09_01.operations import AvailableSkusOperations as OperationClass + elif api_version == '2020-09-01-preview': + from .v2020_09_01_preview.operations import AvailableSkusOperations as OperationClass + elif api_version == '2021-02-01-preview': + from .v2021_02_01_preview.operations import AvailableSkusOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'available_skus'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -143,6 +203,9 @@ def bandwidth_schedules(self): * 2019-07-01: :class:`BandwidthSchedulesOperations` * 2019-08-01: :class:`BandwidthSchedulesOperations` * 2020-05-01-preview: :class:`BandwidthSchedulesOperations` + * 2020-09-01: :class:`BandwidthSchedulesOperations` + * 2020-09-01-preview: :class:`BandwidthSchedulesOperations` + * 2021-02-01-preview: :class:`BandwidthSchedulesOperations` """ api_version = self._get_api_version('bandwidth_schedules') if api_version == '2019-03-01': @@ -153,6 +216,12 @@ def bandwidth_schedules(self): from .v2019_08_01.operations import BandwidthSchedulesOperations as OperationClass elif api_version == '2020-05-01-preview': from .v2020_05_01_preview.operations import BandwidthSchedulesOperations as OperationClass + elif api_version == '2020-09-01': + from .v2020_09_01.operations import BandwidthSchedulesOperations as OperationClass + elif api_version == '2020-09-01-preview': + from .v2020_09_01_preview.operations import BandwidthSchedulesOperations as OperationClass + elif api_version == '2021-02-01-preview': + from .v2021_02_01_preview.operations import BandwidthSchedulesOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'bandwidth_schedules'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -163,12 +232,21 @@ def containers(self): * 2019-08-01: :class:`ContainersOperations` * 2020-05-01-preview: :class:`ContainersOperations` + * 2020-09-01: :class:`ContainersOperations` + * 2020-09-01-preview: :class:`ContainersOperations` + * 2021-02-01-preview: :class:`ContainersOperations` """ api_version = self._get_api_version('containers') if api_version == '2019-08-01': from .v2019_08_01.operations import ContainersOperations as OperationClass elif api_version == '2020-05-01-preview': from .v2020_05_01_preview.operations import ContainersOperations as OperationClass + elif api_version == '2020-09-01': + from .v2020_09_01.operations import ContainersOperations as OperationClass + elif api_version == '2020-09-01-preview': + from .v2020_09_01_preview.operations import ContainersOperations as OperationClass + elif api_version == '2021-02-01-preview': + from .v2021_02_01_preview.operations import ContainersOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'containers'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -181,6 +259,9 @@ def devices(self): * 2019-07-01: :class:`DevicesOperations` * 2019-08-01: :class:`DevicesOperations` * 2020-05-01-preview: :class:`DevicesOperations` + * 2020-09-01: :class:`DevicesOperations` + * 2020-09-01-preview: :class:`DevicesOperations` + * 2021-02-01-preview: :class:`DevicesOperations` """ api_version = self._get_api_version('devices') if api_version == '2019-03-01': @@ -191,6 +272,12 @@ def devices(self): from .v2019_08_01.operations import DevicesOperations as OperationClass elif api_version == '2020-05-01-preview': from .v2020_05_01_preview.operations import DevicesOperations as OperationClass + elif api_version == '2020-09-01': + from .v2020_09_01.operations import DevicesOperations as OperationClass + elif api_version == '2020-09-01-preview': + from .v2020_09_01_preview.operations import DevicesOperations as OperationClass + elif api_version == '2021-02-01-preview': + from .v2021_02_01_preview.operations import DevicesOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'devices'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -203,6 +290,9 @@ def jobs(self): * 2019-07-01: :class:`JobsOperations` * 2019-08-01: :class:`JobsOperations` * 2020-05-01-preview: :class:`JobsOperations` + * 2020-09-01: :class:`JobsOperations` + * 2020-09-01-preview: :class:`JobsOperations` + * 2021-02-01-preview: :class:`JobsOperations` """ api_version = self._get_api_version('jobs') if api_version == '2019-03-01': @@ -213,10 +303,35 @@ def jobs(self): from .v2019_08_01.operations import JobsOperations as OperationClass elif api_version == '2020-05-01-preview': from .v2020_05_01_preview.operations import JobsOperations as OperationClass + elif api_version == '2020-09-01': + from .v2020_09_01.operations import JobsOperations as OperationClass + elif api_version == '2020-09-01-preview': + from .v2020_09_01_preview.operations import JobsOperations as OperationClass + elif api_version == '2021-02-01-preview': + from .v2021_02_01_preview.operations import JobsOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'jobs'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) + @property + def monitoring_config(self): + """Instance depends on the API version: + + * 2020-09-01: :class:`MonitoringConfigOperations` + * 2020-09-01-preview: :class:`MonitoringConfigOperations` + * 2021-02-01-preview: :class:`MonitoringConfigOperations` + """ + api_version = self._get_api_version('monitoring_config') + if api_version == '2020-09-01': + from .v2020_09_01.operations import MonitoringConfigOperations as OperationClass + elif api_version == '2020-09-01-preview': + from .v2020_09_01_preview.operations import MonitoringConfigOperations as OperationClass + elif api_version == '2021-02-01-preview': + from .v2021_02_01_preview.operations import MonitoringConfigOperations as OperationClass + else: + raise ValueError("API version {} does not have operation group 'monitoring_config'".format(api_version)) + return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) + @property def nodes(self): """Instance depends on the API version: @@ -224,6 +339,9 @@ def nodes(self): * 2019-07-01: :class:`NodesOperations` * 2019-08-01: :class:`NodesOperations` * 2020-05-01-preview: :class:`NodesOperations` + * 2020-09-01: :class:`NodesOperations` + * 2020-09-01-preview: :class:`NodesOperations` + * 2021-02-01-preview: :class:`NodesOperations` """ api_version = self._get_api_version('nodes') if api_version == '2019-07-01': @@ -232,6 +350,12 @@ def nodes(self): from .v2019_08_01.operations import NodesOperations as OperationClass elif api_version == '2020-05-01-preview': from .v2020_05_01_preview.operations import NodesOperations as OperationClass + elif api_version == '2020-09-01': + from .v2020_09_01.operations import NodesOperations as OperationClass + elif api_version == '2020-09-01-preview': + from .v2020_09_01_preview.operations import NodesOperations as OperationClass + elif api_version == '2021-02-01-preview': + from .v2021_02_01_preview.operations import NodesOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'nodes'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -244,6 +368,9 @@ def operations(self): * 2019-07-01: :class:`Operations` * 2019-08-01: :class:`Operations` * 2020-05-01-preview: :class:`Operations` + * 2020-09-01: :class:`Operations` + * 2020-09-01-preview: :class:`Operations` + * 2021-02-01-preview: :class:`Operations` """ api_version = self._get_api_version('operations') if api_version == '2019-03-01': @@ -254,6 +381,12 @@ def operations(self): from .v2019_08_01.operations import Operations as OperationClass elif api_version == '2020-05-01-preview': from .v2020_05_01_preview.operations import Operations as OperationClass + elif api_version == '2020-09-01': + from .v2020_09_01.operations import Operations as OperationClass + elif api_version == '2020-09-01-preview': + from .v2020_09_01_preview.operations import Operations as OperationClass + elif api_version == '2021-02-01-preview': + from .v2021_02_01_preview.operations import Operations as OperationClass else: raise ValueError("API version {} does not have operation group 'operations'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -266,6 +399,9 @@ def operations_status(self): * 2019-07-01: :class:`OperationsStatusOperations` * 2019-08-01: :class:`OperationsStatusOperations` * 2020-05-01-preview: :class:`OperationsStatusOperations` + * 2020-09-01: :class:`OperationsStatusOperations` + * 2020-09-01-preview: :class:`OperationsStatusOperations` + * 2021-02-01-preview: :class:`OperationsStatusOperations` """ api_version = self._get_api_version('operations_status') if api_version == '2019-03-01': @@ -276,6 +412,12 @@ def operations_status(self): from .v2019_08_01.operations import OperationsStatusOperations as OperationClass elif api_version == '2020-05-01-preview': from .v2020_05_01_preview.operations import OperationsStatusOperations as OperationClass + elif api_version == '2020-09-01': + from .v2020_09_01.operations import OperationsStatusOperations as OperationClass + elif api_version == '2020-09-01-preview': + from .v2020_09_01_preview.operations import OperationsStatusOperations as OperationClass + elif api_version == '2021-02-01-preview': + from .v2021_02_01_preview.operations import OperationsStatusOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'operations_status'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -288,6 +430,9 @@ def orders(self): * 2019-07-01: :class:`OrdersOperations` * 2019-08-01: :class:`OrdersOperations` * 2020-05-01-preview: :class:`OrdersOperations` + * 2020-09-01: :class:`OrdersOperations` + * 2020-09-01-preview: :class:`OrdersOperations` + * 2021-02-01-preview: :class:`OrdersOperations` """ api_version = self._get_api_version('orders') if api_version == '2019-03-01': @@ -298,6 +443,12 @@ def orders(self): from .v2019_08_01.operations import OrdersOperations as OperationClass elif api_version == '2020-05-01-preview': from .v2020_05_01_preview.operations import OrdersOperations as OperationClass + elif api_version == '2020-09-01': + from .v2020_09_01.operations import OrdersOperations as OperationClass + elif api_version == '2020-09-01-preview': + from .v2020_09_01_preview.operations import OrdersOperations as OperationClass + elif api_version == '2021-02-01-preview': + from .v2021_02_01_preview.operations import OrdersOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'orders'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -310,6 +461,9 @@ def roles(self): * 2019-07-01: :class:`RolesOperations` * 2019-08-01: :class:`RolesOperations` * 2020-05-01-preview: :class:`RolesOperations` + * 2020-09-01: :class:`RolesOperations` + * 2020-09-01-preview: :class:`RolesOperations` + * 2021-02-01-preview: :class:`RolesOperations` """ api_version = self._get_api_version('roles') if api_version == '2019-03-01': @@ -320,6 +474,12 @@ def roles(self): from .v2019_08_01.operations import RolesOperations as OperationClass elif api_version == '2020-05-01-preview': from .v2020_05_01_preview.operations import RolesOperations as OperationClass + elif api_version == '2020-09-01': + from .v2020_09_01.operations import RolesOperations as OperationClass + elif api_version == '2020-09-01-preview': + from .v2020_09_01_preview.operations import RolesOperations as OperationClass + elif api_version == '2021-02-01-preview': + from .v2021_02_01_preview.operations import RolesOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'roles'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -332,6 +492,9 @@ def shares(self): * 2019-07-01: :class:`SharesOperations` * 2019-08-01: :class:`SharesOperations` * 2020-05-01-preview: :class:`SharesOperations` + * 2020-09-01: :class:`SharesOperations` + * 2020-09-01-preview: :class:`SharesOperations` + * 2021-02-01-preview: :class:`SharesOperations` """ api_version = self._get_api_version('shares') if api_version == '2019-03-01': @@ -342,6 +505,12 @@ def shares(self): from .v2019_08_01.operations import SharesOperations as OperationClass elif api_version == '2020-05-01-preview': from .v2020_05_01_preview.operations import SharesOperations as OperationClass + elif api_version == '2020-09-01': + from .v2020_09_01.operations import SharesOperations as OperationClass + elif api_version == '2020-09-01-preview': + from .v2020_09_01_preview.operations import SharesOperations as OperationClass + elif api_version == '2021-02-01-preview': + from .v2021_02_01_preview.operations import SharesOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'shares'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -370,6 +539,9 @@ def storage_account_credentials(self): * 2019-07-01: :class:`StorageAccountCredentialsOperations` * 2019-08-01: :class:`StorageAccountCredentialsOperations` * 2020-05-01-preview: :class:`StorageAccountCredentialsOperations` + * 2020-09-01: :class:`StorageAccountCredentialsOperations` + * 2020-09-01-preview: :class:`StorageAccountCredentialsOperations` + * 2021-02-01-preview: :class:`StorageAccountCredentialsOperations` """ api_version = self._get_api_version('storage_account_credentials') if api_version == '2019-03-01': @@ -380,6 +552,12 @@ def storage_account_credentials(self): from .v2019_08_01.operations import StorageAccountCredentialsOperations as OperationClass elif api_version == '2020-05-01-preview': from .v2020_05_01_preview.operations import StorageAccountCredentialsOperations as OperationClass + elif api_version == '2020-09-01': + from .v2020_09_01.operations import StorageAccountCredentialsOperations as OperationClass + elif api_version == '2020-09-01-preview': + from .v2020_09_01_preview.operations import StorageAccountCredentialsOperations as OperationClass + elif api_version == '2021-02-01-preview': + from .v2021_02_01_preview.operations import StorageAccountCredentialsOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'storage_account_credentials'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -390,12 +568,21 @@ def storage_accounts(self): * 2019-08-01: :class:`StorageAccountsOperations` * 2020-05-01-preview: :class:`StorageAccountsOperations` + * 2020-09-01: :class:`StorageAccountsOperations` + * 2020-09-01-preview: :class:`StorageAccountsOperations` + * 2021-02-01-preview: :class:`StorageAccountsOperations` """ api_version = self._get_api_version('storage_accounts') if api_version == '2019-08-01': from .v2019_08_01.operations import StorageAccountsOperations as OperationClass elif api_version == '2020-05-01-preview': from .v2020_05_01_preview.operations import StorageAccountsOperations as OperationClass + elif api_version == '2020-09-01': + from .v2020_09_01.operations import StorageAccountsOperations as OperationClass + elif api_version == '2020-09-01-preview': + from .v2020_09_01_preview.operations import StorageAccountsOperations as OperationClass + elif api_version == '2021-02-01-preview': + from .v2021_02_01_preview.operations import StorageAccountsOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'storage_accounts'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -408,6 +595,9 @@ def triggers(self): * 2019-07-01: :class:`TriggersOperations` * 2019-08-01: :class:`TriggersOperations` * 2020-05-01-preview: :class:`TriggersOperations` + * 2020-09-01: :class:`TriggersOperations` + * 2020-09-01-preview: :class:`TriggersOperations` + * 2021-02-01-preview: :class:`TriggersOperations` """ api_version = self._get_api_version('triggers') if api_version == '2019-03-01': @@ -418,6 +608,12 @@ def triggers(self): from .v2019_08_01.operations import TriggersOperations as OperationClass elif api_version == '2020-05-01-preview': from .v2020_05_01_preview.operations import TriggersOperations as OperationClass + elif api_version == '2020-09-01': + from .v2020_09_01.operations import TriggersOperations as OperationClass + elif api_version == '2020-09-01-preview': + from .v2020_09_01_preview.operations import TriggersOperations as OperationClass + elif api_version == '2021-02-01-preview': + from .v2021_02_01_preview.operations import TriggersOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'triggers'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -430,6 +626,9 @@ def users(self): * 2019-07-01: :class:`UsersOperations` * 2019-08-01: :class:`UsersOperations` * 2020-05-01-preview: :class:`UsersOperations` + * 2020-09-01: :class:`UsersOperations` + * 2020-09-01-preview: :class:`UsersOperations` + * 2021-02-01-preview: :class:`UsersOperations` """ api_version = self._get_api_version('users') if api_version == '2019-03-01': @@ -440,6 +639,12 @@ def users(self): from .v2019_08_01.operations import UsersOperations as OperationClass elif api_version == '2020-05-01-preview': from .v2020_05_01_preview.operations import UsersOperations as OperationClass + elif api_version == '2020-09-01': + from .v2020_09_01.operations import UsersOperations as OperationClass + elif api_version == '2020-09-01-preview': + from .v2020_09_01_preview.operations import UsersOperations as OperationClass + elif api_version == '2021-02-01-preview': + from .v2021_02_01_preview.operations import UsersOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'users'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) diff --git a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/aio/_configuration.py b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/aio/_configuration.py index 3459da57bf3e..38cf64f9ae5c 100644 --- a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/aio/_configuration.py +++ b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/aio/_configuration.py @@ -8,7 +8,7 @@ # Changes may cause incorrect behavior and will be lost if the code is # regenerated. # -------------------------------------------------------------------------- -from typing import Any +from typing import Any, TYPE_CHECKING from azure.core.configuration import Configuration from azure.core.pipeline import policies @@ -16,6 +16,9 @@ from .._version import VERSION +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from azure.core.credentials_async import AsyncTokenCredential class DataBoxEdgeManagementClientConfiguration(Configuration): """Configuration for DataBoxEdgeManagementClient. @@ -31,8 +34,8 @@ class DataBoxEdgeManagementClientConfiguration(Configuration): def __init__( self, - credential, # type: "AsyncTokenCredential" - subscription_id, # type: str + credential: "AsyncTokenCredential", + subscription_id: str, **kwargs # type: Any ) -> None: if credential is None: diff --git a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/aio/_data_box_edge_management_client.py b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/aio/_data_box_edge_management_client.py index b13bb58e88bb..b06c547cfb2e 100644 --- a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/aio/_data_box_edge_management_client.py +++ b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/aio/_data_box_edge_management_client.py @@ -9,13 +9,20 @@ # regenerated. # -------------------------------------------------------------------------- -from azure.mgmt.core import AsyncARMPipelineClient -from msrest import Serializer, Deserializer +from typing import Any, Optional, TYPE_CHECKING +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.mgmt.core import AsyncARMPipelineClient from azure.profiles import KnownProfiles, ProfileDefinition from azure.profiles.multiapiclient import MultiApiClientMixin +from msrest import Deserializer, Serializer + from ._configuration import DataBoxEdgeManagementClientConfiguration +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from azure.core.credentials_async import AsyncTokenCredential + class _SDKClient(object): def __init__(self, *args, **kwargs): """This is a fake class to support current implemetation of MultiApiClientMixin." @@ -38,30 +45,32 @@ class DataBoxEdgeManagementClient(MultiApiClientMixin, _SDKClient): :type credential: ~azure.core.credentials_async.AsyncTokenCredential :param subscription_id: The subscription ID. :type subscription_id: str - :param str api_version: API version to use if no profile is provided, or if - missing in profile. - :param str base_url: Service URL + :param api_version: API version to use if no profile is provided, or if missing in profile. + :type api_version: str + :param base_url: Service URL + :type base_url: str :param profile: A profile definition, from KnownProfiles to dict. :type profile: azure.profiles.KnownProfiles :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. """ - DEFAULT_API_VERSION = '2019-08-01' + DEFAULT_API_VERSION = '2020-09-01' _PROFILE_TAG = "azure.mgmt.databoxedge.DataBoxEdgeManagementClient" LATEST_PROFILE = ProfileDefinition({ _PROFILE_TAG: { None: DEFAULT_API_VERSION, + 'skus': '2019-08-01', }}, _PROFILE_TAG + " latest" ) def __init__( self, - credential, # type: "AsyncTokenCredential" - subscription_id, # type: str - api_version=None, - base_url=None, - profile=KnownProfiles.default, + credential: "AsyncTokenCredential", + subscription_id: str, + api_version: Optional[str] = None, + base_url: Optional[str] = None, + profile: KnownProfiles = KnownProfiles.default, **kwargs # type: Any ) -> None: if not base_url: @@ -85,6 +94,9 @@ def models(cls, api_version=DEFAULT_API_VERSION): * 2019-07-01: :mod:`v2019_07_01.models` * 2019-08-01: :mod:`v2019_08_01.models` * 2020-05-01-preview: :mod:`v2020_05_01_preview.models` + * 2020-09-01: :mod:`v2020_09_01.models` + * 2020-09-01-preview: :mod:`v2020_09_01_preview.models` + * 2021-02-01-preview: :mod:`v2021_02_01_preview.models` """ if api_version == '2019-03-01': from ..v2019_03_01 import models @@ -98,8 +110,36 @@ def models(cls, api_version=DEFAULT_API_VERSION): elif api_version == '2020-05-01-preview': from ..v2020_05_01_preview import models return models + elif api_version == '2020-09-01': + from ..v2020_09_01 import models + return models + elif api_version == '2020-09-01-preview': + from ..v2020_09_01_preview import models + return models + elif api_version == '2021-02-01-preview': + from ..v2021_02_01_preview import models + return models raise ValueError("API version {} is not available".format(api_version)) + @property + def addons(self): + """Instance depends on the API version: + + * 2020-09-01: :class:`AddonsOperations` + * 2020-09-01-preview: :class:`AddonsOperations` + * 2021-02-01-preview: :class:`AddonsOperations` + """ + api_version = self._get_api_version('addons') + if api_version == '2020-09-01': + from ..v2020_09_01.aio.operations import AddonsOperations as OperationClass + elif api_version == '2020-09-01-preview': + from ..v2020_09_01_preview.aio.operations import AddonsOperations as OperationClass + elif api_version == '2021-02-01-preview': + from ..v2021_02_01_preview.aio.operations import AddonsOperations as OperationClass + else: + raise ValueError("API version {} does not have operation group 'addons'".format(api_version)) + return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) + @property def alerts(self): """Instance depends on the API version: @@ -108,6 +148,9 @@ def alerts(self): * 2019-07-01: :class:`AlertsOperations` * 2019-08-01: :class:`AlertsOperations` * 2020-05-01-preview: :class:`AlertsOperations` + * 2020-09-01: :class:`AlertsOperations` + * 2020-09-01-preview: :class:`AlertsOperations` + * 2021-02-01-preview: :class:`AlertsOperations` """ api_version = self._get_api_version('alerts') if api_version == '2019-03-01': @@ -118,6 +161,12 @@ def alerts(self): from ..v2019_08_01.aio.operations import AlertsOperations as OperationClass elif api_version == '2020-05-01-preview': from ..v2020_05_01_preview.aio.operations import AlertsOperations as OperationClass + elif api_version == '2020-09-01': + from ..v2020_09_01.aio.operations import AlertsOperations as OperationClass + elif api_version == '2020-09-01-preview': + from ..v2020_09_01_preview.aio.operations import AlertsOperations as OperationClass + elif api_version == '2021-02-01-preview': + from ..v2021_02_01_preview.aio.operations import AlertsOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'alerts'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -127,10 +176,19 @@ def available_skus(self): """Instance depends on the API version: * 2020-05-01-preview: :class:`AvailableSkusOperations` + * 2020-09-01: :class:`AvailableSkusOperations` + * 2020-09-01-preview: :class:`AvailableSkusOperations` + * 2021-02-01-preview: :class:`AvailableSkusOperations` """ api_version = self._get_api_version('available_skus') if api_version == '2020-05-01-preview': from ..v2020_05_01_preview.aio.operations import AvailableSkusOperations as OperationClass + elif api_version == '2020-09-01': + from ..v2020_09_01.aio.operations import AvailableSkusOperations as OperationClass + elif api_version == '2020-09-01-preview': + from ..v2020_09_01_preview.aio.operations import AvailableSkusOperations as OperationClass + elif api_version == '2021-02-01-preview': + from ..v2021_02_01_preview.aio.operations import AvailableSkusOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'available_skus'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -143,6 +201,9 @@ def bandwidth_schedules(self): * 2019-07-01: :class:`BandwidthSchedulesOperations` * 2019-08-01: :class:`BandwidthSchedulesOperations` * 2020-05-01-preview: :class:`BandwidthSchedulesOperations` + * 2020-09-01: :class:`BandwidthSchedulesOperations` + * 2020-09-01-preview: :class:`BandwidthSchedulesOperations` + * 2021-02-01-preview: :class:`BandwidthSchedulesOperations` """ api_version = self._get_api_version('bandwidth_schedules') if api_version == '2019-03-01': @@ -153,6 +214,12 @@ def bandwidth_schedules(self): from ..v2019_08_01.aio.operations import BandwidthSchedulesOperations as OperationClass elif api_version == '2020-05-01-preview': from ..v2020_05_01_preview.aio.operations import BandwidthSchedulesOperations as OperationClass + elif api_version == '2020-09-01': + from ..v2020_09_01.aio.operations import BandwidthSchedulesOperations as OperationClass + elif api_version == '2020-09-01-preview': + from ..v2020_09_01_preview.aio.operations import BandwidthSchedulesOperations as OperationClass + elif api_version == '2021-02-01-preview': + from ..v2021_02_01_preview.aio.operations import BandwidthSchedulesOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'bandwidth_schedules'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -163,12 +230,21 @@ def containers(self): * 2019-08-01: :class:`ContainersOperations` * 2020-05-01-preview: :class:`ContainersOperations` + * 2020-09-01: :class:`ContainersOperations` + * 2020-09-01-preview: :class:`ContainersOperations` + * 2021-02-01-preview: :class:`ContainersOperations` """ api_version = self._get_api_version('containers') if api_version == '2019-08-01': from ..v2019_08_01.aio.operations import ContainersOperations as OperationClass elif api_version == '2020-05-01-preview': from ..v2020_05_01_preview.aio.operations import ContainersOperations as OperationClass + elif api_version == '2020-09-01': + from ..v2020_09_01.aio.operations import ContainersOperations as OperationClass + elif api_version == '2020-09-01-preview': + from ..v2020_09_01_preview.aio.operations import ContainersOperations as OperationClass + elif api_version == '2021-02-01-preview': + from ..v2021_02_01_preview.aio.operations import ContainersOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'containers'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -181,6 +257,9 @@ def devices(self): * 2019-07-01: :class:`DevicesOperations` * 2019-08-01: :class:`DevicesOperations` * 2020-05-01-preview: :class:`DevicesOperations` + * 2020-09-01: :class:`DevicesOperations` + * 2020-09-01-preview: :class:`DevicesOperations` + * 2021-02-01-preview: :class:`DevicesOperations` """ api_version = self._get_api_version('devices') if api_version == '2019-03-01': @@ -191,6 +270,12 @@ def devices(self): from ..v2019_08_01.aio.operations import DevicesOperations as OperationClass elif api_version == '2020-05-01-preview': from ..v2020_05_01_preview.aio.operations import DevicesOperations as OperationClass + elif api_version == '2020-09-01': + from ..v2020_09_01.aio.operations import DevicesOperations as OperationClass + elif api_version == '2020-09-01-preview': + from ..v2020_09_01_preview.aio.operations import DevicesOperations as OperationClass + elif api_version == '2021-02-01-preview': + from ..v2021_02_01_preview.aio.operations import DevicesOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'devices'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -203,6 +288,9 @@ def jobs(self): * 2019-07-01: :class:`JobsOperations` * 2019-08-01: :class:`JobsOperations` * 2020-05-01-preview: :class:`JobsOperations` + * 2020-09-01: :class:`JobsOperations` + * 2020-09-01-preview: :class:`JobsOperations` + * 2021-02-01-preview: :class:`JobsOperations` """ api_version = self._get_api_version('jobs') if api_version == '2019-03-01': @@ -213,10 +301,35 @@ def jobs(self): from ..v2019_08_01.aio.operations import JobsOperations as OperationClass elif api_version == '2020-05-01-preview': from ..v2020_05_01_preview.aio.operations import JobsOperations as OperationClass + elif api_version == '2020-09-01': + from ..v2020_09_01.aio.operations import JobsOperations as OperationClass + elif api_version == '2020-09-01-preview': + from ..v2020_09_01_preview.aio.operations import JobsOperations as OperationClass + elif api_version == '2021-02-01-preview': + from ..v2021_02_01_preview.aio.operations import JobsOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'jobs'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) + @property + def monitoring_config(self): + """Instance depends on the API version: + + * 2020-09-01: :class:`MonitoringConfigOperations` + * 2020-09-01-preview: :class:`MonitoringConfigOperations` + * 2021-02-01-preview: :class:`MonitoringConfigOperations` + """ + api_version = self._get_api_version('monitoring_config') + if api_version == '2020-09-01': + from ..v2020_09_01.aio.operations import MonitoringConfigOperations as OperationClass + elif api_version == '2020-09-01-preview': + from ..v2020_09_01_preview.aio.operations import MonitoringConfigOperations as OperationClass + elif api_version == '2021-02-01-preview': + from ..v2021_02_01_preview.aio.operations import MonitoringConfigOperations as OperationClass + else: + raise ValueError("API version {} does not have operation group 'monitoring_config'".format(api_version)) + return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) + @property def nodes(self): """Instance depends on the API version: @@ -224,6 +337,9 @@ def nodes(self): * 2019-07-01: :class:`NodesOperations` * 2019-08-01: :class:`NodesOperations` * 2020-05-01-preview: :class:`NodesOperations` + * 2020-09-01: :class:`NodesOperations` + * 2020-09-01-preview: :class:`NodesOperations` + * 2021-02-01-preview: :class:`NodesOperations` """ api_version = self._get_api_version('nodes') if api_version == '2019-07-01': @@ -232,6 +348,12 @@ def nodes(self): from ..v2019_08_01.aio.operations import NodesOperations as OperationClass elif api_version == '2020-05-01-preview': from ..v2020_05_01_preview.aio.operations import NodesOperations as OperationClass + elif api_version == '2020-09-01': + from ..v2020_09_01.aio.operations import NodesOperations as OperationClass + elif api_version == '2020-09-01-preview': + from ..v2020_09_01_preview.aio.operations import NodesOperations as OperationClass + elif api_version == '2021-02-01-preview': + from ..v2021_02_01_preview.aio.operations import NodesOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'nodes'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -244,6 +366,9 @@ def operations(self): * 2019-07-01: :class:`Operations` * 2019-08-01: :class:`Operations` * 2020-05-01-preview: :class:`Operations` + * 2020-09-01: :class:`Operations` + * 2020-09-01-preview: :class:`Operations` + * 2021-02-01-preview: :class:`Operations` """ api_version = self._get_api_version('operations') if api_version == '2019-03-01': @@ -254,6 +379,12 @@ def operations(self): from ..v2019_08_01.aio.operations import Operations as OperationClass elif api_version == '2020-05-01-preview': from ..v2020_05_01_preview.aio.operations import Operations as OperationClass + elif api_version == '2020-09-01': + from ..v2020_09_01.aio.operations import Operations as OperationClass + elif api_version == '2020-09-01-preview': + from ..v2020_09_01_preview.aio.operations import Operations as OperationClass + elif api_version == '2021-02-01-preview': + from ..v2021_02_01_preview.aio.operations import Operations as OperationClass else: raise ValueError("API version {} does not have operation group 'operations'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -266,6 +397,9 @@ def operations_status(self): * 2019-07-01: :class:`OperationsStatusOperations` * 2019-08-01: :class:`OperationsStatusOperations` * 2020-05-01-preview: :class:`OperationsStatusOperations` + * 2020-09-01: :class:`OperationsStatusOperations` + * 2020-09-01-preview: :class:`OperationsStatusOperations` + * 2021-02-01-preview: :class:`OperationsStatusOperations` """ api_version = self._get_api_version('operations_status') if api_version == '2019-03-01': @@ -276,6 +410,12 @@ def operations_status(self): from ..v2019_08_01.aio.operations import OperationsStatusOperations as OperationClass elif api_version == '2020-05-01-preview': from ..v2020_05_01_preview.aio.operations import OperationsStatusOperations as OperationClass + elif api_version == '2020-09-01': + from ..v2020_09_01.aio.operations import OperationsStatusOperations as OperationClass + elif api_version == '2020-09-01-preview': + from ..v2020_09_01_preview.aio.operations import OperationsStatusOperations as OperationClass + elif api_version == '2021-02-01-preview': + from ..v2021_02_01_preview.aio.operations import OperationsStatusOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'operations_status'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -288,6 +428,9 @@ def orders(self): * 2019-07-01: :class:`OrdersOperations` * 2019-08-01: :class:`OrdersOperations` * 2020-05-01-preview: :class:`OrdersOperations` + * 2020-09-01: :class:`OrdersOperations` + * 2020-09-01-preview: :class:`OrdersOperations` + * 2021-02-01-preview: :class:`OrdersOperations` """ api_version = self._get_api_version('orders') if api_version == '2019-03-01': @@ -298,6 +441,12 @@ def orders(self): from ..v2019_08_01.aio.operations import OrdersOperations as OperationClass elif api_version == '2020-05-01-preview': from ..v2020_05_01_preview.aio.operations import OrdersOperations as OperationClass + elif api_version == '2020-09-01': + from ..v2020_09_01.aio.operations import OrdersOperations as OperationClass + elif api_version == '2020-09-01-preview': + from ..v2020_09_01_preview.aio.operations import OrdersOperations as OperationClass + elif api_version == '2021-02-01-preview': + from ..v2021_02_01_preview.aio.operations import OrdersOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'orders'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -310,6 +459,9 @@ def roles(self): * 2019-07-01: :class:`RolesOperations` * 2019-08-01: :class:`RolesOperations` * 2020-05-01-preview: :class:`RolesOperations` + * 2020-09-01: :class:`RolesOperations` + * 2020-09-01-preview: :class:`RolesOperations` + * 2021-02-01-preview: :class:`RolesOperations` """ api_version = self._get_api_version('roles') if api_version == '2019-03-01': @@ -320,6 +472,12 @@ def roles(self): from ..v2019_08_01.aio.operations import RolesOperations as OperationClass elif api_version == '2020-05-01-preview': from ..v2020_05_01_preview.aio.operations import RolesOperations as OperationClass + elif api_version == '2020-09-01': + from ..v2020_09_01.aio.operations import RolesOperations as OperationClass + elif api_version == '2020-09-01-preview': + from ..v2020_09_01_preview.aio.operations import RolesOperations as OperationClass + elif api_version == '2021-02-01-preview': + from ..v2021_02_01_preview.aio.operations import RolesOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'roles'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -332,6 +490,9 @@ def shares(self): * 2019-07-01: :class:`SharesOperations` * 2019-08-01: :class:`SharesOperations` * 2020-05-01-preview: :class:`SharesOperations` + * 2020-09-01: :class:`SharesOperations` + * 2020-09-01-preview: :class:`SharesOperations` + * 2021-02-01-preview: :class:`SharesOperations` """ api_version = self._get_api_version('shares') if api_version == '2019-03-01': @@ -342,6 +503,12 @@ def shares(self): from ..v2019_08_01.aio.operations import SharesOperations as OperationClass elif api_version == '2020-05-01-preview': from ..v2020_05_01_preview.aio.operations import SharesOperations as OperationClass + elif api_version == '2020-09-01': + from ..v2020_09_01.aio.operations import SharesOperations as OperationClass + elif api_version == '2020-09-01-preview': + from ..v2020_09_01_preview.aio.operations import SharesOperations as OperationClass + elif api_version == '2021-02-01-preview': + from ..v2021_02_01_preview.aio.operations import SharesOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'shares'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -370,6 +537,9 @@ def storage_account_credentials(self): * 2019-07-01: :class:`StorageAccountCredentialsOperations` * 2019-08-01: :class:`StorageAccountCredentialsOperations` * 2020-05-01-preview: :class:`StorageAccountCredentialsOperations` + * 2020-09-01: :class:`StorageAccountCredentialsOperations` + * 2020-09-01-preview: :class:`StorageAccountCredentialsOperations` + * 2021-02-01-preview: :class:`StorageAccountCredentialsOperations` """ api_version = self._get_api_version('storage_account_credentials') if api_version == '2019-03-01': @@ -380,6 +550,12 @@ def storage_account_credentials(self): from ..v2019_08_01.aio.operations import StorageAccountCredentialsOperations as OperationClass elif api_version == '2020-05-01-preview': from ..v2020_05_01_preview.aio.operations import StorageAccountCredentialsOperations as OperationClass + elif api_version == '2020-09-01': + from ..v2020_09_01.aio.operations import StorageAccountCredentialsOperations as OperationClass + elif api_version == '2020-09-01-preview': + from ..v2020_09_01_preview.aio.operations import StorageAccountCredentialsOperations as OperationClass + elif api_version == '2021-02-01-preview': + from ..v2021_02_01_preview.aio.operations import StorageAccountCredentialsOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'storage_account_credentials'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -390,12 +566,21 @@ def storage_accounts(self): * 2019-08-01: :class:`StorageAccountsOperations` * 2020-05-01-preview: :class:`StorageAccountsOperations` + * 2020-09-01: :class:`StorageAccountsOperations` + * 2020-09-01-preview: :class:`StorageAccountsOperations` + * 2021-02-01-preview: :class:`StorageAccountsOperations` """ api_version = self._get_api_version('storage_accounts') if api_version == '2019-08-01': from ..v2019_08_01.aio.operations import StorageAccountsOperations as OperationClass elif api_version == '2020-05-01-preview': from ..v2020_05_01_preview.aio.operations import StorageAccountsOperations as OperationClass + elif api_version == '2020-09-01': + from ..v2020_09_01.aio.operations import StorageAccountsOperations as OperationClass + elif api_version == '2020-09-01-preview': + from ..v2020_09_01_preview.aio.operations import StorageAccountsOperations as OperationClass + elif api_version == '2021-02-01-preview': + from ..v2021_02_01_preview.aio.operations import StorageAccountsOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'storage_accounts'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -408,6 +593,9 @@ def triggers(self): * 2019-07-01: :class:`TriggersOperations` * 2019-08-01: :class:`TriggersOperations` * 2020-05-01-preview: :class:`TriggersOperations` + * 2020-09-01: :class:`TriggersOperations` + * 2020-09-01-preview: :class:`TriggersOperations` + * 2021-02-01-preview: :class:`TriggersOperations` """ api_version = self._get_api_version('triggers') if api_version == '2019-03-01': @@ -418,6 +606,12 @@ def triggers(self): from ..v2019_08_01.aio.operations import TriggersOperations as OperationClass elif api_version == '2020-05-01-preview': from ..v2020_05_01_preview.aio.operations import TriggersOperations as OperationClass + elif api_version == '2020-09-01': + from ..v2020_09_01.aio.operations import TriggersOperations as OperationClass + elif api_version == '2020-09-01-preview': + from ..v2020_09_01_preview.aio.operations import TriggersOperations as OperationClass + elif api_version == '2021-02-01-preview': + from ..v2021_02_01_preview.aio.operations import TriggersOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'triggers'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -430,6 +624,9 @@ def users(self): * 2019-07-01: :class:`UsersOperations` * 2019-08-01: :class:`UsersOperations` * 2020-05-01-preview: :class:`UsersOperations` + * 2020-09-01: :class:`UsersOperations` + * 2020-09-01-preview: :class:`UsersOperations` + * 2021-02-01-preview: :class:`UsersOperations` """ api_version = self._get_api_version('users') if api_version == '2019-03-01': @@ -440,6 +637,12 @@ def users(self): from ..v2019_08_01.aio.operations import UsersOperations as OperationClass elif api_version == '2020-05-01-preview': from ..v2020_05_01_preview.aio.operations import UsersOperations as OperationClass + elif api_version == '2020-09-01': + from ..v2020_09_01.aio.operations import UsersOperations as OperationClass + elif api_version == '2020-09-01-preview': + from ..v2020_09_01_preview.aio.operations import UsersOperations as OperationClass + elif api_version == '2021-02-01-preview': + from ..v2021_02_01_preview.aio.operations import UsersOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'users'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) diff --git a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/models.py b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/models.py index 11b69d16b48b..04574f8c176c 100644 --- a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/models.py +++ b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/models.py @@ -5,3 +5,4 @@ # license information. # -------------------------------------------------------------------------- from .v2019_08_01.models import * +from .v2020_09_01.models import * diff --git a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_03_01/_data_box_edge_management_client.py b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_03_01/_data_box_edge_management_client.py index 1fffaa8df0f3..03360a537bb9 100644 --- a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_03_01/_data_box_edge_management_client.py +++ b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_03_01/_data_box_edge_management_client.py @@ -16,6 +16,7 @@ from typing import Any, Optional from azure.core.credentials import TokenCredential + from azure.core.pipeline.transport import HttpRequest, HttpResponse from ._configuration import DataBoxEdgeManagementClientConfiguration from .operations import Operations @@ -37,29 +38,29 @@ class DataBoxEdgeManagementClient(object): """The DataBoxEdge Client. :ivar operations: Operations operations - :vartype operations: azure.mgmt.databoxedge.operations.Operations + :vartype operations: azure.mgmt.databoxedge.v2019_03_01.operations.Operations :ivar devices: DevicesOperations operations - :vartype devices: azure.mgmt.databoxedge.operations.DevicesOperations + :vartype devices: azure.mgmt.databoxedge.v2019_03_01.operations.DevicesOperations :ivar alerts: AlertsOperations operations - :vartype alerts: azure.mgmt.databoxedge.operations.AlertsOperations + :vartype alerts: azure.mgmt.databoxedge.v2019_03_01.operations.AlertsOperations :ivar bandwidth_schedules: BandwidthSchedulesOperations operations - :vartype bandwidth_schedules: azure.mgmt.databoxedge.operations.BandwidthSchedulesOperations + :vartype bandwidth_schedules: azure.mgmt.databoxedge.v2019_03_01.operations.BandwidthSchedulesOperations :ivar jobs: JobsOperations operations - :vartype jobs: azure.mgmt.databoxedge.operations.JobsOperations + :vartype jobs: azure.mgmt.databoxedge.v2019_03_01.operations.JobsOperations :ivar operations_status: OperationsStatusOperations operations - :vartype operations_status: azure.mgmt.databoxedge.operations.OperationsStatusOperations + :vartype operations_status: azure.mgmt.databoxedge.v2019_03_01.operations.OperationsStatusOperations :ivar orders: OrdersOperations operations - :vartype orders: azure.mgmt.databoxedge.operations.OrdersOperations + :vartype orders: azure.mgmt.databoxedge.v2019_03_01.operations.OrdersOperations :ivar roles: RolesOperations operations - :vartype roles: azure.mgmt.databoxedge.operations.RolesOperations + :vartype roles: azure.mgmt.databoxedge.v2019_03_01.operations.RolesOperations :ivar shares: SharesOperations operations - :vartype shares: azure.mgmt.databoxedge.operations.SharesOperations + :vartype shares: azure.mgmt.databoxedge.v2019_03_01.operations.SharesOperations :ivar storage_account_credentials: StorageAccountCredentialsOperations operations - :vartype storage_account_credentials: azure.mgmt.databoxedge.operations.StorageAccountCredentialsOperations + :vartype storage_account_credentials: azure.mgmt.databoxedge.v2019_03_01.operations.StorageAccountCredentialsOperations :ivar triggers: TriggersOperations operations - :vartype triggers: azure.mgmt.databoxedge.operations.TriggersOperations + :vartype triggers: azure.mgmt.databoxedge.v2019_03_01.operations.TriggersOperations :ivar users: UsersOperations operations - :vartype users: azure.mgmt.databoxedge.operations.UsersOperations + :vartype users: azure.mgmt.databoxedge.v2019_03_01.operations.UsersOperations :param credential: Credential needed for the client to connect to Azure. :type credential: ~azure.core.credentials.TokenCredential :param subscription_id: The subscription ID. @@ -111,6 +112,24 @@ def __init__( self.users = UsersOperations( self._client, self._config, self._serialize, self._deserialize) + def _send_request(self, http_request, **kwargs): + # type: (HttpRequest, Any) -> HttpResponse + """Runs the network request through the client's chained policies. + + :param http_request: The network request you want to make. Required. + :type http_request: ~azure.core.pipeline.transport.HttpRequest + :keyword bool stream: Whether the response payload will be streamed. Defaults to True. + :return: The response of your network call. Does not do error handling on your response. + :rtype: ~azure.core.pipeline.transport.HttpResponse + """ + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + http_request.url = self._client.format_url(http_request.url, **path_format_arguments) + stream = kwargs.pop("stream", True) + pipeline_response = self._client._pipeline.run(http_request, stream=stream, **kwargs) + return pipeline_response.http_response + def close(self): # type: () -> None self._client.close() diff --git a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_03_01/_metadata.json b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_03_01/_metadata.json index b7c9e5bf5f70..589c36de0e28 100644 --- a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_03_01/_metadata.json +++ b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_03_01/_metadata.json @@ -9,7 +9,9 @@ "custom_base_url": null, "azure_arm": true, "has_lro_operations": true, - "client_side_validation": false + "client_side_validation": false, + "sync_imports": "{\"typing\": {\"azurecore\": {\"azure.core.credentials\": [\"TokenCredential\"]}}, \"regular\": {\"azurecore\": {\"azure.profiles\": [\"KnownProfiles\", \"ProfileDefinition\"], \"azure.profiles.multiapiclient\": [\"MultiApiClientMixin\"], \"msrest\": [\"Deserializer\", \"Serializer\"], \"azure.mgmt.core\": [\"ARMPipelineClient\"]}, \"local\": {\"._configuration\": [\"DataBoxEdgeManagementClientConfiguration\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}, \"azurecore\": {\"azure.core.pipeline.transport\": [\"HttpRequest\", \"HttpResponse\"]}}}", + "async_imports": "{\"typing\": {\"azurecore\": {\"azure.core.credentials_async\": [\"AsyncTokenCredential\"]}}, \"regular\": {\"azurecore\": {\"azure.profiles\": [\"KnownProfiles\", \"ProfileDefinition\"], \"azure.profiles.multiapiclient\": [\"MultiApiClientMixin\"], \"msrest\": [\"Deserializer\", \"Serializer\"], \"azure.mgmt.core\": [\"AsyncARMPipelineClient\"]}, \"local\": {\"._configuration\": [\"DataBoxEdgeManagementClientConfiguration\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}, \"azurecore\": {\"azure.core.pipeline.transport\": [\"AsyncHttpResponse\", \"HttpRequest\"]}}}" }, "global_parameters": { "sync": { @@ -28,13 +30,13 @@ }, "async": { "credential": { - "signature": "credential, # type: \"AsyncTokenCredential\"", + "signature": "credential: \"AsyncTokenCredential\",", "description": "Credential needed for the client to connect to Azure.", "docstring_type": "~azure.core.credentials_async.AsyncTokenCredential", "required": true }, "subscription_id": { - "signature": "subscription_id, # type: str", + "signature": "subscription_id: str,", "description": "The subscription ID.", "docstring_type": "str", "required": true @@ -42,14 +44,58 @@ }, "constant": { }, - "call": "credential, subscription_id" + "call": "credential, subscription_id", + "service_client_specific": { + "sync": { + "api_version": { + "signature": "api_version=None, # type: Optional[str]", + "description": "API version to use if no profile is provided, or if missing in profile.", + "docstring_type": "str", + "required": false + }, + "base_url": { + "signature": "base_url=None, # type: Optional[str]", + "description": "Service URL", + "docstring_type": "str", + "required": false + }, + "profile": { + "signature": "profile=KnownProfiles.default, # type: KnownProfiles", + "description": "A profile definition, from KnownProfiles to dict.", + "docstring_type": "azure.profiles.KnownProfiles", + "required": false + } + }, + "async": { + "api_version": { + "signature": "api_version: Optional[str] = None,", + "description": "API version to use if no profile is provided, or if missing in profile.", + "docstring_type": "str", + "required": false + }, + "base_url": { + "signature": "base_url: Optional[str] = None,", + "description": "Service URL", + "docstring_type": "str", + "required": false + }, + "profile": { + "signature": "profile: KnownProfiles = KnownProfiles.default,", + "description": "A profile definition, from KnownProfiles to dict.", + "docstring_type": "azure.profiles.KnownProfiles", + "required": false + } + } + } }, "config": { "credential": true, "credential_scopes": ["https://management.azure.com/.default"], "credential_default_policy_type": "BearerTokenCredentialPolicy", "credential_default_policy_type_has_async_version": true, - "credential_key_header_name": null + "credential_key_header_name": null, + "sync_imports": "{\"regular\": {\"azurecore\": {\"azure.core.configuration\": [\"Configuration\"], \"azure.core.pipeline\": [\"policies\"], \"azure.mgmt.core.policies\": [\"ARMHttpLoggingPolicy\"]}, \"local\": {\"._version\": [\"VERSION\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\"]}}, \"typing\": {\"azurecore\": {\"azure.core.credentials\": [\"TokenCredential\"]}}}", + "async_imports": "{\"regular\": {\"azurecore\": {\"azure.core.configuration\": [\"Configuration\"], \"azure.core.pipeline\": [\"policies\"], \"azure.mgmt.core.policies\": [\"ARMHttpLoggingPolicy\"]}, \"local\": {\".._version\": [\"VERSION\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\"]}}, \"typing\": {\"azurecore\": {\"azure.core.credentials_async\": [\"AsyncTokenCredential\"]}}}" }, "operation_groups": { "operations": "Operations", @@ -64,9 +110,5 @@ "storage_account_credentials": "StorageAccountCredentialsOperations", "triggers": "TriggersOperations", "users": "UsersOperations" - }, - "operation_mixins": { - }, - "sync_imports": "None", - "async_imports": "None" + } } \ No newline at end of file diff --git a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_03_01/aio/_data_box_edge_management_client.py b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_03_01/aio/_data_box_edge_management_client.py index 3d95d06a6453..02a2f028deb6 100644 --- a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_03_01/aio/_data_box_edge_management_client.py +++ b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_03_01/aio/_data_box_edge_management_client.py @@ -8,6 +8,7 @@ from typing import Any, Optional, TYPE_CHECKING +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core import AsyncARMPipelineClient from msrest import Deserializer, Serializer @@ -35,29 +36,29 @@ class DataBoxEdgeManagementClient(object): """The DataBoxEdge Client. :ivar operations: Operations operations - :vartype operations: azure.mgmt.databoxedge.aio.operations.Operations + :vartype operations: azure.mgmt.databoxedge.v2019_03_01.aio.operations.Operations :ivar devices: DevicesOperations operations - :vartype devices: azure.mgmt.databoxedge.aio.operations.DevicesOperations + :vartype devices: azure.mgmt.databoxedge.v2019_03_01.aio.operations.DevicesOperations :ivar alerts: AlertsOperations operations - :vartype alerts: azure.mgmt.databoxedge.aio.operations.AlertsOperations + :vartype alerts: azure.mgmt.databoxedge.v2019_03_01.aio.operations.AlertsOperations :ivar bandwidth_schedules: BandwidthSchedulesOperations operations - :vartype bandwidth_schedules: azure.mgmt.databoxedge.aio.operations.BandwidthSchedulesOperations + :vartype bandwidth_schedules: azure.mgmt.databoxedge.v2019_03_01.aio.operations.BandwidthSchedulesOperations :ivar jobs: JobsOperations operations - :vartype jobs: azure.mgmt.databoxedge.aio.operations.JobsOperations + :vartype jobs: azure.mgmt.databoxedge.v2019_03_01.aio.operations.JobsOperations :ivar operations_status: OperationsStatusOperations operations - :vartype operations_status: azure.mgmt.databoxedge.aio.operations.OperationsStatusOperations + :vartype operations_status: azure.mgmt.databoxedge.v2019_03_01.aio.operations.OperationsStatusOperations :ivar orders: OrdersOperations operations - :vartype orders: azure.mgmt.databoxedge.aio.operations.OrdersOperations + :vartype orders: azure.mgmt.databoxedge.v2019_03_01.aio.operations.OrdersOperations :ivar roles: RolesOperations operations - :vartype roles: azure.mgmt.databoxedge.aio.operations.RolesOperations + :vartype roles: azure.mgmt.databoxedge.v2019_03_01.aio.operations.RolesOperations :ivar shares: SharesOperations operations - :vartype shares: azure.mgmt.databoxedge.aio.operations.SharesOperations + :vartype shares: azure.mgmt.databoxedge.v2019_03_01.aio.operations.SharesOperations :ivar storage_account_credentials: StorageAccountCredentialsOperations operations - :vartype storage_account_credentials: azure.mgmt.databoxedge.aio.operations.StorageAccountCredentialsOperations + :vartype storage_account_credentials: azure.mgmt.databoxedge.v2019_03_01.aio.operations.StorageAccountCredentialsOperations :ivar triggers: TriggersOperations operations - :vartype triggers: azure.mgmt.databoxedge.aio.operations.TriggersOperations + :vartype triggers: azure.mgmt.databoxedge.v2019_03_01.aio.operations.TriggersOperations :ivar users: UsersOperations operations - :vartype users: azure.mgmt.databoxedge.aio.operations.UsersOperations + :vartype users: azure.mgmt.databoxedge.v2019_03_01.aio.operations.UsersOperations :param credential: Credential needed for the client to connect to Azure. :type credential: ~azure.core.credentials_async.AsyncTokenCredential :param subscription_id: The subscription ID. @@ -108,6 +109,23 @@ def __init__( self.users = UsersOperations( self._client, self._config, self._serialize, self._deserialize) + async def _send_request(self, http_request: HttpRequest, **kwargs: Any) -> AsyncHttpResponse: + """Runs the network request through the client's chained policies. + + :param http_request: The network request you want to make. Required. + :type http_request: ~azure.core.pipeline.transport.HttpRequest + :keyword bool stream: Whether the response payload will be streamed. Defaults to True. + :return: The response of your network call. Does not do error handling on your response. + :rtype: ~azure.core.pipeline.transport.AsyncHttpResponse + """ + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + http_request.url = self._client.format_url(http_request.url, **path_format_arguments) + stream = kwargs.pop("stream", True) + pipeline_response = await self._client._pipeline.run(http_request, stream=stream, **kwargs) + return pipeline_response.http_response + async def close(self) -> None: await self._client.close() diff --git a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_03_01/aio/operations/_alerts_operations.py b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_03_01/aio/operations/_alerts_operations.py index e9b958a74f48..9b4a8bd1eee8 100644 --- a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_03_01/aio/operations/_alerts_operations.py +++ b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_03_01/aio/operations/_alerts_operations.py @@ -26,7 +26,7 @@ class AlertsOperations: instantiates it for you and attaches it as an attribute. :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.databoxedge.models + :type models: ~azure.mgmt.databoxedge.v2019_03_01.models :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. @@ -55,7 +55,7 @@ def list_by_data_box_edge_device( :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[~azure.mgmt.databoxedge.models.AlertList] + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.databoxedge.v2019_03_01.models.AlertList] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.AlertList"] @@ -134,7 +134,7 @@ async def get( :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: ~azure.mgmt.databoxedge.models.Alert + :rtype: ~azure.mgmt.databoxedge.v2019_03_01.models.Alert :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.Alert"] diff --git a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_03_01/aio/operations/_bandwidth_schedules_operations.py b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_03_01/aio/operations/_bandwidth_schedules_operations.py index 64259f54be4b..daeb130f0fa5 100644 --- a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_03_01/aio/operations/_bandwidth_schedules_operations.py +++ b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_03_01/aio/operations/_bandwidth_schedules_operations.py @@ -28,7 +28,7 @@ class BandwidthSchedulesOperations: instantiates it for you and attaches it as an attribute. :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.databoxedge.models + :type models: ~azure.mgmt.databoxedge.v2019_03_01.models :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. @@ -57,7 +57,7 @@ def list_by_data_box_edge_device( :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[~azure.mgmt.databoxedge.models.BandwidthSchedulesList] + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.databoxedge.v2019_03_01.models.BandwidthSchedulesList] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.BandwidthSchedulesList"] @@ -134,7 +134,7 @@ async def get( :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: ~azure.mgmt.databoxedge.models.BandwidthSchedule + :rtype: ~azure.mgmt.databoxedge.v2019_03_01.models.BandwidthSchedule :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.BandwidthSchedule"] @@ -253,15 +253,15 @@ async def begin_create_or_update( :param resource_group_name: The resource group name. :type resource_group_name: str :param parameters: The bandwidth schedule to be added or updated. - :type parameters: ~azure.mgmt.databoxedge.models.BandwidthSchedule + :type parameters: ~azure.mgmt.databoxedge.v2019_03_01.models.BandwidthSchedule :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: True for ARMPolling, False for no polling, or a - polling object for personal polling strategy + :keyword polling: Pass in True if you'd like the AsyncARMPolling polling method, + False for no polling, or your own initialized polling object for a 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[~azure.mgmt.databoxedge.models.BandwidthSchedule] + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.databoxedge.v2019_03_01.models.BandwidthSchedule] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -375,8 +375,8 @@ async def begin_delete( :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 + :keyword polling: Pass in True if you'd like the AsyncARMPolling polling method, + False for no polling, or your own initialized polling object for a 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) diff --git a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_03_01/aio/operations/_devices_operations.py b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_03_01/aio/operations/_devices_operations.py index 363529f031b4..8d94f947e8d9 100644 --- a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_03_01/aio/operations/_devices_operations.py +++ b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_03_01/aio/operations/_devices_operations.py @@ -28,7 +28,7 @@ class DevicesOperations: instantiates it for you and attaches it as an attribute. :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.databoxedge.models + :type models: ~azure.mgmt.databoxedge.v2019_03_01.models :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. @@ -55,7 +55,7 @@ def list_by_subscription( :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[~azure.mgmt.databoxedge.models.DataBoxEdgeDeviceList] + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.databoxedge.v2019_03_01.models.DataBoxEdgeDeviceList] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.DataBoxEdgeDeviceList"] @@ -130,7 +130,7 @@ def list_by_resource_group( :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[~azure.mgmt.databoxedge.models.DataBoxEdgeDeviceList] + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.databoxedge.v2019_03_01.models.DataBoxEdgeDeviceList] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.DataBoxEdgeDeviceList"] @@ -205,7 +205,7 @@ async def get( :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: ~azure.mgmt.databoxedge.models.DataBoxEdgeDevice + :rtype: ~azure.mgmt.databoxedge.v2019_03_01.models.DataBoxEdgeDevice :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.DataBoxEdgeDevice"] @@ -316,15 +316,15 @@ async def begin_create_or_update( :param resource_group_name: The resource group name. :type resource_group_name: str :param data_box_edge_device: The resource object. - :type data_box_edge_device: ~azure.mgmt.databoxedge.models.DataBoxEdgeDevice + :type data_box_edge_device: ~azure.mgmt.databoxedge.v2019_03_01.models.DataBoxEdgeDevice :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 + :keyword polling: Pass in True if you'd like the AsyncARMPolling polling method, + False for no polling, or your own initialized polling object for a 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[~azure.mgmt.databoxedge.models.DataBoxEdgeDevice] + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.databoxedge.v2019_03_01.models.DataBoxEdgeDevice] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -431,8 +431,8 @@ async def begin_delete( :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 + :keyword polling: Pass in True if you'd like the AsyncARMPolling polling method, + False for no polling, or your own initialized polling object for a 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) @@ -495,10 +495,10 @@ async def update( :param resource_group_name: The resource group name. :type resource_group_name: str :param parameters: The resource parameters. - :type parameters: ~azure.mgmt.databoxedge.models.DataBoxEdgeDevicePatch + :type parameters: ~azure.mgmt.databoxedge.v2019_03_01.models.DataBoxEdgeDevicePatch :keyword callable cls: A custom type or function that will be passed the direct response :return: DataBoxEdgeDevice, or the result of cls(response) - :rtype: ~azure.mgmt.databoxedge.models.DataBoxEdgeDevice + :rtype: ~azure.mgmt.databoxedge.v2019_03_01.models.DataBoxEdgeDevice :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.DataBoxEdgeDevice"] @@ -607,8 +607,8 @@ async def begin_download_updates( :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 + :keyword polling: Pass in True if you'd like the AsyncARMPolling polling method, + False for no polling, or your own initialized polling object for a 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) @@ -671,7 +671,7 @@ async def get_extended_information( :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: ~azure.mgmt.databoxedge.models.DataBoxEdgeDeviceExtendedInfo + :rtype: ~azure.mgmt.databoxedge.v2019_03_01.models.DataBoxEdgeDeviceExtendedInfo :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.DataBoxEdgeDeviceExtendedInfo"] @@ -775,8 +775,8 @@ async def begin_install_updates( :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 + :keyword polling: Pass in True if you'd like the AsyncARMPolling polling method, + False for no polling, or your own initialized polling object for a 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) @@ -839,7 +839,7 @@ async def get_network_settings( :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: ~azure.mgmt.databoxedge.models.NetworkSettings + :rtype: ~azure.mgmt.databoxedge.v2019_03_01.models.NetworkSettings :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkSettings"] @@ -943,8 +943,8 @@ async def begin_scan_for_updates( :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 + :keyword polling: Pass in True if you'd like the AsyncARMPolling polling method, + False for no polling, or your own initialized polling object for a 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) @@ -1057,11 +1057,11 @@ async def begin_create_or_update_security_settings( :param resource_group_name: The resource group name. :type resource_group_name: str :param security_settings: The security settings. - :type security_settings: ~azure.mgmt.databoxedge.models.SecuritySettings + :type security_settings: ~azure.mgmt.databoxedge.v2019_03_01.models.SecuritySettings :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: True for ARMPolling, False for no polling, or a - polling object for personal polling strategy + :keyword polling: Pass in True if you'd like the AsyncARMPolling polling method, + False for no polling, or your own initialized polling object for a 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) @@ -1128,7 +1128,7 @@ async def get_update_summary( :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: ~azure.mgmt.databoxedge.models.UpdateSummary + :rtype: ~azure.mgmt.databoxedge.v2019_03_01.models.UpdateSummary :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.UpdateSummary"] @@ -1186,10 +1186,10 @@ async def upload_certificate( :param resource_group_name: The resource group name. :type resource_group_name: str :param parameters: The upload certificate request. - :type parameters: ~azure.mgmt.databoxedge.models.UploadCertificateRequest + :type parameters: ~azure.mgmt.databoxedge.v2019_03_01.models.UploadCertificateRequest :keyword callable cls: A custom type or function that will be passed the direct response :return: UploadCertificateResponse, or the result of cls(response) - :rtype: ~azure.mgmt.databoxedge.models.UploadCertificateResponse + :rtype: ~azure.mgmt.databoxedge.v2019_03_01.models.UploadCertificateResponse :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.UploadCertificateResponse"] diff --git a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_03_01/aio/operations/_jobs_operations.py b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_03_01/aio/operations/_jobs_operations.py index 72cd5502030c..235b4f5cd3cf 100644 --- a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_03_01/aio/operations/_jobs_operations.py +++ b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_03_01/aio/operations/_jobs_operations.py @@ -25,7 +25,7 @@ class JobsOperations: instantiates it for you and attaches it as an attribute. :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.databoxedge.models + :type models: ~azure.mgmt.databoxedge.v2019_03_01.models :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. @@ -59,7 +59,7 @@ async def get( :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: ~azure.mgmt.databoxedge.models.Job + :rtype: ~azure.mgmt.databoxedge.v2019_03_01.models.Job :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.Job"] diff --git a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_03_01/aio/operations/_operations.py b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_03_01/aio/operations/_operations.py index 00d071f25815..196ad6bf122d 100644 --- a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_03_01/aio/operations/_operations.py +++ b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_03_01/aio/operations/_operations.py @@ -26,7 +26,7 @@ class Operations: instantiates it for you and attaches it as an attribute. :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.databoxedge.models + :type models: ~azure.mgmt.databoxedge.v2019_03_01.models :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. @@ -51,7 +51,7 @@ def list( :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[~azure.mgmt.databoxedge.models.OperationsList] + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.databoxedge.v2019_03_01.models.OperationsList] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationsList"] diff --git a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_03_01/aio/operations/_operations_status_operations.py b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_03_01/aio/operations/_operations_status_operations.py index d480c8f1dffe..4eb25dfba79d 100644 --- a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_03_01/aio/operations/_operations_status_operations.py +++ b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_03_01/aio/operations/_operations_status_operations.py @@ -25,7 +25,7 @@ class OperationsStatusOperations: instantiates it for you and attaches it as an attribute. :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.databoxedge.models + :type models: ~azure.mgmt.databoxedge.v2019_03_01.models :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. @@ -59,7 +59,7 @@ async def get( :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: ~azure.mgmt.databoxedge.models.Job + :rtype: ~azure.mgmt.databoxedge.v2019_03_01.models.Job :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.Job"] diff --git a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_03_01/aio/operations/_orders_operations.py b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_03_01/aio/operations/_orders_operations.py index d3c4ead468e5..0fe065e6e1bf 100644 --- a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_03_01/aio/operations/_orders_operations.py +++ b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_03_01/aio/operations/_orders_operations.py @@ -28,7 +28,7 @@ class OrdersOperations: instantiates it for you and attaches it as an attribute. :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.databoxedge.models + :type models: ~azure.mgmt.databoxedge.v2019_03_01.models :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. @@ -59,7 +59,7 @@ def list_by_data_box_edge_device( :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[~azure.mgmt.databoxedge.models.OrderList] + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.databoxedge.v2019_03_01.models.OrderList] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.OrderList"] @@ -135,7 +135,7 @@ async def get( :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: ~azure.mgmt.databoxedge.models.Order + :rtype: ~azure.mgmt.databoxedge.v2019_03_01.models.Order :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.Order"] @@ -250,15 +250,15 @@ async def begin_create_or_update( :param resource_group_name: The resource group name. :type resource_group_name: str :param order: The order to be created or updated. - :type order: ~azure.mgmt.databoxedge.models.Order + :type order: ~azure.mgmt.databoxedge.v2019_03_01.models.Order :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: True for ARMPolling, False for no polling, or a - polling object for personal polling strategy + :keyword polling: Pass in True if you'd like the AsyncARMPolling polling method, + False for no polling, or your own initialized polling object for a 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[~azure.mgmt.databoxedge.models.Order] + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.databoxedge.v2019_03_01.models.Order] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -367,8 +367,8 @@ async def begin_delete( :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 + :keyword polling: Pass in True if you'd like the AsyncARMPolling polling method, + False for no polling, or your own initialized polling object for a 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) diff --git a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_03_01/aio/operations/_roles_operations.py b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_03_01/aio/operations/_roles_operations.py index e2af6b264eb7..0ba335a802c4 100644 --- a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_03_01/aio/operations/_roles_operations.py +++ b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_03_01/aio/operations/_roles_operations.py @@ -28,7 +28,7 @@ class RolesOperations: instantiates it for you and attaches it as an attribute. :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.databoxedge.models + :type models: ~azure.mgmt.databoxedge.v2019_03_01.models :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. @@ -57,7 +57,7 @@ def list_by_data_box_edge_device( :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[~azure.mgmt.databoxedge.models.RoleList] + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.databoxedge.v2019_03_01.models.RoleList] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.RoleList"] @@ -134,7 +134,7 @@ async def get( :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: ~azure.mgmt.databoxedge.models.Role + :rtype: ~azure.mgmt.databoxedge.v2019_03_01.models.Role :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.Role"] @@ -253,15 +253,15 @@ async def begin_create_or_update( :param resource_group_name: The resource group name. :type resource_group_name: str :param role: The role properties. - :type role: ~azure.mgmt.databoxedge.models.Role + :type role: ~azure.mgmt.databoxedge.v2019_03_01.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 + :keyword polling: Pass in True if you'd like the AsyncARMPolling polling method, + False for no polling, or your own initialized polling object for a 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[~azure.mgmt.databoxedge.models.Role] + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.databoxedge.v2019_03_01.models.Role] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -375,8 +375,8 @@ async def begin_delete( :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 + :keyword polling: Pass in True if you'd like the AsyncARMPolling polling method, + False for no polling, or your own initialized polling object for a 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) diff --git a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_03_01/aio/operations/_shares_operations.py b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_03_01/aio/operations/_shares_operations.py index 28650efb18f2..01dbe891f708 100644 --- a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_03_01/aio/operations/_shares_operations.py +++ b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_03_01/aio/operations/_shares_operations.py @@ -28,7 +28,7 @@ class SharesOperations: instantiates it for you and attaches it as an attribute. :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.databoxedge.models + :type models: ~azure.mgmt.databoxedge.v2019_03_01.models :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. @@ -59,7 +59,7 @@ def list_by_data_box_edge_device( :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[~azure.mgmt.databoxedge.models.ShareList] + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.databoxedge.v2019_03_01.models.ShareList] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.ShareList"] @@ -138,7 +138,7 @@ async def get( :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: ~azure.mgmt.databoxedge.models.Share + :rtype: ~azure.mgmt.databoxedge.v2019_03_01.models.Share :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.Share"] @@ -259,15 +259,15 @@ async def begin_create_or_update( :param resource_group_name: The resource group name. :type resource_group_name: str :param share: The share properties. - :type share: ~azure.mgmt.databoxedge.models.Share + :type share: ~azure.mgmt.databoxedge.v2019_03_01.models.Share :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: True for ARMPolling, False for no polling, or a - polling object for personal polling strategy + :keyword polling: Pass in True if you'd like the AsyncARMPolling polling method, + False for no polling, or your own initialized polling object for a 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[~azure.mgmt.databoxedge.models.Share] + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.databoxedge.v2019_03_01.models.Share] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -381,8 +381,8 @@ async def begin_delete( :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 + :keyword polling: Pass in True if you'd like the AsyncARMPolling polling method, + False for no polling, or your own initialized polling object for a 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) @@ -498,8 +498,8 @@ async def begin_refresh( :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 + :keyword polling: Pass in True if you'd like the AsyncARMPolling polling method, + False for no polling, or your own initialized polling object for a 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) diff --git a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_03_01/aio/operations/_storage_account_credentials_operations.py b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_03_01/aio/operations/_storage_account_credentials_operations.py index 9c8c5e3c3653..df213b29b49d 100644 --- a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_03_01/aio/operations/_storage_account_credentials_operations.py +++ b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_03_01/aio/operations/_storage_account_credentials_operations.py @@ -28,7 +28,7 @@ class StorageAccountCredentialsOperations: instantiates it for you and attaches it as an attribute. :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.databoxedge.models + :type models: ~azure.mgmt.databoxedge.v2019_03_01.models :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. @@ -59,7 +59,7 @@ def list_by_data_box_edge_device( :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[~azure.mgmt.databoxedge.models.StorageAccountCredentialList] + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.databoxedge.v2019_03_01.models.StorageAccountCredentialList] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.StorageAccountCredentialList"] @@ -136,7 +136,7 @@ async def get( :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: ~azure.mgmt.databoxedge.models.StorageAccountCredential + :rtype: ~azure.mgmt.databoxedge.v2019_03_01.models.StorageAccountCredential :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.StorageAccountCredential"] @@ -255,15 +255,15 @@ async def begin_create_or_update( :param resource_group_name: The resource group name. :type resource_group_name: str :param storage_account_credential: The storage account credential. - :type storage_account_credential: ~azure.mgmt.databoxedge.models.StorageAccountCredential + :type storage_account_credential: ~azure.mgmt.databoxedge.v2019_03_01.models.StorageAccountCredential :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: True for ARMPolling, False for no polling, or a - polling object for personal polling strategy + :keyword polling: Pass in True if you'd like the AsyncARMPolling polling method, + False for no polling, or your own initialized polling object for a 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[~azure.mgmt.databoxedge.models.StorageAccountCredential] + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.databoxedge.v2019_03_01.models.StorageAccountCredential] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -377,8 +377,8 @@ async def begin_delete( :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 + :keyword polling: Pass in True if you'd like the AsyncARMPolling polling method, + False for no polling, or your own initialized polling object for a 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) diff --git a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_03_01/aio/operations/_triggers_operations.py b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_03_01/aio/operations/_triggers_operations.py index 703fdbb28ebe..33ecf8aa7a8d 100644 --- a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_03_01/aio/operations/_triggers_operations.py +++ b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_03_01/aio/operations/_triggers_operations.py @@ -28,7 +28,7 @@ class TriggersOperations: instantiates it for you and attaches it as an attribute. :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.databoxedge.models + :type models: ~azure.mgmt.databoxedge.v2019_03_01.models :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. @@ -61,7 +61,7 @@ def list_by_data_box_edge_device( :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 TriggerList or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.databoxedge.models.TriggerList] + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.databoxedge.v2019_03_01.models.TriggerList] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.TriggerList"] @@ -140,7 +140,7 @@ async def get( :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: ~azure.mgmt.databoxedge.models.Trigger + :rtype: ~azure.mgmt.databoxedge.v2019_03_01.models.Trigger :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.Trigger"] @@ -259,15 +259,15 @@ async def begin_create_or_update( :param resource_group_name: The resource group name. :type resource_group_name: str :param trigger: The trigger. - :type trigger: ~azure.mgmt.databoxedge.models.Trigger + :type trigger: ~azure.mgmt.databoxedge.v2019_03_01.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 + :keyword polling: Pass in True if you'd like the AsyncARMPolling polling method, + False for no polling, or your own initialized polling object for a 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[~azure.mgmt.databoxedge.models.Trigger] + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.databoxedge.v2019_03_01.models.Trigger] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -381,8 +381,8 @@ async def begin_delete( :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 + :keyword polling: Pass in True if you'd like the AsyncARMPolling polling method, + False for no polling, or your own initialized polling object for a 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) diff --git a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_03_01/aio/operations/_users_operations.py b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_03_01/aio/operations/_users_operations.py index 3346ab0f28e3..303c99d24052 100644 --- a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_03_01/aio/operations/_users_operations.py +++ b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_03_01/aio/operations/_users_operations.py @@ -28,7 +28,7 @@ class UsersOperations: instantiates it for you and attaches it as an attribute. :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.databoxedge.models + :type models: ~azure.mgmt.databoxedge.v2019_03_01.models :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. @@ -57,7 +57,7 @@ def list_by_data_box_edge_device( :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 UserList or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.databoxedge.models.UserList] + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.databoxedge.v2019_03_01.models.UserList] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.UserList"] @@ -134,7 +134,7 @@ async def get( :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: ~azure.mgmt.databoxedge.models.User + :rtype: ~azure.mgmt.databoxedge.v2019_03_01.models.User :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.User"] @@ -253,15 +253,15 @@ async def begin_create_or_update( :param resource_group_name: The resource group name. :type resource_group_name: str :param user: The user details. - :type user: ~azure.mgmt.databoxedge.models.User + :type user: ~azure.mgmt.databoxedge.v2019_03_01.models.User :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: True for ARMPolling, False for no polling, or a - polling object for personal polling strategy + :keyword polling: Pass in True if you'd like the AsyncARMPolling polling method, + False for no polling, or your own initialized polling object for a 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[~azure.mgmt.databoxedge.models.User] + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.databoxedge.v2019_03_01.models.User] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -375,8 +375,8 @@ async def begin_delete( :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 + :keyword polling: Pass in True if you'd like the AsyncARMPolling polling method, + False for no polling, or your own initialized polling object for a 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) diff --git a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_03_01/models/_models.py b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_03_01/models/_models.py index 8a6a8c0b789e..721721347494 100644 --- a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_03_01/models/_models.py +++ b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_03_01/models/_models.py @@ -118,9 +118,9 @@ class Alert(ARMBaseModel): :vartype recommendation: str :ivar severity: Severity of the alert. Possible values include: "Informational", "Warning", "Critical". - :vartype severity: str or ~azure.mgmt.databoxedge.models.AlertSeverity + :vartype severity: str or ~azure.mgmt.databoxedge.v2019_03_01.models.AlertSeverity :ivar error_details: Error details of the alert. - :vartype error_details: ~azure.mgmt.databoxedge.models.AlertErrorDetails + :vartype error_details: ~azure.mgmt.databoxedge.v2019_03_01.models.AlertErrorDetails :ivar detailed_information: Alert details. :vartype detailed_information: dict[str, str] """ @@ -206,7 +206,7 @@ class AlertList(msrest.serialization.Model): Variables are only populated by the server, and will be ignored when sending a request. :ivar value: The value. - :vartype value: list[~azure.mgmt.databoxedge.models.Alert] + :vartype value: list[~azure.mgmt.databoxedge.v2019_03_01.models.Alert] :ivar next_link: Link to the next set of results. :vartype next_link: str """ @@ -242,7 +242,8 @@ class AsymmetricEncryptedSecret(msrest.serialization.Model): :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 ~azure.mgmt.databoxedge.models.EncryptionAlgorithm + :type encryption_algorithm: str or + ~azure.mgmt.databoxedge.v2019_03_01.models.EncryptionAlgorithm """ _validation = { @@ -270,7 +271,7 @@ class Authentication(msrest.serialization.Model): """Authentication mechanism for IoT devices. :param symmetric_key: Symmetric key for authentication. - :type symmetric_key: ~azure.mgmt.databoxedge.models.SymmetricKey + :type symmetric_key: ~azure.mgmt.databoxedge.v2019_03_01.models.SymmetricKey """ _attribute_map = { @@ -298,7 +299,7 @@ class AzureContainerInfo(msrest.serialization.Model): :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 ~azure.mgmt.databoxedge.models.AzureContainerDataFormat + :type data_format: str or ~azure.mgmt.databoxedge.v2019_03_01.models.AzureContainerDataFormat """ _validation = { @@ -343,7 +344,7 @@ class BandwidthSchedule(ARMBaseModel): :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 ~azure.mgmt.databoxedge.models.DayOfWeek] + :type days: list[str or ~azure.mgmt.databoxedge.v2019_03_01.models.DayOfWeek] """ _validation = { @@ -383,7 +384,7 @@ class BandwidthSchedulesList(msrest.serialization.Model): 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[~azure.mgmt.databoxedge.models.BandwidthSchedule] + :vartype value: list[~azure.mgmt.databoxedge.v2019_03_01.models.BandwidthSchedule] :ivar next_link: Link to the next set of results. :vartype next_link: str """ @@ -416,7 +417,7 @@ class ClientAccessRight(msrest.serialization.Model): :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 ~azure.mgmt.databoxedge.models.ClientPermissionType + :type access_permission: str or ~azure.mgmt.databoxedge.v2019_03_01.models.ClientPermissionType """ _validation = { @@ -448,7 +449,7 @@ class CloudErrorBody(msrest.serialization.Model): interface. :type message: str :param details: A list of additional details about the error. - :type details: list[~azure.mgmt.databoxedge.models.CloudErrorBody] + :type details: list[~azure.mgmt.databoxedge.v2019_03_01.models.CloudErrorBody] """ _attribute_map = { @@ -529,14 +530,14 @@ class DataBoxEdgeDevice(ARMBaseModel): to view and group this device (across resource groups). :type tags: dict[str, str] :param sku: The SKU type. - :type sku: ~azure.mgmt.databoxedge.models.Sku + :type sku: ~azure.mgmt.databoxedge.v2019_03_01.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". :type data_box_edge_device_status: str or - ~azure.mgmt.databoxedge.models.DataBoxEdgeDeviceStatus + ~azure.mgmt.databoxedge.v2019_03_01.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. @@ -545,7 +546,7 @@ class DataBoxEdgeDevice(ARMBaseModel): :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 ~azure.mgmt.databoxedge.models.DeviceType + :vartype device_type: str or ~azure.mgmt.databoxedge.v2019_03_01.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. @@ -561,7 +562,8 @@ class DataBoxEdgeDevice(ARMBaseModel): :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 ~azure.mgmt.databoxedge.models.RoleTypes] + :vartype configured_role_types: list[str or + ~azure.mgmt.databoxedge.v2019_03_01.models.RoleTypes] """ _validation = { @@ -679,7 +681,7 @@ class DataBoxEdgeDeviceList(msrest.serialization.Model): 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[~azure.mgmt.databoxedge.models.DataBoxEdgeDevice] + :vartype value: list[~azure.mgmt.databoxedge.v2019_03_01.models.DataBoxEdgeDevice] :ivar next_link: Link to the next set of results. :vartype next_link: str """ @@ -740,7 +742,7 @@ class Trigger(ARMBaseModel): :vartype type: str :param kind: Required. Trigger Kind.Constant filled by server. Possible values include: "FileEvent", "PeriodicTimerEvent". - :type kind: str or ~azure.mgmt.databoxedge.models.TriggerEventType + :type kind: str or ~azure.mgmt.databoxedge.v2019_03_01.models.TriggerEventType """ _validation = { @@ -784,11 +786,11 @@ class FileEventTrigger(Trigger): :vartype type: str :param kind: Required. Trigger Kind.Constant filled by server. Possible values include: "FileEvent", "PeriodicTimerEvent". - :type kind: str or ~azure.mgmt.databoxedge.models.TriggerEventType + :type kind: str or ~azure.mgmt.databoxedge.v2019_03_01.models.TriggerEventType :param source_info: Required. File event source details. - :type source_info: ~azure.mgmt.databoxedge.models.FileSourceInfo + :type source_info: ~azure.mgmt.databoxedge.v2019_03_01.models.FileSourceInfo :param sink_info: Required. Role sink info. - :type sink_info: ~azure.mgmt.databoxedge.models.RoleSinkInfo + :type sink_info: ~azure.mgmt.databoxedge.v2019_03_01.models.RoleSinkInfo :param custom_context_tag: A custom context tag typically used to correlate the trigger against its usage. For example, if a periodic timer trigger is intended for certain specific IoT modules in the device, the tag can be the name or the image URL of the module. @@ -860,7 +862,7 @@ class IoTDeviceInfo(msrest.serialization.Model): :param io_t_host_hub: Required. Host name for the IoT hub associated to the device. :type io_t_host_hub: str :param authentication: IoT device authentication info. - :type authentication: ~azure.mgmt.databoxedge.models.Authentication + :type authentication: ~azure.mgmt.databoxedge.v2019_03_01.models.Authentication """ _validation = { @@ -902,7 +904,7 @@ class Role(ARMBaseModel): :vartype type: str :param kind: Required. Role type.Constant filled by server. Possible values include: "IOT", "ASA", "Functions", "Cognitive". - :type kind: str or ~azure.mgmt.databoxedge.models.RoleTypes + :type kind: str or ~azure.mgmt.databoxedge.v2019_03_01.models.RoleTypes """ _validation = { @@ -946,19 +948,19 @@ class IoTRole(Role): :vartype type: str :param kind: Required. Role type.Constant filled by server. Possible values include: "IOT", "ASA", "Functions", "Cognitive". - :type kind: str or ~azure.mgmt.databoxedge.models.RoleTypes + :type kind: str or ~azure.mgmt.databoxedge.v2019_03_01.models.RoleTypes :param host_platform: Host OS supported by the IoT role. Possible values include: "Windows", "Linux". - :type host_platform: str or ~azure.mgmt.databoxedge.models.PlatformType + :type host_platform: str or ~azure.mgmt.databoxedge.v2019_03_01.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: ~azure.mgmt.databoxedge.models.IoTDeviceInfo + :type io_t_device_details: ~azure.mgmt.databoxedge.v2019_03_01.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: ~azure.mgmt.databoxedge.models.IoTDeviceInfo + :type io_t_edge_device_details: ~azure.mgmt.databoxedge.v2019_03_01.models.IoTDeviceInfo :param share_mappings: Mount points of shares in role(s). - :type share_mappings: list[~azure.mgmt.databoxedge.models.MountPointMap] + :type share_mappings: list[~azure.mgmt.databoxedge.v2019_03_01.models.MountPointMap] :param role_status: Role status. Possible values include: "Enabled", "Disabled". - :type role_status: str or ~azure.mgmt.databoxedge.models.RoleStatus + :type role_status: str or ~azure.mgmt.databoxedge.v2019_03_01.models.RoleStatus """ _validation = { @@ -1076,7 +1078,7 @@ class Job(msrest.serialization.Model): :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 ~azure.mgmt.databoxedge.models.JobStatus + :vartype status: str or ~azure.mgmt.databoxedge.v2019_03_01.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. @@ -1084,19 +1086,19 @@ class Job(msrest.serialization.Model): :ivar percent_complete: The percentage of the job that is complete. :vartype percent_complete: int :ivar error: The error details. - :vartype error: ~azure.mgmt.databoxedge.models.JobErrorDetails + :vartype error: ~azure.mgmt.databoxedge.v2019_03_01.models.JobErrorDetails :ivar job_type: The type of the job. Possible values include: "Invalid", "ScanForUpdates", "DownloadUpdates", "InstallUpdates", "RefreshShare". - :vartype job_type: str or ~azure.mgmt.databoxedge.models.JobType + :vartype job_type: str or ~azure.mgmt.databoxedge.v2019_03_01.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 ~azure.mgmt.databoxedge.models.UpdateOperationStage + :vartype current_stage: str or ~azure.mgmt.databoxedge.v2019_03_01.models.UpdateOperationStage :ivar download_progress: The download progress. - :vartype download_progress: ~azure.mgmt.databoxedge.models.UpdateDownloadProgress + :vartype download_progress: ~azure.mgmt.databoxedge.v2019_03_01.models.UpdateDownloadProgress :ivar install_progress: The install progress. - :vartype install_progress: ~azure.mgmt.databoxedge.models.UpdateInstallProgress + :vartype install_progress: ~azure.mgmt.databoxedge.v2019_03_01.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 @@ -1175,7 +1177,7 @@ class JobErrorDetails(msrest.serialization.Model): 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[~azure.mgmt.databoxedge.models.JobErrorItem] + :vartype error_details: list[~azure.mgmt.databoxedge.v2019_03_01.models.JobErrorItem] :ivar code: The code intended for programmatic access. :vartype code: str :ivar message: The message that describes the error in detail. @@ -1277,23 +1279,24 @@ class MetricSpecificationV1(msrest.serialization.Model): :type display_description: str :param unit: Metric units. Possible values include: "NotSpecified", "Percent", "Count", "Seconds", "Milliseconds", "Bytes", "BytesPerSecond", "CountPerSecond". - :type unit: str or ~azure.mgmt.databoxedge.models.MetricUnit + :type unit: str or ~azure.mgmt.databoxedge.v2019_03_01.models.MetricUnit :param aggregation_type: Metric aggregation type. Possible values include: "NotSpecified", "None", "Average", "Minimum", "Maximum", "Total", "Count". - :type aggregation_type: str or ~azure.mgmt.databoxedge.models.MetricAggregationType + :type aggregation_type: str or ~azure.mgmt.databoxedge.v2019_03_01.models.MetricAggregationType :param dimensions: Metric dimensions, other than default dimension which is resource. - :type dimensions: list[~azure.mgmt.databoxedge.models.MetricDimensionV1] + :type dimensions: list[~azure.mgmt.databoxedge.v2019_03_01.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 ~azure.mgmt.databoxedge.models.MetricCategory + :type category: str or ~azure.mgmt.databoxedge.v2019_03_01.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 ~azure.mgmt.databoxedge.models.TimeGrain] + :type supported_time_grain_types: list[str or + ~azure.mgmt.databoxedge.v2019_03_01.models.TimeGrain] :param supported_aggregation_types: Support metric aggregation type. :type supported_aggregation_types: list[str or - ~azure.mgmt.databoxedge.models.MetricAggregationType] + ~azure.mgmt.databoxedge.v2019_03_01.models.MetricAggregationType] """ _attribute_map = { @@ -1342,7 +1345,7 @@ class MountPointMap(msrest.serialization.Model): :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 ~azure.mgmt.databoxedge.models.RoleTypes + :vartype role_type: str or ~azure.mgmt.databoxedge.v2019_03_01.models.RoleTypes """ _validation = { @@ -1378,7 +1381,7 @@ class NetworkAdapter(msrest.serialization.Model): :ivar adapter_id: Instance ID of network adapter. :vartype adapter_id: str :ivar adapter_position: Hardware position of network adapter. - :vartype adapter_position: ~azure.mgmt.databoxedge.models.NetworkAdapterPosition + :vartype adapter_position: ~azure.mgmt.databoxedge.v2019_03_01.models.NetworkAdapterPosition :ivar index: Logical index of the adapter. :vartype index: int :ivar node_id: Node ID of the network adapter. @@ -1393,17 +1396,17 @@ class NetworkAdapter(msrest.serialization.Model): :vartype link_speed: long :ivar status: Value indicating whether this adapter is valid. Possible values include: "Inactive", "Active". - :vartype status: str or ~azure.mgmt.databoxedge.models.NetworkAdapterStatus + :vartype status: str or ~azure.mgmt.databoxedge.v2019_03_01.models.NetworkAdapterStatus :param rdma_status: Value indicating whether this adapter is RDMA capable. Possible values include: "Incapable", "Capable". - :type rdma_status: str or ~azure.mgmt.databoxedge.models.NetworkAdapterRDMAStatus + :type rdma_status: str or ~azure.mgmt.databoxedge.v2019_03_01.models.NetworkAdapterRDMAStatus :param dhcp_status: Value indicating whether this adapter has DHCP enabled. Possible values include: "Disabled", "Enabled". - :type dhcp_status: str or ~azure.mgmt.databoxedge.models.NetworkAdapterDHCPStatus + :type dhcp_status: str or ~azure.mgmt.databoxedge.v2019_03_01.models.NetworkAdapterDHCPStatus :ivar ipv4_configuration: The IPv4 configuration of the network adapter. - :vartype ipv4_configuration: ~azure.mgmt.databoxedge.models.Ipv4Config + :vartype ipv4_configuration: ~azure.mgmt.databoxedge.v2019_03_01.models.Ipv4Config :ivar ipv6_configuration: The IPv6 configuration of the network adapter. - :vartype ipv6_configuration: ~azure.mgmt.databoxedge.models.Ipv6Config + :vartype ipv6_configuration: ~azure.mgmt.databoxedge.v2019_03_01.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. @@ -1472,7 +1475,7 @@ class NetworkAdapterPosition(msrest.serialization.Model): 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 ~azure.mgmt.databoxedge.models.NetworkGroup + :vartype network_group: str or ~azure.mgmt.databoxedge.v2019_03_01.models.NetworkGroup :ivar port: The port. :vartype port: int """ @@ -1508,7 +1511,7 @@ class NetworkSettings(ARMBaseModel): :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[~azure.mgmt.databoxedge.models.NetworkAdapter] + :vartype network_adapters: list[~azure.mgmt.databoxedge.v2019_03_01.models.NetworkAdapter] """ _validation = { @@ -1539,11 +1542,11 @@ class Operation(msrest.serialization.Model): :param name: Name of the operation. :type name: str :param display: Properties displayed for the operation. - :type display: ~azure.mgmt.databoxedge.models.OperationDisplay + :type display: ~azure.mgmt.databoxedge.v2019_03_01.models.OperationDisplay :param origin: Origin of the operation. :type origin: str :param service_specification: Service specification. - :type service_specification: ~azure.mgmt.databoxedge.models.ServiceSpecification + :type service_specification: ~azure.mgmt.databoxedge.v2019_03_01.models.ServiceSpecification """ _attribute_map = { @@ -1601,7 +1604,7 @@ class OperationsList(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. :param value: Required. The value. - :type value: list[~azure.mgmt.databoxedge.models.Operation] + :type value: list[~azure.mgmt.databoxedge.v2019_03_01.models.Operation] :param next_link: Link to the next set of results. :type next_link: str """ @@ -1636,21 +1639,21 @@ class Order(ARMBaseModel): :ivar type: The hierarchical type of the object. :vartype type: str :param contact_information: The contact details. - :type contact_information: ~azure.mgmt.databoxedge.models.ContactDetails + :type contact_information: ~azure.mgmt.databoxedge.v2019_03_01.models.ContactDetails :param shipping_address: The shipping address. - :type shipping_address: ~azure.mgmt.databoxedge.models.Address + :type shipping_address: ~azure.mgmt.databoxedge.v2019_03_01.models.Address :param current_status: Current status of the order. - :type current_status: ~azure.mgmt.databoxedge.models.OrderStatus + :type current_status: ~azure.mgmt.databoxedge.v2019_03_01.models.OrderStatus :ivar order_history: List of status changes in the order. - :vartype order_history: list[~azure.mgmt.databoxedge.models.OrderStatus] + :vartype order_history: list[~azure.mgmt.databoxedge.v2019_03_01.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[~azure.mgmt.databoxedge.models.TrackingInfo] + :vartype delivery_tracking_info: list[~azure.mgmt.databoxedge.v2019_03_01.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[~azure.mgmt.databoxedge.models.TrackingInfo] + :vartype return_tracking_info: list[~azure.mgmt.databoxedge.v2019_03_01.models.TrackingInfo] """ _validation = { @@ -1696,7 +1699,7 @@ class OrderList(msrest.serialization.Model): Variables are only populated by the server, and will be ignored when sending a request. :ivar value: The list of orders. - :vartype value: list[~azure.mgmt.databoxedge.models.Order] + :vartype value: list[~azure.mgmt.databoxedge.v2019_03_01.models.Order] :ivar next_link: Link to the next set of results. :vartype next_link: str """ @@ -1731,7 +1734,7 @@ class OrderStatus(msrest.serialization.Model): include: "Untracked", "AwaitingFulfilment", "AwaitingPreparation", "AwaitingShipment", "Shipped", "Arriving", "Delivered", "ReplacementRequested", "LostDevice", "Declined", "ReturnInitiated", "AwaitingReturnShipment", "ShippedBack", "CollectedAtMicrosoft". - :type status: str or ~azure.mgmt.databoxedge.models.OrderState + :type status: str or ~azure.mgmt.databoxedge.v2019_03_01.models.OrderState :ivar update_date_time: Time of status update. :vartype update_date_time: ~datetime.datetime :param comments: Comments related to this status change. @@ -1774,11 +1777,11 @@ class PeriodicTimerEventTrigger(Trigger): :vartype type: str :param kind: Required. Trigger Kind.Constant filled by server. Possible values include: "FileEvent", "PeriodicTimerEvent". - :type kind: str or ~azure.mgmt.databoxedge.models.TriggerEventType + :type kind: str or ~azure.mgmt.databoxedge.v2019_03_01.models.TriggerEventType :param source_info: Required. Periodic timer details. - :type source_info: ~azure.mgmt.databoxedge.models.PeriodicTimerSourceInfo + :type source_info: ~azure.mgmt.databoxedge.v2019_03_01.models.PeriodicTimerSourceInfo :param sink_info: Required. Role Sink information. - :type sink_info: ~azure.mgmt.databoxedge.models.RoleSinkInfo + :type sink_info: ~azure.mgmt.databoxedge.v2019_03_01.models.RoleSinkInfo :param custom_context_tag: A custom context tag typically used to correlate the trigger against its usage. For example, if a periodic timer trigger is intended for certain specific IoT modules in the device, the tag can be the name or the image URL of the module. @@ -1894,7 +1897,7 @@ class RoleList(msrest.serialization.Model): Variables are only populated by the server, and will be ignored when sending a request. :ivar value: The Value. - :vartype value: list[~azure.mgmt.databoxedge.models.Role] + :vartype value: list[~azure.mgmt.databoxedge.v2019_03_01.models.Role] :ivar next_link: Link to the next set of results. :vartype next_link: str """ @@ -1960,7 +1963,8 @@ class SecuritySettings(ARMBaseModel): (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: ~azure.mgmt.databoxedge.models.AsymmetricEncryptedSecret + :type device_admin_password: + ~azure.mgmt.databoxedge.v2019_03_01.models.AsymmetricEncryptedSecret """ _validation = { @@ -1989,7 +1993,8 @@ class ServiceSpecification(msrest.serialization.Model): """Service specification. :param metric_specifications: Metric specification as defined by shoebox. - :type metric_specifications: list[~azure.mgmt.databoxedge.models.MetricSpecificationV1] + :type metric_specifications: + list[~azure.mgmt.databoxedge.v2019_03_01.models.MetricSpecificationV1] """ _attribute_map = { @@ -2021,27 +2026,27 @@ class Share(ARMBaseModel): :type description: str :param share_status: Required. Current status of the share. Possible values include: "Online", "Offline". - :type share_status: str or ~azure.mgmt.databoxedge.models.ShareStatus + :type share_status: str or ~azure.mgmt.databoxedge.v2019_03_01.models.ShareStatus :param monitoring_status: Required. Current monitoring status of the share. Possible values include: "Enabled", "Disabled". - :type monitoring_status: str or ~azure.mgmt.databoxedge.models.MonitoringStatus + :type monitoring_status: str or ~azure.mgmt.databoxedge.v2019_03_01.models.MonitoringStatus :param azure_container_info: Azure container mapping for the share. - :type azure_container_info: ~azure.mgmt.databoxedge.models.AzureContainerInfo + :type azure_container_info: ~azure.mgmt.databoxedge.v2019_03_01.models.AzureContainerInfo :param access_protocol: Required. Access protocol to be used by the share. Possible values include: "SMB", "NFS". - :type access_protocol: str or ~azure.mgmt.databoxedge.models.ShareAccessProtocol + :type access_protocol: str or ~azure.mgmt.databoxedge.v2019_03_01.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[~azure.mgmt.databoxedge.models.UserAccessRight] + :type user_access_rights: list[~azure.mgmt.databoxedge.v2019_03_01.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[~azure.mgmt.databoxedge.models.ClientAccessRight] + :type client_access_rights: list[~azure.mgmt.databoxedge.v2019_03_01.models.ClientAccessRight] :param refresh_details: Details of the refresh job on this share. - :type refresh_details: ~azure.mgmt.databoxedge.models.RefreshDetails + :type refresh_details: ~azure.mgmt.databoxedge.v2019_03_01.models.RefreshDetails :ivar share_mappings: Share mount point to the role. - :vartype share_mappings: list[~azure.mgmt.databoxedge.models.MountPointMap] + :vartype share_mappings: list[~azure.mgmt.databoxedge.v2019_03_01.models.MountPointMap] :param data_policy: Data policy of the share. Possible values include: "Cloud", "Local". - :type data_policy: str or ~azure.mgmt.databoxedge.models.DataPolicy + :type data_policy: str or ~azure.mgmt.databoxedge.v2019_03_01.models.DataPolicy """ _validation = { @@ -2096,7 +2101,7 @@ class ShareAccessRight(msrest.serialization.Model): :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 ~azure.mgmt.databoxedge.models.ShareAccessType + :type access_type: str or ~azure.mgmt.databoxedge.v2019_03_01.models.ShareAccessType """ _validation = { @@ -2124,7 +2129,7 @@ class ShareList(msrest.serialization.Model): Variables are only populated by the server, and will be ignored when sending a request. :ivar value: The list of shares. - :vartype value: list[~azure.mgmt.databoxedge.models.Share] + :vartype value: list[~azure.mgmt.databoxedge.v2019_03_01.models.Share] :ivar next_link: Link to the next set of results. :vartype next_link: str """ @@ -2152,9 +2157,9 @@ class Sku(msrest.serialization.Model): """The SKU type. :param name: SKU name. Possible values include: "Gateway", "Edge". - :type name: str or ~azure.mgmt.databoxedge.models.SkuName + :type name: str or ~azure.mgmt.databoxedge.v2019_03_01.models.SkuName :param tier: The SKU tier. This is based on the SKU name. Possible values include: "Standard". - :type tier: str or ~azure.mgmt.databoxedge.models.SkuTier + :type tier: str or ~azure.mgmt.databoxedge.v2019_03_01.models.SkuTier """ _attribute_map = { @@ -2189,18 +2194,18 @@ class StorageAccountCredential(ARMBaseModel): :param user_name: Username for the storage account. :type user_name: str :param account_key: Encrypted storage key. - :type account_key: ~azure.mgmt.databoxedge.models.AsymmetricEncryptedSecret + :type account_key: ~azure.mgmt.databoxedge.v2019_03_01.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 ~azure.mgmt.databoxedge.models.SSLStatus + :type ssl_status: str or ~azure.mgmt.databoxedge.v2019_03_01.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 ~azure.mgmt.databoxedge.models.AccountType + :type account_type: str or ~azure.mgmt.databoxedge.v2019_03_01.models.AccountType """ _validation = { @@ -2245,7 +2250,7 @@ class StorageAccountCredentialList(msrest.serialization.Model): Variables are only populated by the server, and will be ignored when sending a request. :ivar value: The value. - :vartype value: list[~azure.mgmt.databoxedge.models.StorageAccountCredential] + :vartype value: list[~azure.mgmt.databoxedge.v2019_03_01.models.StorageAccountCredential] :ivar next_link: Link to the next set of results. :vartype next_link: str """ @@ -2273,7 +2278,7 @@ class SymmetricKey(msrest.serialization.Model): """Symmetric key for authentication. :param connection_string: Connection string based on the symmetric key. - :type connection_string: ~azure.mgmt.databoxedge.models.AsymmetricEncryptedSecret + :type connection_string: ~azure.mgmt.databoxedge.v2019_03_01.models.AsymmetricEncryptedSecret """ _attribute_map = { @@ -2325,7 +2330,7 @@ class TriggerList(msrest.serialization.Model): Variables are only populated by the server, and will be ignored when sending a request. :ivar value: The list of triggers. - :vartype value: list[~azure.mgmt.databoxedge.models.Trigger] + :vartype value: list[~azure.mgmt.databoxedge.v2019_03_01.models.Trigger] :ivar next_link: Link to the next set of results. :vartype next_link: str """ @@ -2356,7 +2361,7 @@ class UpdateDownloadProgress(msrest.serialization.Model): :ivar download_phase: The download phase. Possible values include: "Unknown", "Initializing", "Downloading", "Verifying". - :vartype download_phase: str or ~azure.mgmt.databoxedge.models.DownloadPhase + :vartype download_phase: str or ~azure.mgmt.databoxedge.v2019_03_01.models.DownloadPhase :ivar percent_complete: Percentage of completion. :vartype percent_complete: int :ivar total_bytes_to_download: Total bytes to download. @@ -2470,10 +2475,12 @@ class UpdateSummary(ARMBaseModel): :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 ~azure.mgmt.databoxedge.models.InstallRebootBehavior + :vartype reboot_behavior: str or + ~azure.mgmt.databoxedge.v2019_03_01.models.InstallRebootBehavior :ivar ongoing_update_operation: The current update operation. Possible values include: "None", "Scan", "Download", "Install". - :vartype ongoing_update_operation: str or ~azure.mgmt.databoxedge.models.UpdateOperation + :vartype ongoing_update_operation: str or + ~azure.mgmt.databoxedge.v2019_03_01.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. @@ -2563,7 +2570,7 @@ class UploadCertificateRequest(msrest.serialization.Model): :param authentication_type: The authentication type. Possible values include: "Invalid", "AzureActiveDirectory". - :type authentication_type: str or ~azure.mgmt.databoxedge.models.AuthenticationType + :type authentication_type: str or ~azure.mgmt.databoxedge.v2019_03_01.models.AuthenticationType :param certificate: Required. The base64 encoded certificate raw data. :type certificate: str """ @@ -2593,7 +2600,7 @@ class UploadCertificateResponse(msrest.serialization.Model): :param auth_type: Specifies authentication type. Possible values include: "Invalid", "AzureActiveDirectory". - :type auth_type: str or ~azure.mgmt.databoxedge.models.AuthenticationType + :type auth_type: str or ~azure.mgmt.databoxedge.v2019_03_01.models.AuthenticationType :param resource_id: Required. The resource ID of the Data Box Edge/Gateway device. :type resource_id: str :param aad_authority: Required. Azure Active Directory tenant authority. @@ -2655,10 +2662,10 @@ class User(ARMBaseModel): :ivar type: The hierarchical type of the object. :vartype type: str :param encrypted_password: The password details. - :type encrypted_password: ~azure.mgmt.databoxedge.models.AsymmetricEncryptedSecret + :type encrypted_password: ~azure.mgmt.databoxedge.v2019_03_01.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[~azure.mgmt.databoxedge.models.ShareAccessRight] + :type share_access_rights: list[~azure.mgmt.databoxedge.v2019_03_01.models.ShareAccessRight] """ _validation = { @@ -2693,7 +2700,7 @@ class UserAccessRight(msrest.serialization.Model): :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 ~azure.mgmt.databoxedge.models.ShareAccessType + :type access_type: str or ~azure.mgmt.databoxedge.v2019_03_01.models.ShareAccessType """ _validation = { @@ -2721,7 +2728,7 @@ class UserList(msrest.serialization.Model): Variables are only populated by the server, and will be ignored when sending a request. :ivar value: The list of users. - :vartype value: list[~azure.mgmt.databoxedge.models.User] + :vartype value: list[~azure.mgmt.databoxedge.v2019_03_01.models.User] :ivar next_link: Link to the next set of results. :vartype next_link: str """ diff --git a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_03_01/models/_models_py3.py b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_03_01/models/_models_py3.py index 0db07a2a7ba0..14dd7a6c2d22 100644 --- a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_03_01/models/_models_py3.py +++ b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_03_01/models/_models_py3.py @@ -131,9 +131,9 @@ class Alert(ARMBaseModel): :vartype recommendation: str :ivar severity: Severity of the alert. Possible values include: "Informational", "Warning", "Critical". - :vartype severity: str or ~azure.mgmt.databoxedge.models.AlertSeverity + :vartype severity: str or ~azure.mgmt.databoxedge.v2019_03_01.models.AlertSeverity :ivar error_details: Error details of the alert. - :vartype error_details: ~azure.mgmt.databoxedge.models.AlertErrorDetails + :vartype error_details: ~azure.mgmt.databoxedge.v2019_03_01.models.AlertErrorDetails :ivar detailed_information: Alert details. :vartype detailed_information: dict[str, str] """ @@ -219,7 +219,7 @@ class AlertList(msrest.serialization.Model): Variables are only populated by the server, and will be ignored when sending a request. :ivar value: The value. - :vartype value: list[~azure.mgmt.databoxedge.models.Alert] + :vartype value: list[~azure.mgmt.databoxedge.v2019_03_01.models.Alert] :ivar next_link: Link to the next set of results. :vartype next_link: str """ @@ -255,7 +255,8 @@ class AsymmetricEncryptedSecret(msrest.serialization.Model): :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 ~azure.mgmt.databoxedge.models.EncryptionAlgorithm + :type encryption_algorithm: str or + ~azure.mgmt.databoxedge.v2019_03_01.models.EncryptionAlgorithm """ _validation = { @@ -287,7 +288,7 @@ class Authentication(msrest.serialization.Model): """Authentication mechanism for IoT devices. :param symmetric_key: Symmetric key for authentication. - :type symmetric_key: ~azure.mgmt.databoxedge.models.SymmetricKey + :type symmetric_key: ~azure.mgmt.databoxedge.v2019_03_01.models.SymmetricKey """ _attribute_map = { @@ -317,7 +318,7 @@ class AzureContainerInfo(msrest.serialization.Model): :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 ~azure.mgmt.databoxedge.models.AzureContainerDataFormat + :type data_format: str or ~azure.mgmt.databoxedge.v2019_03_01.models.AzureContainerDataFormat """ _validation = { @@ -366,7 +367,7 @@ class BandwidthSchedule(ARMBaseModel): :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 ~azure.mgmt.databoxedge.models.DayOfWeek] + :type days: list[str or ~azure.mgmt.databoxedge.v2019_03_01.models.DayOfWeek] """ _validation = { @@ -411,7 +412,7 @@ class BandwidthSchedulesList(msrest.serialization.Model): 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[~azure.mgmt.databoxedge.models.BandwidthSchedule] + :vartype value: list[~azure.mgmt.databoxedge.v2019_03_01.models.BandwidthSchedule] :ivar next_link: Link to the next set of results. :vartype next_link: str """ @@ -444,7 +445,7 @@ class ClientAccessRight(msrest.serialization.Model): :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 ~azure.mgmt.databoxedge.models.ClientPermissionType + :type access_permission: str or ~azure.mgmt.databoxedge.v2019_03_01.models.ClientPermissionType """ _validation = { @@ -479,7 +480,7 @@ class CloudErrorBody(msrest.serialization.Model): interface. :type message: str :param details: A list of additional details about the error. - :type details: list[~azure.mgmt.databoxedge.models.CloudErrorBody] + :type details: list[~azure.mgmt.databoxedge.v2019_03_01.models.CloudErrorBody] """ _attribute_map = { @@ -569,14 +570,14 @@ class DataBoxEdgeDevice(ARMBaseModel): to view and group this device (across resource groups). :type tags: dict[str, str] :param sku: The SKU type. - :type sku: ~azure.mgmt.databoxedge.models.Sku + :type sku: ~azure.mgmt.databoxedge.v2019_03_01.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". :type data_box_edge_device_status: str or - ~azure.mgmt.databoxedge.models.DataBoxEdgeDeviceStatus + ~azure.mgmt.databoxedge.v2019_03_01.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. @@ -585,7 +586,7 @@ class DataBoxEdgeDevice(ARMBaseModel): :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 ~azure.mgmt.databoxedge.models.DeviceType + :vartype device_type: str or ~azure.mgmt.databoxedge.v2019_03_01.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. @@ -601,7 +602,8 @@ class DataBoxEdgeDevice(ARMBaseModel): :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 ~azure.mgmt.databoxedge.models.RoleTypes] + :vartype configured_role_types: list[str or + ~azure.mgmt.databoxedge.v2019_03_01.models.RoleTypes] """ _validation = { @@ -731,7 +733,7 @@ class DataBoxEdgeDeviceList(msrest.serialization.Model): 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[~azure.mgmt.databoxedge.models.DataBoxEdgeDevice] + :vartype value: list[~azure.mgmt.databoxedge.v2019_03_01.models.DataBoxEdgeDevice] :ivar next_link: Link to the next set of results. :vartype next_link: str """ @@ -794,7 +796,7 @@ class Trigger(ARMBaseModel): :vartype type: str :param kind: Required. Trigger Kind.Constant filled by server. Possible values include: "FileEvent", "PeriodicTimerEvent". - :type kind: str or ~azure.mgmt.databoxedge.models.TriggerEventType + :type kind: str or ~azure.mgmt.databoxedge.v2019_03_01.models.TriggerEventType """ _validation = { @@ -838,11 +840,11 @@ class FileEventTrigger(Trigger): :vartype type: str :param kind: Required. Trigger Kind.Constant filled by server. Possible values include: "FileEvent", "PeriodicTimerEvent". - :type kind: str or ~azure.mgmt.databoxedge.models.TriggerEventType + :type kind: str or ~azure.mgmt.databoxedge.v2019_03_01.models.TriggerEventType :param source_info: Required. File event source details. - :type source_info: ~azure.mgmt.databoxedge.models.FileSourceInfo + :type source_info: ~azure.mgmt.databoxedge.v2019_03_01.models.FileSourceInfo :param sink_info: Required. Role sink info. - :type sink_info: ~azure.mgmt.databoxedge.models.RoleSinkInfo + :type sink_info: ~azure.mgmt.databoxedge.v2019_03_01.models.RoleSinkInfo :param custom_context_tag: A custom context tag typically used to correlate the trigger against its usage. For example, if a periodic timer trigger is intended for certain specific IoT modules in the device, the tag can be the name or the image URL of the module. @@ -920,7 +922,7 @@ class IoTDeviceInfo(msrest.serialization.Model): :param io_t_host_hub: Required. Host name for the IoT hub associated to the device. :type io_t_host_hub: str :param authentication: IoT device authentication info. - :type authentication: ~azure.mgmt.databoxedge.models.Authentication + :type authentication: ~azure.mgmt.databoxedge.v2019_03_01.models.Authentication """ _validation = { @@ -966,7 +968,7 @@ class Role(ARMBaseModel): :vartype type: str :param kind: Required. Role type.Constant filled by server. Possible values include: "IOT", "ASA", "Functions", "Cognitive". - :type kind: str or ~azure.mgmt.databoxedge.models.RoleTypes + :type kind: str or ~azure.mgmt.databoxedge.v2019_03_01.models.RoleTypes """ _validation = { @@ -1010,19 +1012,19 @@ class IoTRole(Role): :vartype type: str :param kind: Required. Role type.Constant filled by server. Possible values include: "IOT", "ASA", "Functions", "Cognitive". - :type kind: str or ~azure.mgmt.databoxedge.models.RoleTypes + :type kind: str or ~azure.mgmt.databoxedge.v2019_03_01.models.RoleTypes :param host_platform: Host OS supported by the IoT role. Possible values include: "Windows", "Linux". - :type host_platform: str or ~azure.mgmt.databoxedge.models.PlatformType + :type host_platform: str or ~azure.mgmt.databoxedge.v2019_03_01.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: ~azure.mgmt.databoxedge.models.IoTDeviceInfo + :type io_t_device_details: ~azure.mgmt.databoxedge.v2019_03_01.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: ~azure.mgmt.databoxedge.models.IoTDeviceInfo + :type io_t_edge_device_details: ~azure.mgmt.databoxedge.v2019_03_01.models.IoTDeviceInfo :param share_mappings: Mount points of shares in role(s). - :type share_mappings: list[~azure.mgmt.databoxedge.models.MountPointMap] + :type share_mappings: list[~azure.mgmt.databoxedge.v2019_03_01.models.MountPointMap] :param role_status: Role status. Possible values include: "Enabled", "Disabled". - :type role_status: str or ~azure.mgmt.databoxedge.models.RoleStatus + :type role_status: str or ~azure.mgmt.databoxedge.v2019_03_01.models.RoleStatus """ _validation = { @@ -1146,7 +1148,7 @@ class Job(msrest.serialization.Model): :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 ~azure.mgmt.databoxedge.models.JobStatus + :vartype status: str or ~azure.mgmt.databoxedge.v2019_03_01.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. @@ -1154,19 +1156,19 @@ class Job(msrest.serialization.Model): :ivar percent_complete: The percentage of the job that is complete. :vartype percent_complete: int :ivar error: The error details. - :vartype error: ~azure.mgmt.databoxedge.models.JobErrorDetails + :vartype error: ~azure.mgmt.databoxedge.v2019_03_01.models.JobErrorDetails :ivar job_type: The type of the job. Possible values include: "Invalid", "ScanForUpdates", "DownloadUpdates", "InstallUpdates", "RefreshShare". - :vartype job_type: str or ~azure.mgmt.databoxedge.models.JobType + :vartype job_type: str or ~azure.mgmt.databoxedge.v2019_03_01.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 ~azure.mgmt.databoxedge.models.UpdateOperationStage + :vartype current_stage: str or ~azure.mgmt.databoxedge.v2019_03_01.models.UpdateOperationStage :ivar download_progress: The download progress. - :vartype download_progress: ~azure.mgmt.databoxedge.models.UpdateDownloadProgress + :vartype download_progress: ~azure.mgmt.databoxedge.v2019_03_01.models.UpdateDownloadProgress :ivar install_progress: The install progress. - :vartype install_progress: ~azure.mgmt.databoxedge.models.UpdateInstallProgress + :vartype install_progress: ~azure.mgmt.databoxedge.v2019_03_01.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 @@ -1247,7 +1249,7 @@ class JobErrorDetails(msrest.serialization.Model): 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[~azure.mgmt.databoxedge.models.JobErrorItem] + :vartype error_details: list[~azure.mgmt.databoxedge.v2019_03_01.models.JobErrorItem] :ivar code: The code intended for programmatic access. :vartype code: str :ivar message: The message that describes the error in detail. @@ -1353,23 +1355,24 @@ class MetricSpecificationV1(msrest.serialization.Model): :type display_description: str :param unit: Metric units. Possible values include: "NotSpecified", "Percent", "Count", "Seconds", "Milliseconds", "Bytes", "BytesPerSecond", "CountPerSecond". - :type unit: str or ~azure.mgmt.databoxedge.models.MetricUnit + :type unit: str or ~azure.mgmt.databoxedge.v2019_03_01.models.MetricUnit :param aggregation_type: Metric aggregation type. Possible values include: "NotSpecified", "None", "Average", "Minimum", "Maximum", "Total", "Count". - :type aggregation_type: str or ~azure.mgmt.databoxedge.models.MetricAggregationType + :type aggregation_type: str or ~azure.mgmt.databoxedge.v2019_03_01.models.MetricAggregationType :param dimensions: Metric dimensions, other than default dimension which is resource. - :type dimensions: list[~azure.mgmt.databoxedge.models.MetricDimensionV1] + :type dimensions: list[~azure.mgmt.databoxedge.v2019_03_01.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 ~azure.mgmt.databoxedge.models.MetricCategory + :type category: str or ~azure.mgmt.databoxedge.v2019_03_01.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 ~azure.mgmt.databoxedge.models.TimeGrain] + :type supported_time_grain_types: list[str or + ~azure.mgmt.databoxedge.v2019_03_01.models.TimeGrain] :param supported_aggregation_types: Support metric aggregation type. :type supported_aggregation_types: list[str or - ~azure.mgmt.databoxedge.models.MetricAggregationType] + ~azure.mgmt.databoxedge.v2019_03_01.models.MetricAggregationType] """ _attribute_map = { @@ -1430,7 +1433,7 @@ class MountPointMap(msrest.serialization.Model): :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 ~azure.mgmt.databoxedge.models.RoleTypes + :vartype role_type: str or ~azure.mgmt.databoxedge.v2019_03_01.models.RoleTypes """ _validation = { @@ -1468,7 +1471,7 @@ class NetworkAdapter(msrest.serialization.Model): :ivar adapter_id: Instance ID of network adapter. :vartype adapter_id: str :ivar adapter_position: Hardware position of network adapter. - :vartype adapter_position: ~azure.mgmt.databoxedge.models.NetworkAdapterPosition + :vartype adapter_position: ~azure.mgmt.databoxedge.v2019_03_01.models.NetworkAdapterPosition :ivar index: Logical index of the adapter. :vartype index: int :ivar node_id: Node ID of the network adapter. @@ -1483,17 +1486,17 @@ class NetworkAdapter(msrest.serialization.Model): :vartype link_speed: long :ivar status: Value indicating whether this adapter is valid. Possible values include: "Inactive", "Active". - :vartype status: str or ~azure.mgmt.databoxedge.models.NetworkAdapterStatus + :vartype status: str or ~azure.mgmt.databoxedge.v2019_03_01.models.NetworkAdapterStatus :param rdma_status: Value indicating whether this adapter is RDMA capable. Possible values include: "Incapable", "Capable". - :type rdma_status: str or ~azure.mgmt.databoxedge.models.NetworkAdapterRDMAStatus + :type rdma_status: str or ~azure.mgmt.databoxedge.v2019_03_01.models.NetworkAdapterRDMAStatus :param dhcp_status: Value indicating whether this adapter has DHCP enabled. Possible values include: "Disabled", "Enabled". - :type dhcp_status: str or ~azure.mgmt.databoxedge.models.NetworkAdapterDHCPStatus + :type dhcp_status: str or ~azure.mgmt.databoxedge.v2019_03_01.models.NetworkAdapterDHCPStatus :ivar ipv4_configuration: The IPv4 configuration of the network adapter. - :vartype ipv4_configuration: ~azure.mgmt.databoxedge.models.Ipv4Config + :vartype ipv4_configuration: ~azure.mgmt.databoxedge.v2019_03_01.models.Ipv4Config :ivar ipv6_configuration: The IPv6 configuration of the network adapter. - :vartype ipv6_configuration: ~azure.mgmt.databoxedge.models.Ipv6Config + :vartype ipv6_configuration: ~azure.mgmt.databoxedge.v2019_03_01.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. @@ -1565,7 +1568,7 @@ class NetworkAdapterPosition(msrest.serialization.Model): 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 ~azure.mgmt.databoxedge.models.NetworkGroup + :vartype network_group: str or ~azure.mgmt.databoxedge.v2019_03_01.models.NetworkGroup :ivar port: The port. :vartype port: int """ @@ -1601,7 +1604,7 @@ class NetworkSettings(ARMBaseModel): :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[~azure.mgmt.databoxedge.models.NetworkAdapter] + :vartype network_adapters: list[~azure.mgmt.databoxedge.v2019_03_01.models.NetworkAdapter] """ _validation = { @@ -1632,11 +1635,11 @@ class Operation(msrest.serialization.Model): :param name: Name of the operation. :type name: str :param display: Properties displayed for the operation. - :type display: ~azure.mgmt.databoxedge.models.OperationDisplay + :type display: ~azure.mgmt.databoxedge.v2019_03_01.models.OperationDisplay :param origin: Origin of the operation. :type origin: str :param service_specification: Service specification. - :type service_specification: ~azure.mgmt.databoxedge.models.ServiceSpecification + :type service_specification: ~azure.mgmt.databoxedge.v2019_03_01.models.ServiceSpecification """ _attribute_map = { @@ -1704,7 +1707,7 @@ class OperationsList(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. :param value: Required. The value. - :type value: list[~azure.mgmt.databoxedge.models.Operation] + :type value: list[~azure.mgmt.databoxedge.v2019_03_01.models.Operation] :param next_link: Link to the next set of results. :type next_link: str """ @@ -1742,21 +1745,21 @@ class Order(ARMBaseModel): :ivar type: The hierarchical type of the object. :vartype type: str :param contact_information: The contact details. - :type contact_information: ~azure.mgmt.databoxedge.models.ContactDetails + :type contact_information: ~azure.mgmt.databoxedge.v2019_03_01.models.ContactDetails :param shipping_address: The shipping address. - :type shipping_address: ~azure.mgmt.databoxedge.models.Address + :type shipping_address: ~azure.mgmt.databoxedge.v2019_03_01.models.Address :param current_status: Current status of the order. - :type current_status: ~azure.mgmt.databoxedge.models.OrderStatus + :type current_status: ~azure.mgmt.databoxedge.v2019_03_01.models.OrderStatus :ivar order_history: List of status changes in the order. - :vartype order_history: list[~azure.mgmt.databoxedge.models.OrderStatus] + :vartype order_history: list[~azure.mgmt.databoxedge.v2019_03_01.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[~azure.mgmt.databoxedge.models.TrackingInfo] + :vartype delivery_tracking_info: list[~azure.mgmt.databoxedge.v2019_03_01.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[~azure.mgmt.databoxedge.models.TrackingInfo] + :vartype return_tracking_info: list[~azure.mgmt.databoxedge.v2019_03_01.models.TrackingInfo] """ _validation = { @@ -1806,7 +1809,7 @@ class OrderList(msrest.serialization.Model): Variables are only populated by the server, and will be ignored when sending a request. :ivar value: The list of orders. - :vartype value: list[~azure.mgmt.databoxedge.models.Order] + :vartype value: list[~azure.mgmt.databoxedge.v2019_03_01.models.Order] :ivar next_link: Link to the next set of results. :vartype next_link: str """ @@ -1841,7 +1844,7 @@ class OrderStatus(msrest.serialization.Model): include: "Untracked", "AwaitingFulfilment", "AwaitingPreparation", "AwaitingShipment", "Shipped", "Arriving", "Delivered", "ReplacementRequested", "LostDevice", "Declined", "ReturnInitiated", "AwaitingReturnShipment", "ShippedBack", "CollectedAtMicrosoft". - :type status: str or ~azure.mgmt.databoxedge.models.OrderState + :type status: str or ~azure.mgmt.databoxedge.v2019_03_01.models.OrderState :ivar update_date_time: Time of status update. :vartype update_date_time: ~datetime.datetime :param comments: Comments related to this status change. @@ -1887,11 +1890,11 @@ class PeriodicTimerEventTrigger(Trigger): :vartype type: str :param kind: Required. Trigger Kind.Constant filled by server. Possible values include: "FileEvent", "PeriodicTimerEvent". - :type kind: str or ~azure.mgmt.databoxedge.models.TriggerEventType + :type kind: str or ~azure.mgmt.databoxedge.v2019_03_01.models.TriggerEventType :param source_info: Required. Periodic timer details. - :type source_info: ~azure.mgmt.databoxedge.models.PeriodicTimerSourceInfo + :type source_info: ~azure.mgmt.databoxedge.v2019_03_01.models.PeriodicTimerSourceInfo :param sink_info: Required. Role Sink information. - :type sink_info: ~azure.mgmt.databoxedge.models.RoleSinkInfo + :type sink_info: ~azure.mgmt.databoxedge.v2019_03_01.models.RoleSinkInfo :param custom_context_tag: A custom context tag typically used to correlate the trigger against its usage. For example, if a periodic timer trigger is intended for certain specific IoT modules in the device, the tag can be the name or the image URL of the module. @@ -2020,7 +2023,7 @@ class RoleList(msrest.serialization.Model): Variables are only populated by the server, and will be ignored when sending a request. :ivar value: The Value. - :vartype value: list[~azure.mgmt.databoxedge.models.Role] + :vartype value: list[~azure.mgmt.databoxedge.v2019_03_01.models.Role] :ivar next_link: Link to the next set of results. :vartype next_link: str """ @@ -2088,7 +2091,8 @@ class SecuritySettings(ARMBaseModel): (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: ~azure.mgmt.databoxedge.models.AsymmetricEncryptedSecret + :type device_admin_password: + ~azure.mgmt.databoxedge.v2019_03_01.models.AsymmetricEncryptedSecret """ _validation = { @@ -2119,7 +2123,8 @@ class ServiceSpecification(msrest.serialization.Model): """Service specification. :param metric_specifications: Metric specification as defined by shoebox. - :type metric_specifications: list[~azure.mgmt.databoxedge.models.MetricSpecificationV1] + :type metric_specifications: + list[~azure.mgmt.databoxedge.v2019_03_01.models.MetricSpecificationV1] """ _attribute_map = { @@ -2153,27 +2158,27 @@ class Share(ARMBaseModel): :type description: str :param share_status: Required. Current status of the share. Possible values include: "Online", "Offline". - :type share_status: str or ~azure.mgmt.databoxedge.models.ShareStatus + :type share_status: str or ~azure.mgmt.databoxedge.v2019_03_01.models.ShareStatus :param monitoring_status: Required. Current monitoring status of the share. Possible values include: "Enabled", "Disabled". - :type monitoring_status: str or ~azure.mgmt.databoxedge.models.MonitoringStatus + :type monitoring_status: str or ~azure.mgmt.databoxedge.v2019_03_01.models.MonitoringStatus :param azure_container_info: Azure container mapping for the share. - :type azure_container_info: ~azure.mgmt.databoxedge.models.AzureContainerInfo + :type azure_container_info: ~azure.mgmt.databoxedge.v2019_03_01.models.AzureContainerInfo :param access_protocol: Required. Access protocol to be used by the share. Possible values include: "SMB", "NFS". - :type access_protocol: str or ~azure.mgmt.databoxedge.models.ShareAccessProtocol + :type access_protocol: str or ~azure.mgmt.databoxedge.v2019_03_01.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[~azure.mgmt.databoxedge.models.UserAccessRight] + :type user_access_rights: list[~azure.mgmt.databoxedge.v2019_03_01.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[~azure.mgmt.databoxedge.models.ClientAccessRight] + :type client_access_rights: list[~azure.mgmt.databoxedge.v2019_03_01.models.ClientAccessRight] :param refresh_details: Details of the refresh job on this share. - :type refresh_details: ~azure.mgmt.databoxedge.models.RefreshDetails + :type refresh_details: ~azure.mgmt.databoxedge.v2019_03_01.models.RefreshDetails :ivar share_mappings: Share mount point to the role. - :vartype share_mappings: list[~azure.mgmt.databoxedge.models.MountPointMap] + :vartype share_mappings: list[~azure.mgmt.databoxedge.v2019_03_01.models.MountPointMap] :param data_policy: Data policy of the share. Possible values include: "Cloud", "Local". - :type data_policy: str or ~azure.mgmt.databoxedge.models.DataPolicy + :type data_policy: str or ~azure.mgmt.databoxedge.v2019_03_01.models.DataPolicy """ _validation = { @@ -2238,7 +2243,7 @@ class ShareAccessRight(msrest.serialization.Model): :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 ~azure.mgmt.databoxedge.models.ShareAccessType + :type access_type: str or ~azure.mgmt.databoxedge.v2019_03_01.models.ShareAccessType """ _validation = { @@ -2269,7 +2274,7 @@ class ShareList(msrest.serialization.Model): Variables are only populated by the server, and will be ignored when sending a request. :ivar value: The list of shares. - :vartype value: list[~azure.mgmt.databoxedge.models.Share] + :vartype value: list[~azure.mgmt.databoxedge.v2019_03_01.models.Share] :ivar next_link: Link to the next set of results. :vartype next_link: str """ @@ -2297,9 +2302,9 @@ class Sku(msrest.serialization.Model): """The SKU type. :param name: SKU name. Possible values include: "Gateway", "Edge". - :type name: str or ~azure.mgmt.databoxedge.models.SkuName + :type name: str or ~azure.mgmt.databoxedge.v2019_03_01.models.SkuName :param tier: The SKU tier. This is based on the SKU name. Possible values include: "Standard". - :type tier: str or ~azure.mgmt.databoxedge.models.SkuTier + :type tier: str or ~azure.mgmt.databoxedge.v2019_03_01.models.SkuTier """ _attribute_map = { @@ -2337,18 +2342,18 @@ class StorageAccountCredential(ARMBaseModel): :param user_name: Username for the storage account. :type user_name: str :param account_key: Encrypted storage key. - :type account_key: ~azure.mgmt.databoxedge.models.AsymmetricEncryptedSecret + :type account_key: ~azure.mgmt.databoxedge.v2019_03_01.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 ~azure.mgmt.databoxedge.models.SSLStatus + :type ssl_status: str or ~azure.mgmt.databoxedge.v2019_03_01.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 ~azure.mgmt.databoxedge.models.AccountType + :type account_type: str or ~azure.mgmt.databoxedge.v2019_03_01.models.AccountType """ _validation = { @@ -2401,7 +2406,7 @@ class StorageAccountCredentialList(msrest.serialization.Model): Variables are only populated by the server, and will be ignored when sending a request. :ivar value: The value. - :vartype value: list[~azure.mgmt.databoxedge.models.StorageAccountCredential] + :vartype value: list[~azure.mgmt.databoxedge.v2019_03_01.models.StorageAccountCredential] :ivar next_link: Link to the next set of results. :vartype next_link: str """ @@ -2429,7 +2434,7 @@ class SymmetricKey(msrest.serialization.Model): """Symmetric key for authentication. :param connection_string: Connection string based on the symmetric key. - :type connection_string: ~azure.mgmt.databoxedge.models.AsymmetricEncryptedSecret + :type connection_string: ~azure.mgmt.databoxedge.v2019_03_01.models.AsymmetricEncryptedSecret """ _attribute_map = { @@ -2488,7 +2493,7 @@ class TriggerList(msrest.serialization.Model): Variables are only populated by the server, and will be ignored when sending a request. :ivar value: The list of triggers. - :vartype value: list[~azure.mgmt.databoxedge.models.Trigger] + :vartype value: list[~azure.mgmt.databoxedge.v2019_03_01.models.Trigger] :ivar next_link: Link to the next set of results. :vartype next_link: str """ @@ -2519,7 +2524,7 @@ class UpdateDownloadProgress(msrest.serialization.Model): :ivar download_phase: The download phase. Possible values include: "Unknown", "Initializing", "Downloading", "Verifying". - :vartype download_phase: str or ~azure.mgmt.databoxedge.models.DownloadPhase + :vartype download_phase: str or ~azure.mgmt.databoxedge.v2019_03_01.models.DownloadPhase :ivar percent_complete: Percentage of completion. :vartype percent_complete: int :ivar total_bytes_to_download: Total bytes to download. @@ -2633,10 +2638,12 @@ class UpdateSummary(ARMBaseModel): :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 ~azure.mgmt.databoxedge.models.InstallRebootBehavior + :vartype reboot_behavior: str or + ~azure.mgmt.databoxedge.v2019_03_01.models.InstallRebootBehavior :ivar ongoing_update_operation: The current update operation. Possible values include: "None", "Scan", "Download", "Install". - :vartype ongoing_update_operation: str or ~azure.mgmt.databoxedge.models.UpdateOperation + :vartype ongoing_update_operation: str or + ~azure.mgmt.databoxedge.v2019_03_01.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. @@ -2731,7 +2738,7 @@ class UploadCertificateRequest(msrest.serialization.Model): :param authentication_type: The authentication type. Possible values include: "Invalid", "AzureActiveDirectory". - :type authentication_type: str or ~azure.mgmt.databoxedge.models.AuthenticationType + :type authentication_type: str or ~azure.mgmt.databoxedge.v2019_03_01.models.AuthenticationType :param certificate: Required. The base64 encoded certificate raw data. :type certificate: str """ @@ -2764,7 +2771,7 @@ class UploadCertificateResponse(msrest.serialization.Model): :param auth_type: Specifies authentication type. Possible values include: "Invalid", "AzureActiveDirectory". - :type auth_type: str or ~azure.mgmt.databoxedge.models.AuthenticationType + :type auth_type: str or ~azure.mgmt.databoxedge.v2019_03_01.models.AuthenticationType :param resource_id: Required. The resource ID of the Data Box Edge/Gateway device. :type resource_id: str :param aad_authority: Required. Azure Active Directory tenant authority. @@ -2834,10 +2841,10 @@ class User(ARMBaseModel): :ivar type: The hierarchical type of the object. :vartype type: str :param encrypted_password: The password details. - :type encrypted_password: ~azure.mgmt.databoxedge.models.AsymmetricEncryptedSecret + :type encrypted_password: ~azure.mgmt.databoxedge.v2019_03_01.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[~azure.mgmt.databoxedge.models.ShareAccessRight] + :type share_access_rights: list[~azure.mgmt.databoxedge.v2019_03_01.models.ShareAccessRight] """ _validation = { @@ -2875,7 +2882,7 @@ class UserAccessRight(msrest.serialization.Model): :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 ~azure.mgmt.databoxedge.models.ShareAccessType + :type access_type: str or ~azure.mgmt.databoxedge.v2019_03_01.models.ShareAccessType """ _validation = { @@ -2906,7 +2913,7 @@ class UserList(msrest.serialization.Model): Variables are only populated by the server, and will be ignored when sending a request. :ivar value: The list of users. - :vartype value: list[~azure.mgmt.databoxedge.models.User] + :vartype value: list[~azure.mgmt.databoxedge.v2019_03_01.models.User] :ivar next_link: Link to the next set of results. :vartype next_link: str """ diff --git a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_03_01/operations/_alerts_operations.py b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_03_01/operations/_alerts_operations.py index d0efcdb78f35..23704e68521d 100644 --- a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_03_01/operations/_alerts_operations.py +++ b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_03_01/operations/_alerts_operations.py @@ -30,7 +30,7 @@ class AlertsOperations(object): instantiates it for you and attaches it as an attribute. :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.databoxedge.models + :type models: ~azure.mgmt.databoxedge.v2019_03_01.models :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. @@ -60,7 +60,7 @@ def list_by_data_box_edge_device( :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[~azure.mgmt.databoxedge.models.AlertList] + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.databoxedge.v2019_03_01.models.AlertList] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.AlertList"] @@ -140,7 +140,7 @@ def get( :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: ~azure.mgmt.databoxedge.models.Alert + :rtype: ~azure.mgmt.databoxedge.v2019_03_01.models.Alert :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.Alert"] diff --git a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_03_01/operations/_bandwidth_schedules_operations.py b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_03_01/operations/_bandwidth_schedules_operations.py index 29a5590c7043..fb1ea0ce78d2 100644 --- a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_03_01/operations/_bandwidth_schedules_operations.py +++ b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_03_01/operations/_bandwidth_schedules_operations.py @@ -32,7 +32,7 @@ class BandwidthSchedulesOperations(object): instantiates it for you and attaches it as an attribute. :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.databoxedge.models + :type models: ~azure.mgmt.databoxedge.v2019_03_01.models :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. @@ -62,7 +62,7 @@ def list_by_data_box_edge_device( :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[~azure.mgmt.databoxedge.models.BandwidthSchedulesList] + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.databoxedge.v2019_03_01.models.BandwidthSchedulesList] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.BandwidthSchedulesList"] @@ -140,7 +140,7 @@ def get( :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: ~azure.mgmt.databoxedge.models.BandwidthSchedule + :rtype: ~azure.mgmt.databoxedge.v2019_03_01.models.BandwidthSchedule :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.BandwidthSchedule"] @@ -261,15 +261,15 @@ def begin_create_or_update( :param resource_group_name: The resource group name. :type resource_group_name: str :param parameters: The bandwidth schedule to be added or updated. - :type parameters: ~azure.mgmt.databoxedge.models.BandwidthSchedule + :type parameters: ~azure.mgmt.databoxedge.v2019_03_01.models.BandwidthSchedule :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: True for ARMPolling, False for no polling, or a - polling object for personal polling strategy + :keyword polling: Pass in True if you'd like the ARMPolling polling method, + False for no polling, or your own initialized polling object for a 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[~azure.mgmt.databoxedge.models.BandwidthSchedule] + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.databoxedge.v2019_03_01.models.BandwidthSchedule] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] @@ -385,8 +385,8 @@ def begin_delete( :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 + :keyword polling: Pass in True if you'd like the ARMPolling polling method, + False for no polling, or your own initialized polling object for a 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) diff --git a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_03_01/operations/_devices_operations.py b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_03_01/operations/_devices_operations.py index b745ac80cc23..eafcd638a8ef 100644 --- a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_03_01/operations/_devices_operations.py +++ b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_03_01/operations/_devices_operations.py @@ -32,7 +32,7 @@ class DevicesOperations(object): instantiates it for you and attaches it as an attribute. :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.databoxedge.models + :type models: ~azure.mgmt.databoxedge.v2019_03_01.models :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. @@ -60,7 +60,7 @@ def list_by_subscription( :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[~azure.mgmt.databoxedge.models.DataBoxEdgeDeviceList] + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.databoxedge.v2019_03_01.models.DataBoxEdgeDeviceList] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.DataBoxEdgeDeviceList"] @@ -136,7 +136,7 @@ def list_by_resource_group( :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[~azure.mgmt.databoxedge.models.DataBoxEdgeDeviceList] + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.databoxedge.v2019_03_01.models.DataBoxEdgeDeviceList] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.DataBoxEdgeDeviceList"] @@ -212,7 +212,7 @@ def get( :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: ~azure.mgmt.databoxedge.models.DataBoxEdgeDevice + :rtype: ~azure.mgmt.databoxedge.v2019_03_01.models.DataBoxEdgeDevice :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.DataBoxEdgeDevice"] @@ -325,15 +325,15 @@ def begin_create_or_update( :param resource_group_name: The resource group name. :type resource_group_name: str :param data_box_edge_device: The resource object. - :type data_box_edge_device: ~azure.mgmt.databoxedge.models.DataBoxEdgeDevice + :type data_box_edge_device: ~azure.mgmt.databoxedge.v2019_03_01.models.DataBoxEdgeDevice :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 + :keyword polling: Pass in True if you'd like the ARMPolling polling method, + False for no polling, or your own initialized polling object for a 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[~azure.mgmt.databoxedge.models.DataBoxEdgeDevice] + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.databoxedge.v2019_03_01.models.DataBoxEdgeDevice] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] @@ -442,8 +442,8 @@ def begin_delete( :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 + :keyword polling: Pass in True if you'd like the ARMPolling polling method, + False for no polling, or your own initialized polling object for a 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) @@ -507,10 +507,10 @@ def update( :param resource_group_name: The resource group name. :type resource_group_name: str :param parameters: The resource parameters. - :type parameters: ~azure.mgmt.databoxedge.models.DataBoxEdgeDevicePatch + :type parameters: ~azure.mgmt.databoxedge.v2019_03_01.models.DataBoxEdgeDevicePatch :keyword callable cls: A custom type or function that will be passed the direct response :return: DataBoxEdgeDevice, or the result of cls(response) - :rtype: ~azure.mgmt.databoxedge.models.DataBoxEdgeDevice + :rtype: ~azure.mgmt.databoxedge.v2019_03_01.models.DataBoxEdgeDevice :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.DataBoxEdgeDevice"] @@ -621,8 +621,8 @@ def begin_download_updates( :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 + :keyword polling: Pass in True if you'd like the ARMPolling polling method, + False for no polling, or your own initialized polling object for a 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) @@ -686,7 +686,7 @@ def get_extended_information( :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: ~azure.mgmt.databoxedge.models.DataBoxEdgeDeviceExtendedInfo + :rtype: ~azure.mgmt.databoxedge.v2019_03_01.models.DataBoxEdgeDeviceExtendedInfo :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.DataBoxEdgeDeviceExtendedInfo"] @@ -792,8 +792,8 @@ def begin_install_updates( :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 + :keyword polling: Pass in True if you'd like the ARMPolling polling method, + False for no polling, or your own initialized polling object for a 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) @@ -857,7 +857,7 @@ def get_network_settings( :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: ~azure.mgmt.databoxedge.models.NetworkSettings + :rtype: ~azure.mgmt.databoxedge.v2019_03_01.models.NetworkSettings :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkSettings"] @@ -963,8 +963,8 @@ def begin_scan_for_updates( :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 + :keyword polling: Pass in True if you'd like the ARMPolling polling method, + False for no polling, or your own initialized polling object for a 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) @@ -1079,11 +1079,11 @@ def begin_create_or_update_security_settings( :param resource_group_name: The resource group name. :type resource_group_name: str :param security_settings: The security settings. - :type security_settings: ~azure.mgmt.databoxedge.models.SecuritySettings + :type security_settings: ~azure.mgmt.databoxedge.v2019_03_01.models.SecuritySettings :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: True for ARMPolling, False for no polling, or a - polling object for personal polling strategy + :keyword polling: Pass in True if you'd like the ARMPolling polling method, + False for no polling, or your own initialized polling object for a 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) @@ -1151,7 +1151,7 @@ def get_update_summary( :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: ~azure.mgmt.databoxedge.models.UpdateSummary + :rtype: ~azure.mgmt.databoxedge.v2019_03_01.models.UpdateSummary :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.UpdateSummary"] @@ -1210,10 +1210,10 @@ def upload_certificate( :param resource_group_name: The resource group name. :type resource_group_name: str :param parameters: The upload certificate request. - :type parameters: ~azure.mgmt.databoxedge.models.UploadCertificateRequest + :type parameters: ~azure.mgmt.databoxedge.v2019_03_01.models.UploadCertificateRequest :keyword callable cls: A custom type or function that will be passed the direct response :return: UploadCertificateResponse, or the result of cls(response) - :rtype: ~azure.mgmt.databoxedge.models.UploadCertificateResponse + :rtype: ~azure.mgmt.databoxedge.v2019_03_01.models.UploadCertificateResponse :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.UploadCertificateResponse"] diff --git a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_03_01/operations/_jobs_operations.py b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_03_01/operations/_jobs_operations.py index b3248010bc16..425a366cf4bd 100644 --- a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_03_01/operations/_jobs_operations.py +++ b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_03_01/operations/_jobs_operations.py @@ -29,7 +29,7 @@ class JobsOperations(object): instantiates it for you and attaches it as an attribute. :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.databoxedge.models + :type models: ~azure.mgmt.databoxedge.v2019_03_01.models :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. @@ -64,7 +64,7 @@ def get( :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: ~azure.mgmt.databoxedge.models.Job + :rtype: ~azure.mgmt.databoxedge.v2019_03_01.models.Job :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.Job"] diff --git a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_03_01/operations/_operations.py b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_03_01/operations/_operations.py index 87a7d942fbb3..a12f6aa1e7c9 100644 --- a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_03_01/operations/_operations.py +++ b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_03_01/operations/_operations.py @@ -30,7 +30,7 @@ class Operations(object): instantiates it for you and attaches it as an attribute. :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.databoxedge.models + :type models: ~azure.mgmt.databoxedge.v2019_03_01.models :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. @@ -56,7 +56,7 @@ def list( :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[~azure.mgmt.databoxedge.models.OperationsList] + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.databoxedge.v2019_03_01.models.OperationsList] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationsList"] diff --git a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_03_01/operations/_operations_status_operations.py b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_03_01/operations/_operations_status_operations.py index b0b10d761105..57e5cb8d66d0 100644 --- a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_03_01/operations/_operations_status_operations.py +++ b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_03_01/operations/_operations_status_operations.py @@ -29,7 +29,7 @@ class OperationsStatusOperations(object): instantiates it for you and attaches it as an attribute. :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.databoxedge.models + :type models: ~azure.mgmt.databoxedge.v2019_03_01.models :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. @@ -64,7 +64,7 @@ def get( :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: ~azure.mgmt.databoxedge.models.Job + :rtype: ~azure.mgmt.databoxedge.v2019_03_01.models.Job :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.Job"] diff --git a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_03_01/operations/_orders_operations.py b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_03_01/operations/_orders_operations.py index a5f925ecc9f7..6227f5ccf7f1 100644 --- a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_03_01/operations/_orders_operations.py +++ b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_03_01/operations/_orders_operations.py @@ -32,7 +32,7 @@ class OrdersOperations(object): instantiates it for you and attaches it as an attribute. :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.databoxedge.models + :type models: ~azure.mgmt.databoxedge.v2019_03_01.models :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. @@ -64,7 +64,7 @@ def list_by_data_box_edge_device( :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[~azure.mgmt.databoxedge.models.OrderList] + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.databoxedge.v2019_03_01.models.OrderList] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.OrderList"] @@ -141,7 +141,7 @@ def get( :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: ~azure.mgmt.databoxedge.models.Order + :rtype: ~azure.mgmt.databoxedge.v2019_03_01.models.Order :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.Order"] @@ -258,15 +258,15 @@ def begin_create_or_update( :param resource_group_name: The resource group name. :type resource_group_name: str :param order: The order to be created or updated. - :type order: ~azure.mgmt.databoxedge.models.Order + :type order: ~azure.mgmt.databoxedge.v2019_03_01.models.Order :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: True for ARMPolling, False for no polling, or a - polling object for personal polling strategy + :keyword polling: Pass in True if you'd like the ARMPolling polling method, + False for no polling, or your own initialized polling object for a 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[~azure.mgmt.databoxedge.models.Order] + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.databoxedge.v2019_03_01.models.Order] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] @@ -377,8 +377,8 @@ def begin_delete( :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 + :keyword polling: Pass in True if you'd like the ARMPolling polling method, + False for no polling, or your own initialized polling object for a 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) diff --git a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_03_01/operations/_roles_operations.py b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_03_01/operations/_roles_operations.py index a73d4fbbae37..afb182c9818e 100644 --- a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_03_01/operations/_roles_operations.py +++ b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_03_01/operations/_roles_operations.py @@ -32,7 +32,7 @@ class RolesOperations(object): instantiates it for you and attaches it as an attribute. :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.databoxedge.models + :type models: ~azure.mgmt.databoxedge.v2019_03_01.models :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. @@ -62,7 +62,7 @@ def list_by_data_box_edge_device( :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[~azure.mgmt.databoxedge.models.RoleList] + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.databoxedge.v2019_03_01.models.RoleList] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.RoleList"] @@ -140,7 +140,7 @@ def get( :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: ~azure.mgmt.databoxedge.models.Role + :rtype: ~azure.mgmt.databoxedge.v2019_03_01.models.Role :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.Role"] @@ -261,15 +261,15 @@ def begin_create_or_update( :param resource_group_name: The resource group name. :type resource_group_name: str :param role: The role properties. - :type role: ~azure.mgmt.databoxedge.models.Role + :type role: ~azure.mgmt.databoxedge.v2019_03_01.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 + :keyword polling: Pass in True if you'd like the ARMPolling polling method, + False for no polling, or your own initialized polling object for a 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[~azure.mgmt.databoxedge.models.Role] + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.databoxedge.v2019_03_01.models.Role] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] @@ -385,8 +385,8 @@ def begin_delete( :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 + :keyword polling: Pass in True if you'd like the ARMPolling polling method, + False for no polling, or your own initialized polling object for a 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) diff --git a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_03_01/operations/_shares_operations.py b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_03_01/operations/_shares_operations.py index c5d116b84e35..294c68068676 100644 --- a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_03_01/operations/_shares_operations.py +++ b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_03_01/operations/_shares_operations.py @@ -32,7 +32,7 @@ class SharesOperations(object): instantiates it for you and attaches it as an attribute. :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.databoxedge.models + :type models: ~azure.mgmt.databoxedge.v2019_03_01.models :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. @@ -64,7 +64,7 @@ def list_by_data_box_edge_device( :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[~azure.mgmt.databoxedge.models.ShareList] + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.databoxedge.v2019_03_01.models.ShareList] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.ShareList"] @@ -144,7 +144,7 @@ def get( :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: ~azure.mgmt.databoxedge.models.Share + :rtype: ~azure.mgmt.databoxedge.v2019_03_01.models.Share :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.Share"] @@ -267,15 +267,15 @@ def begin_create_or_update( :param resource_group_name: The resource group name. :type resource_group_name: str :param share: The share properties. - :type share: ~azure.mgmt.databoxedge.models.Share + :type share: ~azure.mgmt.databoxedge.v2019_03_01.models.Share :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: True for ARMPolling, False for no polling, or a - polling object for personal polling strategy + :keyword polling: Pass in True if you'd like the ARMPolling polling method, + False for no polling, or your own initialized polling object for a 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[~azure.mgmt.databoxedge.models.Share] + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.databoxedge.v2019_03_01.models.Share] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] @@ -391,8 +391,8 @@ def begin_delete( :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 + :keyword polling: Pass in True if you'd like the ARMPolling polling method, + False for no polling, or your own initialized polling object for a 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) @@ -510,8 +510,8 @@ def begin_refresh( :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 + :keyword polling: Pass in True if you'd like the ARMPolling polling method, + False for no polling, or your own initialized polling object for a 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) diff --git a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_03_01/operations/_storage_account_credentials_operations.py b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_03_01/operations/_storage_account_credentials_operations.py index ad26e5ff1a0a..869e22514f35 100644 --- a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_03_01/operations/_storage_account_credentials_operations.py +++ b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_03_01/operations/_storage_account_credentials_operations.py @@ -32,7 +32,7 @@ class StorageAccountCredentialsOperations(object): instantiates it for you and attaches it as an attribute. :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.databoxedge.models + :type models: ~azure.mgmt.databoxedge.v2019_03_01.models :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. @@ -64,7 +64,7 @@ def list_by_data_box_edge_device( :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[~azure.mgmt.databoxedge.models.StorageAccountCredentialList] + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.databoxedge.v2019_03_01.models.StorageAccountCredentialList] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.StorageAccountCredentialList"] @@ -142,7 +142,7 @@ def get( :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: ~azure.mgmt.databoxedge.models.StorageAccountCredential + :rtype: ~azure.mgmt.databoxedge.v2019_03_01.models.StorageAccountCredential :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.StorageAccountCredential"] @@ -263,15 +263,15 @@ def begin_create_or_update( :param resource_group_name: The resource group name. :type resource_group_name: str :param storage_account_credential: The storage account credential. - :type storage_account_credential: ~azure.mgmt.databoxedge.models.StorageAccountCredential + :type storage_account_credential: ~azure.mgmt.databoxedge.v2019_03_01.models.StorageAccountCredential :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: True for ARMPolling, False for no polling, or a - polling object for personal polling strategy + :keyword polling: Pass in True if you'd like the ARMPolling polling method, + False for no polling, or your own initialized polling object for a 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[~azure.mgmt.databoxedge.models.StorageAccountCredential] + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.databoxedge.v2019_03_01.models.StorageAccountCredential] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] @@ -387,8 +387,8 @@ def begin_delete( :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 + :keyword polling: Pass in True if you'd like the ARMPolling polling method, + False for no polling, or your own initialized polling object for a 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) diff --git a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_03_01/operations/_triggers_operations.py b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_03_01/operations/_triggers_operations.py index 901b3bd7c2dd..269bedf97869 100644 --- a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_03_01/operations/_triggers_operations.py +++ b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_03_01/operations/_triggers_operations.py @@ -32,7 +32,7 @@ class TriggersOperations(object): instantiates it for you and attaches it as an attribute. :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.databoxedge.models + :type models: ~azure.mgmt.databoxedge.v2019_03_01.models :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. @@ -66,7 +66,7 @@ def list_by_data_box_edge_device( :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 TriggerList or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.databoxedge.models.TriggerList] + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.databoxedge.v2019_03_01.models.TriggerList] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.TriggerList"] @@ -146,7 +146,7 @@ def get( :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: ~azure.mgmt.databoxedge.models.Trigger + :rtype: ~azure.mgmt.databoxedge.v2019_03_01.models.Trigger :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.Trigger"] @@ -267,15 +267,15 @@ def begin_create_or_update( :param resource_group_name: The resource group name. :type resource_group_name: str :param trigger: The trigger. - :type trigger: ~azure.mgmt.databoxedge.models.Trigger + :type trigger: ~azure.mgmt.databoxedge.v2019_03_01.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 + :keyword polling: Pass in True if you'd like the ARMPolling polling method, + False for no polling, or your own initialized polling object for a 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[~azure.mgmt.databoxedge.models.Trigger] + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.databoxedge.v2019_03_01.models.Trigger] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] @@ -391,8 +391,8 @@ def begin_delete( :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 + :keyword polling: Pass in True if you'd like the ARMPolling polling method, + False for no polling, or your own initialized polling object for a 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) diff --git a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_03_01/operations/_users_operations.py b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_03_01/operations/_users_operations.py index cb05fd2b2d94..e990e85a43cd 100644 --- a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_03_01/operations/_users_operations.py +++ b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_03_01/operations/_users_operations.py @@ -32,7 +32,7 @@ class UsersOperations(object): instantiates it for you and attaches it as an attribute. :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.databoxedge.models + :type models: ~azure.mgmt.databoxedge.v2019_03_01.models :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. @@ -62,7 +62,7 @@ def list_by_data_box_edge_device( :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 UserList or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.databoxedge.models.UserList] + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.databoxedge.v2019_03_01.models.UserList] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.UserList"] @@ -140,7 +140,7 @@ def get( :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: ~azure.mgmt.databoxedge.models.User + :rtype: ~azure.mgmt.databoxedge.v2019_03_01.models.User :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.User"] @@ -261,15 +261,15 @@ def begin_create_or_update( :param resource_group_name: The resource group name. :type resource_group_name: str :param user: The user details. - :type user: ~azure.mgmt.databoxedge.models.User + :type user: ~azure.mgmt.databoxedge.v2019_03_01.models.User :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: True for ARMPolling, False for no polling, or a - polling object for personal polling strategy + :keyword polling: Pass in True if you'd like the ARMPolling polling method, + False for no polling, or your own initialized polling object for a 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[~azure.mgmt.databoxedge.models.User] + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.databoxedge.v2019_03_01.models.User] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] @@ -385,8 +385,8 @@ def begin_delete( :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 + :keyword polling: Pass in True if you'd like the ARMPolling polling method, + False for no polling, or your own initialized polling object for a 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) diff --git a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_07_01/_data_box_edge_management_client.py b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_07_01/_data_box_edge_management_client.py index a19d9246df54..b6bdb6e27a72 100644 --- a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_07_01/_data_box_edge_management_client.py +++ b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_07_01/_data_box_edge_management_client.py @@ -16,6 +16,7 @@ from typing import Any, Optional from azure.core.credentials import TokenCredential + from azure.core.pipeline.transport import HttpRequest, HttpResponse from ._configuration import DataBoxEdgeManagementClientConfiguration from .operations import Operations @@ -38,31 +39,31 @@ class DataBoxEdgeManagementClient(object): """The DataBoxEdge Client. :ivar operations: Operations operations - :vartype operations: azure.mgmt.databoxedge.operations.Operations + :vartype operations: azure.mgmt.databoxedge.v2019_07_01.operations.Operations :ivar devices: DevicesOperations operations - :vartype devices: azure.mgmt.databoxedge.operations.DevicesOperations + :vartype devices: azure.mgmt.databoxedge.v2019_07_01.operations.DevicesOperations :ivar alerts: AlertsOperations operations - :vartype alerts: azure.mgmt.databoxedge.operations.AlertsOperations + :vartype alerts: azure.mgmt.databoxedge.v2019_07_01.operations.AlertsOperations :ivar bandwidth_schedules: BandwidthSchedulesOperations operations - :vartype bandwidth_schedules: azure.mgmt.databoxedge.operations.BandwidthSchedulesOperations + :vartype bandwidth_schedules: azure.mgmt.databoxedge.v2019_07_01.operations.BandwidthSchedulesOperations :ivar jobs: JobsOperations operations - :vartype jobs: azure.mgmt.databoxedge.operations.JobsOperations + :vartype jobs: azure.mgmt.databoxedge.v2019_07_01.operations.JobsOperations :ivar nodes: NodesOperations operations - :vartype nodes: azure.mgmt.databoxedge.operations.NodesOperations + :vartype nodes: azure.mgmt.databoxedge.v2019_07_01.operations.NodesOperations :ivar operations_status: OperationsStatusOperations operations - :vartype operations_status: azure.mgmt.databoxedge.operations.OperationsStatusOperations + :vartype operations_status: azure.mgmt.databoxedge.v2019_07_01.operations.OperationsStatusOperations :ivar orders: OrdersOperations operations - :vartype orders: azure.mgmt.databoxedge.operations.OrdersOperations + :vartype orders: azure.mgmt.databoxedge.v2019_07_01.operations.OrdersOperations :ivar roles: RolesOperations operations - :vartype roles: azure.mgmt.databoxedge.operations.RolesOperations + :vartype roles: azure.mgmt.databoxedge.v2019_07_01.operations.RolesOperations :ivar shares: SharesOperations operations - :vartype shares: azure.mgmt.databoxedge.operations.SharesOperations + :vartype shares: azure.mgmt.databoxedge.v2019_07_01.operations.SharesOperations :ivar storage_account_credentials: StorageAccountCredentialsOperations operations - :vartype storage_account_credentials: azure.mgmt.databoxedge.operations.StorageAccountCredentialsOperations + :vartype storage_account_credentials: azure.mgmt.databoxedge.v2019_07_01.operations.StorageAccountCredentialsOperations :ivar triggers: TriggersOperations operations - :vartype triggers: azure.mgmt.databoxedge.operations.TriggersOperations + :vartype triggers: azure.mgmt.databoxedge.v2019_07_01.operations.TriggersOperations :ivar users: UsersOperations operations - :vartype users: azure.mgmt.databoxedge.operations.UsersOperations + :vartype users: azure.mgmt.databoxedge.v2019_07_01.operations.UsersOperations :param credential: Credential needed for the client to connect to Azure. :type credential: ~azure.core.credentials.TokenCredential :param subscription_id: The subscription ID. @@ -116,6 +117,24 @@ def __init__( self.users = UsersOperations( self._client, self._config, self._serialize, self._deserialize) + def _send_request(self, http_request, **kwargs): + # type: (HttpRequest, Any) -> HttpResponse + """Runs the network request through the client's chained policies. + + :param http_request: The network request you want to make. Required. + :type http_request: ~azure.core.pipeline.transport.HttpRequest + :keyword bool stream: Whether the response payload will be streamed. Defaults to True. + :return: The response of your network call. Does not do error handling on your response. + :rtype: ~azure.core.pipeline.transport.HttpResponse + """ + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + http_request.url = self._client.format_url(http_request.url, **path_format_arguments) + stream = kwargs.pop("stream", True) + pipeline_response = self._client._pipeline.run(http_request, stream=stream, **kwargs) + return pipeline_response.http_response + def close(self): # type: () -> None self._client.close() diff --git a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_07_01/_metadata.json b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_07_01/_metadata.json index 1fb3173efb2d..8880d13820a0 100644 --- a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_07_01/_metadata.json +++ b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_07_01/_metadata.json @@ -9,7 +9,9 @@ "custom_base_url": null, "azure_arm": true, "has_lro_operations": true, - "client_side_validation": false + "client_side_validation": false, + "sync_imports": "{\"typing\": {\"azurecore\": {\"azure.core.credentials\": [\"TokenCredential\"]}}, \"regular\": {\"azurecore\": {\"azure.profiles\": [\"KnownProfiles\", \"ProfileDefinition\"], \"azure.profiles.multiapiclient\": [\"MultiApiClientMixin\"], \"msrest\": [\"Deserializer\", \"Serializer\"], \"azure.mgmt.core\": [\"ARMPipelineClient\"]}, \"local\": {\"._configuration\": [\"DataBoxEdgeManagementClientConfiguration\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}, \"azurecore\": {\"azure.core.pipeline.transport\": [\"HttpRequest\", \"HttpResponse\"]}}}", + "async_imports": "{\"typing\": {\"azurecore\": {\"azure.core.credentials_async\": [\"AsyncTokenCredential\"]}}, \"regular\": {\"azurecore\": {\"azure.profiles\": [\"KnownProfiles\", \"ProfileDefinition\"], \"azure.profiles.multiapiclient\": [\"MultiApiClientMixin\"], \"msrest\": [\"Deserializer\", \"Serializer\"], \"azure.mgmt.core\": [\"AsyncARMPipelineClient\"]}, \"local\": {\"._configuration\": [\"DataBoxEdgeManagementClientConfiguration\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}, \"azurecore\": {\"azure.core.pipeline.transport\": [\"AsyncHttpResponse\", \"HttpRequest\"]}}}" }, "global_parameters": { "sync": { @@ -28,13 +30,13 @@ }, "async": { "credential": { - "signature": "credential, # type: \"AsyncTokenCredential\"", + "signature": "credential: \"AsyncTokenCredential\",", "description": "Credential needed for the client to connect to Azure.", "docstring_type": "~azure.core.credentials_async.AsyncTokenCredential", "required": true }, "subscription_id": { - "signature": "subscription_id, # type: str", + "signature": "subscription_id: str,", "description": "The subscription ID.", "docstring_type": "str", "required": true @@ -42,14 +44,58 @@ }, "constant": { }, - "call": "credential, subscription_id" + "call": "credential, subscription_id", + "service_client_specific": { + "sync": { + "api_version": { + "signature": "api_version=None, # type: Optional[str]", + "description": "API version to use if no profile is provided, or if missing in profile.", + "docstring_type": "str", + "required": false + }, + "base_url": { + "signature": "base_url=None, # type: Optional[str]", + "description": "Service URL", + "docstring_type": "str", + "required": false + }, + "profile": { + "signature": "profile=KnownProfiles.default, # type: KnownProfiles", + "description": "A profile definition, from KnownProfiles to dict.", + "docstring_type": "azure.profiles.KnownProfiles", + "required": false + } + }, + "async": { + "api_version": { + "signature": "api_version: Optional[str] = None,", + "description": "API version to use if no profile is provided, or if missing in profile.", + "docstring_type": "str", + "required": false + }, + "base_url": { + "signature": "base_url: Optional[str] = None,", + "description": "Service URL", + "docstring_type": "str", + "required": false + }, + "profile": { + "signature": "profile: KnownProfiles = KnownProfiles.default,", + "description": "A profile definition, from KnownProfiles to dict.", + "docstring_type": "azure.profiles.KnownProfiles", + "required": false + } + } + } }, "config": { "credential": true, "credential_scopes": ["https://management.azure.com/.default"], "credential_default_policy_type": "BearerTokenCredentialPolicy", "credential_default_policy_type_has_async_version": true, - "credential_key_header_name": null + "credential_key_header_name": null, + "sync_imports": "{\"regular\": {\"azurecore\": {\"azure.core.configuration\": [\"Configuration\"], \"azure.core.pipeline\": [\"policies\"], \"azure.mgmt.core.policies\": [\"ARMHttpLoggingPolicy\"]}, \"local\": {\"._version\": [\"VERSION\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\"]}}, \"typing\": {\"azurecore\": {\"azure.core.credentials\": [\"TokenCredential\"]}}}", + "async_imports": "{\"regular\": {\"azurecore\": {\"azure.core.configuration\": [\"Configuration\"], \"azure.core.pipeline\": [\"policies\"], \"azure.mgmt.core.policies\": [\"ARMHttpLoggingPolicy\"]}, \"local\": {\".._version\": [\"VERSION\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\"]}}, \"typing\": {\"azurecore\": {\"azure.core.credentials_async\": [\"AsyncTokenCredential\"]}}}" }, "operation_groups": { "operations": "Operations", @@ -65,9 +111,5 @@ "storage_account_credentials": "StorageAccountCredentialsOperations", "triggers": "TriggersOperations", "users": "UsersOperations" - }, - "operation_mixins": { - }, - "sync_imports": "None", - "async_imports": "None" + } } \ No newline at end of file diff --git a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_07_01/aio/_data_box_edge_management_client.py b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_07_01/aio/_data_box_edge_management_client.py index 586f61a4d0dd..646214481c40 100644 --- a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_07_01/aio/_data_box_edge_management_client.py +++ b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_07_01/aio/_data_box_edge_management_client.py @@ -8,6 +8,7 @@ from typing import Any, Optional, TYPE_CHECKING +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core import AsyncARMPipelineClient from msrest import Deserializer, Serializer @@ -36,31 +37,31 @@ class DataBoxEdgeManagementClient(object): """The DataBoxEdge Client. :ivar operations: Operations operations - :vartype operations: azure.mgmt.databoxedge.aio.operations.Operations + :vartype operations: azure.mgmt.databoxedge.v2019_07_01.aio.operations.Operations :ivar devices: DevicesOperations operations - :vartype devices: azure.mgmt.databoxedge.aio.operations.DevicesOperations + :vartype devices: azure.mgmt.databoxedge.v2019_07_01.aio.operations.DevicesOperations :ivar alerts: AlertsOperations operations - :vartype alerts: azure.mgmt.databoxedge.aio.operations.AlertsOperations + :vartype alerts: azure.mgmt.databoxedge.v2019_07_01.aio.operations.AlertsOperations :ivar bandwidth_schedules: BandwidthSchedulesOperations operations - :vartype bandwidth_schedules: azure.mgmt.databoxedge.aio.operations.BandwidthSchedulesOperations + :vartype bandwidth_schedules: azure.mgmt.databoxedge.v2019_07_01.aio.operations.BandwidthSchedulesOperations :ivar jobs: JobsOperations operations - :vartype jobs: azure.mgmt.databoxedge.aio.operations.JobsOperations + :vartype jobs: azure.mgmt.databoxedge.v2019_07_01.aio.operations.JobsOperations :ivar nodes: NodesOperations operations - :vartype nodes: azure.mgmt.databoxedge.aio.operations.NodesOperations + :vartype nodes: azure.mgmt.databoxedge.v2019_07_01.aio.operations.NodesOperations :ivar operations_status: OperationsStatusOperations operations - :vartype operations_status: azure.mgmt.databoxedge.aio.operations.OperationsStatusOperations + :vartype operations_status: azure.mgmt.databoxedge.v2019_07_01.aio.operations.OperationsStatusOperations :ivar orders: OrdersOperations operations - :vartype orders: azure.mgmt.databoxedge.aio.operations.OrdersOperations + :vartype orders: azure.mgmt.databoxedge.v2019_07_01.aio.operations.OrdersOperations :ivar roles: RolesOperations operations - :vartype roles: azure.mgmt.databoxedge.aio.operations.RolesOperations + :vartype roles: azure.mgmt.databoxedge.v2019_07_01.aio.operations.RolesOperations :ivar shares: SharesOperations operations - :vartype shares: azure.mgmt.databoxedge.aio.operations.SharesOperations + :vartype shares: azure.mgmt.databoxedge.v2019_07_01.aio.operations.SharesOperations :ivar storage_account_credentials: StorageAccountCredentialsOperations operations - :vartype storage_account_credentials: azure.mgmt.databoxedge.aio.operations.StorageAccountCredentialsOperations + :vartype storage_account_credentials: azure.mgmt.databoxedge.v2019_07_01.aio.operations.StorageAccountCredentialsOperations :ivar triggers: TriggersOperations operations - :vartype triggers: azure.mgmt.databoxedge.aio.operations.TriggersOperations + :vartype triggers: azure.mgmt.databoxedge.v2019_07_01.aio.operations.TriggersOperations :ivar users: UsersOperations operations - :vartype users: azure.mgmt.databoxedge.aio.operations.UsersOperations + :vartype users: azure.mgmt.databoxedge.v2019_07_01.aio.operations.UsersOperations :param credential: Credential needed for the client to connect to Azure. :type credential: ~azure.core.credentials_async.AsyncTokenCredential :param subscription_id: The subscription ID. @@ -113,6 +114,23 @@ def __init__( self.users = UsersOperations( self._client, self._config, self._serialize, self._deserialize) + async def _send_request(self, http_request: HttpRequest, **kwargs: Any) -> AsyncHttpResponse: + """Runs the network request through the client's chained policies. + + :param http_request: The network request you want to make. Required. + :type http_request: ~azure.core.pipeline.transport.HttpRequest + :keyword bool stream: Whether the response payload will be streamed. Defaults to True. + :return: The response of your network call. Does not do error handling on your response. + :rtype: ~azure.core.pipeline.transport.AsyncHttpResponse + """ + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + http_request.url = self._client.format_url(http_request.url, **path_format_arguments) + stream = kwargs.pop("stream", True) + pipeline_response = await self._client._pipeline.run(http_request, stream=stream, **kwargs) + return pipeline_response.http_response + async def close(self) -> None: await self._client.close() diff --git a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_07_01/aio/operations/_alerts_operations.py b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_07_01/aio/operations/_alerts_operations.py index 9769b42437b8..63b2fd3d1975 100644 --- a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_07_01/aio/operations/_alerts_operations.py +++ b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_07_01/aio/operations/_alerts_operations.py @@ -26,7 +26,7 @@ class AlertsOperations: instantiates it for you and attaches it as an attribute. :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.databoxedge.models + :type models: ~azure.mgmt.databoxedge.v2019_07_01.models :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. @@ -55,7 +55,7 @@ def list_by_data_box_edge_device( :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[~azure.mgmt.databoxedge.models.AlertList] + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.databoxedge.v2019_07_01.models.AlertList] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.AlertList"] @@ -134,7 +134,7 @@ async def get( :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: ~azure.mgmt.databoxedge.models.Alert + :rtype: ~azure.mgmt.databoxedge.v2019_07_01.models.Alert :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.Alert"] diff --git a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_07_01/aio/operations/_bandwidth_schedules_operations.py b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_07_01/aio/operations/_bandwidth_schedules_operations.py index 3a13dd05ed1d..4206112163f5 100644 --- a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_07_01/aio/operations/_bandwidth_schedules_operations.py +++ b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_07_01/aio/operations/_bandwidth_schedules_operations.py @@ -28,7 +28,7 @@ class BandwidthSchedulesOperations: instantiates it for you and attaches it as an attribute. :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.databoxedge.models + :type models: ~azure.mgmt.databoxedge.v2019_07_01.models :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. @@ -57,7 +57,7 @@ def list_by_data_box_edge_device( :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[~azure.mgmt.databoxedge.models.BandwidthSchedulesList] + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.databoxedge.v2019_07_01.models.BandwidthSchedulesList] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.BandwidthSchedulesList"] @@ -134,7 +134,7 @@ async def get( :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: ~azure.mgmt.databoxedge.models.BandwidthSchedule + :rtype: ~azure.mgmt.databoxedge.v2019_07_01.models.BandwidthSchedule :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.BandwidthSchedule"] @@ -253,15 +253,15 @@ async def begin_create_or_update( :param resource_group_name: The resource group name. :type resource_group_name: str :param parameters: The bandwidth schedule to be added or updated. - :type parameters: ~azure.mgmt.databoxedge.models.BandwidthSchedule + :type parameters: ~azure.mgmt.databoxedge.v2019_07_01.models.BandwidthSchedule :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: True for ARMPolling, False for no polling, or a - polling object for personal polling strategy + :keyword polling: Pass in True if you'd like the AsyncARMPolling polling method, + False for no polling, or your own initialized polling object for a 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[~azure.mgmt.databoxedge.models.BandwidthSchedule] + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.databoxedge.v2019_07_01.models.BandwidthSchedule] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -375,8 +375,8 @@ async def begin_delete( :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 + :keyword polling: Pass in True if you'd like the AsyncARMPolling polling method, + False for no polling, or your own initialized polling object for a 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) diff --git a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_07_01/aio/operations/_devices_operations.py b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_07_01/aio/operations/_devices_operations.py index b108bb81fddc..3c9dbd934fa3 100644 --- a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_07_01/aio/operations/_devices_operations.py +++ b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_07_01/aio/operations/_devices_operations.py @@ -28,7 +28,7 @@ class DevicesOperations: instantiates it for you and attaches it as an attribute. :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.databoxedge.models + :type models: ~azure.mgmt.databoxedge.v2019_07_01.models :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. @@ -55,7 +55,7 @@ def list_by_subscription( :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[~azure.mgmt.databoxedge.models.DataBoxEdgeDeviceList] + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.databoxedge.v2019_07_01.models.DataBoxEdgeDeviceList] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.DataBoxEdgeDeviceList"] @@ -130,7 +130,7 @@ def list_by_resource_group( :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[~azure.mgmt.databoxedge.models.DataBoxEdgeDeviceList] + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.databoxedge.v2019_07_01.models.DataBoxEdgeDeviceList] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.DataBoxEdgeDeviceList"] @@ -205,7 +205,7 @@ async def get( :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: ~azure.mgmt.databoxedge.models.DataBoxEdgeDevice + :rtype: ~azure.mgmt.databoxedge.v2019_07_01.models.DataBoxEdgeDevice :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.DataBoxEdgeDevice"] @@ -316,15 +316,15 @@ async def begin_create_or_update( :param resource_group_name: The resource group name. :type resource_group_name: str :param data_box_edge_device: The resource object. - :type data_box_edge_device: ~azure.mgmt.databoxedge.models.DataBoxEdgeDevice + :type data_box_edge_device: ~azure.mgmt.databoxedge.v2019_07_01.models.DataBoxEdgeDevice :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 + :keyword polling: Pass in True if you'd like the AsyncARMPolling polling method, + False for no polling, or your own initialized polling object for a 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[~azure.mgmt.databoxedge.models.DataBoxEdgeDevice] + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.databoxedge.v2019_07_01.models.DataBoxEdgeDevice] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -431,8 +431,8 @@ async def begin_delete( :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 + :keyword polling: Pass in True if you'd like the AsyncARMPolling polling method, + False for no polling, or your own initialized polling object for a 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) @@ -495,10 +495,10 @@ async def update( :param resource_group_name: The resource group name. :type resource_group_name: str :param parameters: The resource parameters. - :type parameters: ~azure.mgmt.databoxedge.models.DataBoxEdgeDevicePatch + :type parameters: ~azure.mgmt.databoxedge.v2019_07_01.models.DataBoxEdgeDevicePatch :keyword callable cls: A custom type or function that will be passed the direct response :return: DataBoxEdgeDevice, or the result of cls(response) - :rtype: ~azure.mgmt.databoxedge.models.DataBoxEdgeDevice + :rtype: ~azure.mgmt.databoxedge.v2019_07_01.models.DataBoxEdgeDevice :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.DataBoxEdgeDevice"] @@ -607,8 +607,8 @@ async def begin_download_updates( :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 + :keyword polling: Pass in True if you'd like the AsyncARMPolling polling method, + False for no polling, or your own initialized polling object for a 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) @@ -671,7 +671,7 @@ async def get_extended_information( :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: ~azure.mgmt.databoxedge.models.DataBoxEdgeDeviceExtendedInfo + :rtype: ~azure.mgmt.databoxedge.v2019_07_01.models.DataBoxEdgeDeviceExtendedInfo :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.DataBoxEdgeDeviceExtendedInfo"] @@ -775,8 +775,8 @@ async def begin_install_updates( :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 + :keyword polling: Pass in True if you'd like the AsyncARMPolling polling method, + False for no polling, or your own initialized polling object for a 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) @@ -839,7 +839,7 @@ async def get_network_settings( :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: ~azure.mgmt.databoxedge.models.NetworkSettings + :rtype: ~azure.mgmt.databoxedge.v2019_07_01.models.NetworkSettings :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkSettings"] @@ -943,8 +943,8 @@ async def begin_scan_for_updates( :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 + :keyword polling: Pass in True if you'd like the AsyncARMPolling polling method, + False for no polling, or your own initialized polling object for a 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) @@ -1057,11 +1057,11 @@ async def begin_create_or_update_security_settings( :param resource_group_name: The resource group name. :type resource_group_name: str :param security_settings: The security settings. - :type security_settings: ~azure.mgmt.databoxedge.models.SecuritySettings + :type security_settings: ~azure.mgmt.databoxedge.v2019_07_01.models.SecuritySettings :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: True for ARMPolling, False for no polling, or a - polling object for personal polling strategy + :keyword polling: Pass in True if you'd like the AsyncARMPolling polling method, + False for no polling, or your own initialized polling object for a 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) @@ -1128,7 +1128,7 @@ async def get_update_summary( :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: ~azure.mgmt.databoxedge.models.UpdateSummary + :rtype: ~azure.mgmt.databoxedge.v2019_07_01.models.UpdateSummary :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.UpdateSummary"] @@ -1186,10 +1186,10 @@ async def upload_certificate( :param resource_group_name: The resource group name. :type resource_group_name: str :param parameters: The upload certificate request. - :type parameters: ~azure.mgmt.databoxedge.models.UploadCertificateRequest + :type parameters: ~azure.mgmt.databoxedge.v2019_07_01.models.UploadCertificateRequest :keyword callable cls: A custom type or function that will be passed the direct response :return: UploadCertificateResponse, or the result of cls(response) - :rtype: ~azure.mgmt.databoxedge.models.UploadCertificateResponse + :rtype: ~azure.mgmt.databoxedge.v2019_07_01.models.UploadCertificateResponse :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.UploadCertificateResponse"] diff --git a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_07_01/aio/operations/_jobs_operations.py b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_07_01/aio/operations/_jobs_operations.py index 284905ef4dde..d37c2211462b 100644 --- a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_07_01/aio/operations/_jobs_operations.py +++ b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_07_01/aio/operations/_jobs_operations.py @@ -25,7 +25,7 @@ class JobsOperations: instantiates it for you and attaches it as an attribute. :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.databoxedge.models + :type models: ~azure.mgmt.databoxedge.v2019_07_01.models :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. @@ -59,7 +59,7 @@ async def get( :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: ~azure.mgmt.databoxedge.models.Job + :rtype: ~azure.mgmt.databoxedge.v2019_07_01.models.Job :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.Job"] diff --git a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_07_01/aio/operations/_nodes_operations.py b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_07_01/aio/operations/_nodes_operations.py index 9533ac908ce4..aa31f8eb7856 100644 --- a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_07_01/aio/operations/_nodes_operations.py +++ b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_07_01/aio/operations/_nodes_operations.py @@ -26,7 +26,7 @@ class NodesOperations: instantiates it for you and attaches it as an attribute. :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.databoxedge.models + :type models: ~azure.mgmt.databoxedge.v2019_07_01.models :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. @@ -55,7 +55,7 @@ def list_by_data_box_edge_device( :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[~azure.mgmt.databoxedge.models.NodeList] + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.databoxedge.v2019_07_01.models.NodeList] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.NodeList"] diff --git a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_07_01/aio/operations/_operations.py b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_07_01/aio/operations/_operations.py index b08bb07e8e06..54c30b0a7257 100644 --- a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_07_01/aio/operations/_operations.py +++ b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_07_01/aio/operations/_operations.py @@ -26,7 +26,7 @@ class Operations: instantiates it for you and attaches it as an attribute. :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.databoxedge.models + :type models: ~azure.mgmt.databoxedge.v2019_07_01.models :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. @@ -51,7 +51,7 @@ def list( :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[~azure.mgmt.databoxedge.models.OperationsList] + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.databoxedge.v2019_07_01.models.OperationsList] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationsList"] diff --git a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_07_01/aio/operations/_operations_status_operations.py b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_07_01/aio/operations/_operations_status_operations.py index 1b673adf4a2f..63dd79b27a4f 100644 --- a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_07_01/aio/operations/_operations_status_operations.py +++ b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_07_01/aio/operations/_operations_status_operations.py @@ -25,7 +25,7 @@ class OperationsStatusOperations: instantiates it for you and attaches it as an attribute. :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.databoxedge.models + :type models: ~azure.mgmt.databoxedge.v2019_07_01.models :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. @@ -59,7 +59,7 @@ async def get( :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: ~azure.mgmt.databoxedge.models.Job + :rtype: ~azure.mgmt.databoxedge.v2019_07_01.models.Job :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.Job"] diff --git a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_07_01/aio/operations/_orders_operations.py b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_07_01/aio/operations/_orders_operations.py index be478844633b..96b8846d7b09 100644 --- a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_07_01/aio/operations/_orders_operations.py +++ b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_07_01/aio/operations/_orders_operations.py @@ -28,7 +28,7 @@ class OrdersOperations: instantiates it for you and attaches it as an attribute. :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.databoxedge.models + :type models: ~azure.mgmt.databoxedge.v2019_07_01.models :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. @@ -59,7 +59,7 @@ def list_by_data_box_edge_device( :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[~azure.mgmt.databoxedge.models.OrderList] + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.databoxedge.v2019_07_01.models.OrderList] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.OrderList"] @@ -135,7 +135,7 @@ async def get( :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: ~azure.mgmt.databoxedge.models.Order + :rtype: ~azure.mgmt.databoxedge.v2019_07_01.models.Order :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.Order"] @@ -250,15 +250,15 @@ async def begin_create_or_update( :param resource_group_name: The resource group name. :type resource_group_name: str :param order: The order to be created or updated. - :type order: ~azure.mgmt.databoxedge.models.Order + :type order: ~azure.mgmt.databoxedge.v2019_07_01.models.Order :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: True for ARMPolling, False for no polling, or a - polling object for personal polling strategy + :keyword polling: Pass in True if you'd like the AsyncARMPolling polling method, + False for no polling, or your own initialized polling object for a 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[~azure.mgmt.databoxedge.models.Order] + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.databoxedge.v2019_07_01.models.Order] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -367,8 +367,8 @@ async def begin_delete( :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 + :keyword polling: Pass in True if you'd like the AsyncARMPolling polling method, + False for no polling, or your own initialized polling object for a 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) diff --git a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_07_01/aio/operations/_roles_operations.py b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_07_01/aio/operations/_roles_operations.py index 8cc79c9b3b92..a14931080c68 100644 --- a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_07_01/aio/operations/_roles_operations.py +++ b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_07_01/aio/operations/_roles_operations.py @@ -28,7 +28,7 @@ class RolesOperations: instantiates it for you and attaches it as an attribute. :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.databoxedge.models + :type models: ~azure.mgmt.databoxedge.v2019_07_01.models :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. @@ -57,7 +57,7 @@ def list_by_data_box_edge_device( :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[~azure.mgmt.databoxedge.models.RoleList] + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.databoxedge.v2019_07_01.models.RoleList] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.RoleList"] @@ -134,7 +134,7 @@ async def get( :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: ~azure.mgmt.databoxedge.models.Role + :rtype: ~azure.mgmt.databoxedge.v2019_07_01.models.Role :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.Role"] @@ -253,15 +253,15 @@ async def begin_create_or_update( :param resource_group_name: The resource group name. :type resource_group_name: str :param role: The role properties. - :type role: ~azure.mgmt.databoxedge.models.Role + :type role: ~azure.mgmt.databoxedge.v2019_07_01.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 + :keyword polling: Pass in True if you'd like the AsyncARMPolling polling method, + False for no polling, or your own initialized polling object for a 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[~azure.mgmt.databoxedge.models.Role] + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.databoxedge.v2019_07_01.models.Role] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -375,8 +375,8 @@ async def begin_delete( :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 + :keyword polling: Pass in True if you'd like the AsyncARMPolling polling method, + False for no polling, or your own initialized polling object for a 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) diff --git a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_07_01/aio/operations/_shares_operations.py b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_07_01/aio/operations/_shares_operations.py index 1ecbb2530ab8..6954c5453482 100644 --- a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_07_01/aio/operations/_shares_operations.py +++ b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_07_01/aio/operations/_shares_operations.py @@ -28,7 +28,7 @@ class SharesOperations: instantiates it for you and attaches it as an attribute. :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.databoxedge.models + :type models: ~azure.mgmt.databoxedge.v2019_07_01.models :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. @@ -59,7 +59,7 @@ def list_by_data_box_edge_device( :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[~azure.mgmt.databoxedge.models.ShareList] + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.databoxedge.v2019_07_01.models.ShareList] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.ShareList"] @@ -138,7 +138,7 @@ async def get( :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: ~azure.mgmt.databoxedge.models.Share + :rtype: ~azure.mgmt.databoxedge.v2019_07_01.models.Share :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.Share"] @@ -259,15 +259,15 @@ async def begin_create_or_update( :param resource_group_name: The resource group name. :type resource_group_name: str :param share: The share properties. - :type share: ~azure.mgmt.databoxedge.models.Share + :type share: ~azure.mgmt.databoxedge.v2019_07_01.models.Share :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: True for ARMPolling, False for no polling, or a - polling object for personal polling strategy + :keyword polling: Pass in True if you'd like the AsyncARMPolling polling method, + False for no polling, or your own initialized polling object for a 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[~azure.mgmt.databoxedge.models.Share] + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.databoxedge.v2019_07_01.models.Share] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -381,8 +381,8 @@ async def begin_delete( :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 + :keyword polling: Pass in True if you'd like the AsyncARMPolling polling method, + False for no polling, or your own initialized polling object for a 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) @@ -498,8 +498,8 @@ async def begin_refresh( :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 + :keyword polling: Pass in True if you'd like the AsyncARMPolling polling method, + False for no polling, or your own initialized polling object for a 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) diff --git a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_07_01/aio/operations/_storage_account_credentials_operations.py b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_07_01/aio/operations/_storage_account_credentials_operations.py index fcad94d5f8ad..3b07e3ef0727 100644 --- a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_07_01/aio/operations/_storage_account_credentials_operations.py +++ b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_07_01/aio/operations/_storage_account_credentials_operations.py @@ -28,7 +28,7 @@ class StorageAccountCredentialsOperations: instantiates it for you and attaches it as an attribute. :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.databoxedge.models + :type models: ~azure.mgmt.databoxedge.v2019_07_01.models :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. @@ -59,7 +59,7 @@ def list_by_data_box_edge_device( :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[~azure.mgmt.databoxedge.models.StorageAccountCredentialList] + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.databoxedge.v2019_07_01.models.StorageAccountCredentialList] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.StorageAccountCredentialList"] @@ -136,7 +136,7 @@ async def get( :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: ~azure.mgmt.databoxedge.models.StorageAccountCredential + :rtype: ~azure.mgmt.databoxedge.v2019_07_01.models.StorageAccountCredential :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.StorageAccountCredential"] @@ -255,15 +255,15 @@ async def begin_create_or_update( :param resource_group_name: The resource group name. :type resource_group_name: str :param storage_account_credential: The storage account credential. - :type storage_account_credential: ~azure.mgmt.databoxedge.models.StorageAccountCredential + :type storage_account_credential: ~azure.mgmt.databoxedge.v2019_07_01.models.StorageAccountCredential :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: True for ARMPolling, False for no polling, or a - polling object for personal polling strategy + :keyword polling: Pass in True if you'd like the AsyncARMPolling polling method, + False for no polling, or your own initialized polling object for a 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[~azure.mgmt.databoxedge.models.StorageAccountCredential] + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.databoxedge.v2019_07_01.models.StorageAccountCredential] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -377,8 +377,8 @@ async def begin_delete( :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 + :keyword polling: Pass in True if you'd like the AsyncARMPolling polling method, + False for no polling, or your own initialized polling object for a 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) diff --git a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_07_01/aio/operations/_triggers_operations.py b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_07_01/aio/operations/_triggers_operations.py index f95149848163..f6e6ef43282e 100644 --- a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_07_01/aio/operations/_triggers_operations.py +++ b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_07_01/aio/operations/_triggers_operations.py @@ -28,7 +28,7 @@ class TriggersOperations: instantiates it for you and attaches it as an attribute. :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.databoxedge.models + :type models: ~azure.mgmt.databoxedge.v2019_07_01.models :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. @@ -61,7 +61,7 @@ def list_by_data_box_edge_device( :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 TriggerList or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.databoxedge.models.TriggerList] + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.databoxedge.v2019_07_01.models.TriggerList] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.TriggerList"] @@ -140,7 +140,7 @@ async def get( :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: ~azure.mgmt.databoxedge.models.Trigger + :rtype: ~azure.mgmt.databoxedge.v2019_07_01.models.Trigger :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.Trigger"] @@ -259,15 +259,15 @@ async def begin_create_or_update( :param resource_group_name: The resource group name. :type resource_group_name: str :param trigger: The trigger. - :type trigger: ~azure.mgmt.databoxedge.models.Trigger + :type trigger: ~azure.mgmt.databoxedge.v2019_07_01.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 + :keyword polling: Pass in True if you'd like the AsyncARMPolling polling method, + False for no polling, or your own initialized polling object for a 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[~azure.mgmt.databoxedge.models.Trigger] + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.databoxedge.v2019_07_01.models.Trigger] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -381,8 +381,8 @@ async def begin_delete( :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 + :keyword polling: Pass in True if you'd like the AsyncARMPolling polling method, + False for no polling, or your own initialized polling object for a 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) diff --git a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_07_01/aio/operations/_users_operations.py b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_07_01/aio/operations/_users_operations.py index 6bef4166dc0d..e1ee77cc8705 100644 --- a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_07_01/aio/operations/_users_operations.py +++ b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_07_01/aio/operations/_users_operations.py @@ -28,7 +28,7 @@ class UsersOperations: instantiates it for you and attaches it as an attribute. :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.databoxedge.models + :type models: ~azure.mgmt.databoxedge.v2019_07_01.models :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. @@ -57,7 +57,7 @@ def list_by_data_box_edge_device( :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 UserList or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.databoxedge.models.UserList] + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.databoxedge.v2019_07_01.models.UserList] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.UserList"] @@ -134,7 +134,7 @@ async def get( :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: ~azure.mgmt.databoxedge.models.User + :rtype: ~azure.mgmt.databoxedge.v2019_07_01.models.User :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.User"] @@ -254,15 +254,15 @@ async def begin_create_or_update( :param resource_group_name: The resource group name. :type resource_group_name: str :param user: The user details. - :type user: ~azure.mgmt.databoxedge.models.User + :type user: ~azure.mgmt.databoxedge.v2019_07_01.models.User :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: True for ARMPolling, False for no polling, or a - polling object for personal polling strategy + :keyword polling: Pass in True if you'd like the AsyncARMPolling polling method, + False for no polling, or your own initialized polling object for a 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[~azure.mgmt.databoxedge.models.User] + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.databoxedge.v2019_07_01.models.User] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -376,8 +376,8 @@ async def begin_delete( :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 + :keyword polling: Pass in True if you'd like the AsyncARMPolling polling method, + False for no polling, or your own initialized polling object for a 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) diff --git a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_07_01/models/_models.py b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_07_01/models/_models.py index fd61be911978..9a3963db001b 100644 --- a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_07_01/models/_models.py +++ b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_07_01/models/_models.py @@ -118,9 +118,9 @@ class Alert(ARMBaseModel): :vartype recommendation: str :ivar severity: Severity of the alert. Possible values include: "Informational", "Warning", "Critical". - :vartype severity: str or ~azure.mgmt.databoxedge.models.AlertSeverity + :vartype severity: str or ~azure.mgmt.databoxedge.v2019_07_01.models.AlertSeverity :ivar error_details: Error details of the alert. - :vartype error_details: ~azure.mgmt.databoxedge.models.AlertErrorDetails + :vartype error_details: ~azure.mgmt.databoxedge.v2019_07_01.models.AlertErrorDetails :ivar detailed_information: Alert details. :vartype detailed_information: dict[str, str] """ @@ -206,7 +206,7 @@ class AlertList(msrest.serialization.Model): Variables are only populated by the server, and will be ignored when sending a request. :ivar value: The value. - :vartype value: list[~azure.mgmt.databoxedge.models.Alert] + :vartype value: list[~azure.mgmt.databoxedge.v2019_07_01.models.Alert] :ivar next_link: Link to the next set of results. :vartype next_link: str """ @@ -242,7 +242,8 @@ class AsymmetricEncryptedSecret(msrest.serialization.Model): :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 ~azure.mgmt.databoxedge.models.EncryptionAlgorithm + :type encryption_algorithm: str or + ~azure.mgmt.databoxedge.v2019_07_01.models.EncryptionAlgorithm """ _validation = { @@ -270,7 +271,7 @@ class Authentication(msrest.serialization.Model): """Authentication mechanism for IoT devices. :param symmetric_key: Symmetric key for authentication. - :type symmetric_key: ~azure.mgmt.databoxedge.models.SymmetricKey + :type symmetric_key: ~azure.mgmt.databoxedge.v2019_07_01.models.SymmetricKey """ _attribute_map = { @@ -298,7 +299,7 @@ class AzureContainerInfo(msrest.serialization.Model): :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 ~azure.mgmt.databoxedge.models.AzureContainerDataFormat + :type data_format: str or ~azure.mgmt.databoxedge.v2019_07_01.models.AzureContainerDataFormat """ _validation = { @@ -343,7 +344,7 @@ class BandwidthSchedule(ARMBaseModel): :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 ~azure.mgmt.databoxedge.models.DayOfWeek] + :type days: list[str or ~azure.mgmt.databoxedge.v2019_07_01.models.DayOfWeek] """ _validation = { @@ -383,7 +384,7 @@ class BandwidthSchedulesList(msrest.serialization.Model): 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[~azure.mgmt.databoxedge.models.BandwidthSchedule] + :vartype value: list[~azure.mgmt.databoxedge.v2019_07_01.models.BandwidthSchedule] :ivar next_link: Link to the next set of results. :vartype next_link: str """ @@ -416,7 +417,7 @@ class ClientAccessRight(msrest.serialization.Model): :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 ~azure.mgmt.databoxedge.models.ClientPermissionType + :type access_permission: str or ~azure.mgmt.databoxedge.v2019_07_01.models.ClientPermissionType """ _validation = { @@ -448,7 +449,7 @@ class CloudErrorBody(msrest.serialization.Model): interface. :type message: str :param details: A list of additional details about the error. - :type details: list[~azure.mgmt.databoxedge.models.CloudErrorBody] + :type details: list[~azure.mgmt.databoxedge.v2019_07_01.models.CloudErrorBody] """ _attribute_map = { @@ -529,14 +530,14 @@ class DataBoxEdgeDevice(ARMBaseModel): to view and group this device (across resource groups). :type tags: dict[str, str] :param sku: The SKU type. - :type sku: ~azure.mgmt.databoxedge.models.Sku + :type sku: ~azure.mgmt.databoxedge.v2019_07_01.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 - ~azure.mgmt.databoxedge.models.DataBoxEdgeDeviceStatus + ~azure.mgmt.databoxedge.v2019_07_01.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. @@ -545,7 +546,7 @@ class DataBoxEdgeDevice(ARMBaseModel): :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 ~azure.mgmt.databoxedge.models.DeviceType + :vartype device_type: str or ~azure.mgmt.databoxedge.v2019_07_01.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. @@ -561,7 +562,8 @@ class DataBoxEdgeDevice(ARMBaseModel): :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 ~azure.mgmt.databoxedge.models.RoleTypes] + :vartype configured_role_types: list[str or + ~azure.mgmt.databoxedge.v2019_07_01.models.RoleTypes] :ivar node_count: The number of nodes in the cluster. :vartype node_count: int """ @@ -684,7 +686,7 @@ class DataBoxEdgeDeviceList(msrest.serialization.Model): 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[~azure.mgmt.databoxedge.models.DataBoxEdgeDevice] + :vartype value: list[~azure.mgmt.databoxedge.v2019_07_01.models.DataBoxEdgeDevice] :ivar next_link: Link to the next set of results. :vartype next_link: str """ @@ -745,7 +747,7 @@ class Trigger(ARMBaseModel): :vartype type: str :param kind: Required. Trigger Kind.Constant filled by server. Possible values include: "FileEvent", "PeriodicTimerEvent". - :type kind: str or ~azure.mgmt.databoxedge.models.TriggerEventType + :type kind: str or ~azure.mgmt.databoxedge.v2019_07_01.models.TriggerEventType """ _validation = { @@ -789,11 +791,11 @@ class FileEventTrigger(Trigger): :vartype type: str :param kind: Required. Trigger Kind.Constant filled by server. Possible values include: "FileEvent", "PeriodicTimerEvent". - :type kind: str or ~azure.mgmt.databoxedge.models.TriggerEventType + :type kind: str or ~azure.mgmt.databoxedge.v2019_07_01.models.TriggerEventType :param source_info: Required. File event source details. - :type source_info: ~azure.mgmt.databoxedge.models.FileSourceInfo + :type source_info: ~azure.mgmt.databoxedge.v2019_07_01.models.FileSourceInfo :param sink_info: Required. Role sink info. - :type sink_info: ~azure.mgmt.databoxedge.models.RoleSinkInfo + :type sink_info: ~azure.mgmt.databoxedge.v2019_07_01.models.RoleSinkInfo :param custom_context_tag: A custom context tag typically used to correlate the trigger against its usage. For example, if a periodic timer trigger is intended for certain specific IoT modules in the device, the tag can be the name or the image URL of the module. @@ -867,7 +869,7 @@ class IoTDeviceInfo(msrest.serialization.Model): :param io_t_host_hub_id: Id of the IoT hub associated to the device. :type io_t_host_hub_id: str :param authentication: IoT device authentication info. - :type authentication: ~azure.mgmt.databoxedge.models.Authentication + :type authentication: ~azure.mgmt.databoxedge.v2019_07_01.models.Authentication """ _validation = { @@ -911,7 +913,7 @@ class Role(ARMBaseModel): :vartype type: str :param kind: Required. Role type.Constant filled by server. Possible values include: "IOT", "ASA", "Functions", "Cognitive". - :type kind: str or ~azure.mgmt.databoxedge.models.RoleTypes + :type kind: str or ~azure.mgmt.databoxedge.v2019_07_01.models.RoleTypes """ _validation = { @@ -955,19 +957,19 @@ class IoTRole(Role): :vartype type: str :param kind: Required. Role type.Constant filled by server. Possible values include: "IOT", "ASA", "Functions", "Cognitive". - :type kind: str or ~azure.mgmt.databoxedge.models.RoleTypes + :type kind: str or ~azure.mgmt.databoxedge.v2019_07_01.models.RoleTypes :param host_platform: Host OS supported by the IoT role. Possible values include: "Windows", "Linux". - :type host_platform: str or ~azure.mgmt.databoxedge.models.PlatformType + :type host_platform: str or ~azure.mgmt.databoxedge.v2019_07_01.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: ~azure.mgmt.databoxedge.models.IoTDeviceInfo + :type io_t_device_details: ~azure.mgmt.databoxedge.v2019_07_01.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: ~azure.mgmt.databoxedge.models.IoTDeviceInfo + :type io_t_edge_device_details: ~azure.mgmt.databoxedge.v2019_07_01.models.IoTDeviceInfo :param share_mappings: Mount points of shares in role(s). - :type share_mappings: list[~azure.mgmt.databoxedge.models.MountPointMap] + :type share_mappings: list[~azure.mgmt.databoxedge.v2019_07_01.models.MountPointMap] :param role_status: Role status. Possible values include: "Enabled", "Disabled". - :type role_status: str or ~azure.mgmt.databoxedge.models.RoleStatus + :type role_status: str or ~azure.mgmt.databoxedge.v2019_07_01.models.RoleStatus """ _validation = { @@ -1085,7 +1087,7 @@ class Job(msrest.serialization.Model): :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 ~azure.mgmt.databoxedge.models.JobStatus + :vartype status: str or ~azure.mgmt.databoxedge.v2019_07_01.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. @@ -1093,19 +1095,19 @@ class Job(msrest.serialization.Model): :ivar percent_complete: The percentage of the job that is complete. :vartype percent_complete: int :ivar error: The error details. - :vartype error: ~azure.mgmt.databoxedge.models.JobErrorDetails + :vartype error: ~azure.mgmt.databoxedge.v2019_07_01.models.JobErrorDetails :ivar job_type: The type of the job. Possible values include: "Invalid", "ScanForUpdates", "DownloadUpdates", "InstallUpdates", "RefreshShare". - :vartype job_type: str or ~azure.mgmt.databoxedge.models.JobType + :vartype job_type: str or ~azure.mgmt.databoxedge.v2019_07_01.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 ~azure.mgmt.databoxedge.models.UpdateOperationStage + :vartype current_stage: str or ~azure.mgmt.databoxedge.v2019_07_01.models.UpdateOperationStage :ivar download_progress: The download progress. - :vartype download_progress: ~azure.mgmt.databoxedge.models.UpdateDownloadProgress + :vartype download_progress: ~azure.mgmt.databoxedge.v2019_07_01.models.UpdateDownloadProgress :ivar install_progress: The install progress. - :vartype install_progress: ~azure.mgmt.databoxedge.models.UpdateInstallProgress + :vartype install_progress: ~azure.mgmt.databoxedge.v2019_07_01.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 @@ -1184,7 +1186,7 @@ class JobErrorDetails(msrest.serialization.Model): 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[~azure.mgmt.databoxedge.models.JobErrorItem] + :vartype error_details: list[~azure.mgmt.databoxedge.v2019_07_01.models.JobErrorItem] :ivar code: The code intended for programmatic access. :vartype code: str :ivar message: The message that describes the error in detail. @@ -1286,23 +1288,24 @@ class MetricSpecificationV1(msrest.serialization.Model): :type display_description: str :param unit: Metric units. Possible values include: "NotSpecified", "Percent", "Count", "Seconds", "Milliseconds", "Bytes", "BytesPerSecond", "CountPerSecond". - :type unit: str or ~azure.mgmt.databoxedge.models.MetricUnit + :type unit: str or ~azure.mgmt.databoxedge.v2019_07_01.models.MetricUnit :param aggregation_type: Metric aggregation type. Possible values include: "NotSpecified", "None", "Average", "Minimum", "Maximum", "Total", "Count". - :type aggregation_type: str or ~azure.mgmt.databoxedge.models.MetricAggregationType + :type aggregation_type: str or ~azure.mgmt.databoxedge.v2019_07_01.models.MetricAggregationType :param dimensions: Metric dimensions, other than default dimension which is resource. - :type dimensions: list[~azure.mgmt.databoxedge.models.MetricDimensionV1] + :type dimensions: list[~azure.mgmt.databoxedge.v2019_07_01.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 ~azure.mgmt.databoxedge.models.MetricCategory + :type category: str or ~azure.mgmt.databoxedge.v2019_07_01.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 ~azure.mgmt.databoxedge.models.TimeGrain] + :type supported_time_grain_types: list[str or + ~azure.mgmt.databoxedge.v2019_07_01.models.TimeGrain] :param supported_aggregation_types: Support metric aggregation type. :type supported_aggregation_types: list[str or - ~azure.mgmt.databoxedge.models.MetricAggregationType] + ~azure.mgmt.databoxedge.v2019_07_01.models.MetricAggregationType] """ _attribute_map = { @@ -1351,7 +1354,7 @@ class MountPointMap(msrest.serialization.Model): :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 ~azure.mgmt.databoxedge.models.RoleTypes + :vartype role_type: str or ~azure.mgmt.databoxedge.v2019_07_01.models.RoleTypes """ _validation = { @@ -1387,7 +1390,7 @@ class NetworkAdapter(msrest.serialization.Model): :ivar adapter_id: Instance ID of network adapter. :vartype adapter_id: str :ivar adapter_position: Hardware position of network adapter. - :vartype adapter_position: ~azure.mgmt.databoxedge.models.NetworkAdapterPosition + :vartype adapter_position: ~azure.mgmt.databoxedge.v2019_07_01.models.NetworkAdapterPosition :ivar index: Logical index of the adapter. :vartype index: int :ivar node_id: Node ID of the network adapter. @@ -1402,17 +1405,17 @@ class NetworkAdapter(msrest.serialization.Model): :vartype link_speed: long :ivar status: Value indicating whether this adapter is valid. Possible values include: "Inactive", "Active". - :vartype status: str or ~azure.mgmt.databoxedge.models.NetworkAdapterStatus + :vartype status: str or ~azure.mgmt.databoxedge.v2019_07_01.models.NetworkAdapterStatus :param rdma_status: Value indicating whether this adapter is RDMA capable. Possible values include: "Incapable", "Capable". - :type rdma_status: str or ~azure.mgmt.databoxedge.models.NetworkAdapterRDMAStatus + :type rdma_status: str or ~azure.mgmt.databoxedge.v2019_07_01.models.NetworkAdapterRDMAStatus :param dhcp_status: Value indicating whether this adapter has DHCP enabled. Possible values include: "Disabled", "Enabled". - :type dhcp_status: str or ~azure.mgmt.databoxedge.models.NetworkAdapterDHCPStatus + :type dhcp_status: str or ~azure.mgmt.databoxedge.v2019_07_01.models.NetworkAdapterDHCPStatus :ivar ipv4_configuration: The IPv4 configuration of the network adapter. - :vartype ipv4_configuration: ~azure.mgmt.databoxedge.models.Ipv4Config + :vartype ipv4_configuration: ~azure.mgmt.databoxedge.v2019_07_01.models.Ipv4Config :ivar ipv6_configuration: The IPv6 configuration of the network adapter. - :vartype ipv6_configuration: ~azure.mgmt.databoxedge.models.Ipv6Config + :vartype ipv6_configuration: ~azure.mgmt.databoxedge.v2019_07_01.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. @@ -1481,7 +1484,7 @@ class NetworkAdapterPosition(msrest.serialization.Model): 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 ~azure.mgmt.databoxedge.models.NetworkGroup + :vartype network_group: str or ~azure.mgmt.databoxedge.v2019_07_01.models.NetworkGroup :ivar port: The port. :vartype port: int """ @@ -1517,7 +1520,7 @@ class NetworkSettings(ARMBaseModel): :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[~azure.mgmt.databoxedge.models.NetworkAdapter] + :vartype network_adapters: list[~azure.mgmt.databoxedge.v2019_07_01.models.NetworkAdapter] """ _validation = { @@ -1557,7 +1560,7 @@ class Node(ARMBaseModel): :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 ~azure.mgmt.databoxedge.models.NodeStatus + :vartype node_status: str or ~azure.mgmt.databoxedge.v2019_07_01.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. @@ -1619,7 +1622,7 @@ class NodeList(msrest.serialization.Model): Variables are only populated by the server, and will be ignored when sending a request. :ivar value: The list of Nodes. - :vartype value: list[~azure.mgmt.databoxedge.models.Node] + :vartype value: list[~azure.mgmt.databoxedge.v2019_07_01.models.Node] """ _validation = { @@ -1644,11 +1647,11 @@ class Operation(msrest.serialization.Model): :param name: Name of the operation. :type name: str :param display: Properties displayed for the operation. - :type display: ~azure.mgmt.databoxedge.models.OperationDisplay + :type display: ~azure.mgmt.databoxedge.v2019_07_01.models.OperationDisplay :param origin: Origin of the operation. :type origin: str :param service_specification: Service specification. - :type service_specification: ~azure.mgmt.databoxedge.models.ServiceSpecification + :type service_specification: ~azure.mgmt.databoxedge.v2019_07_01.models.ServiceSpecification """ _attribute_map = { @@ -1706,7 +1709,7 @@ class OperationsList(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. :param value: Required. The value. - :type value: list[~azure.mgmt.databoxedge.models.Operation] + :type value: list[~azure.mgmt.databoxedge.v2019_07_01.models.Operation] :param next_link: Link to the next set of results. :type next_link: str """ @@ -1741,21 +1744,21 @@ class Order(ARMBaseModel): :ivar type: The hierarchical type of the object. :vartype type: str :param contact_information: The contact details. - :type contact_information: ~azure.mgmt.databoxedge.models.ContactDetails + :type contact_information: ~azure.mgmt.databoxedge.v2019_07_01.models.ContactDetails :param shipping_address: The shipping address. - :type shipping_address: ~azure.mgmt.databoxedge.models.Address + :type shipping_address: ~azure.mgmt.databoxedge.v2019_07_01.models.Address :param current_status: Current status of the order. - :type current_status: ~azure.mgmt.databoxedge.models.OrderStatus + :type current_status: ~azure.mgmt.databoxedge.v2019_07_01.models.OrderStatus :ivar order_history: List of status changes in the order. - :vartype order_history: list[~azure.mgmt.databoxedge.models.OrderStatus] + :vartype order_history: list[~azure.mgmt.databoxedge.v2019_07_01.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[~azure.mgmt.databoxedge.models.TrackingInfo] + :vartype delivery_tracking_info: list[~azure.mgmt.databoxedge.v2019_07_01.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[~azure.mgmt.databoxedge.models.TrackingInfo] + :vartype return_tracking_info: list[~azure.mgmt.databoxedge.v2019_07_01.models.TrackingInfo] """ _validation = { @@ -1801,7 +1804,7 @@ class OrderList(msrest.serialization.Model): Variables are only populated by the server, and will be ignored when sending a request. :ivar value: The list of orders. - :vartype value: list[~azure.mgmt.databoxedge.models.Order] + :vartype value: list[~azure.mgmt.databoxedge.v2019_07_01.models.Order] :ivar next_link: Link to the next set of results. :vartype next_link: str """ @@ -1836,7 +1839,7 @@ class OrderStatus(msrest.serialization.Model): include: "Untracked", "AwaitingFulfilment", "AwaitingPreparation", "AwaitingShipment", "Shipped", "Arriving", "Delivered", "ReplacementRequested", "LostDevice", "Declined", "ReturnInitiated", "AwaitingReturnShipment", "ShippedBack", "CollectedAtMicrosoft". - :type status: str or ~azure.mgmt.databoxedge.models.OrderState + :type status: str or ~azure.mgmt.databoxedge.v2019_07_01.models.OrderState :ivar update_date_time: Time of status update. :vartype update_date_time: ~datetime.datetime :param comments: Comments related to this status change. @@ -1879,11 +1882,11 @@ class PeriodicTimerEventTrigger(Trigger): :vartype type: str :param kind: Required. Trigger Kind.Constant filled by server. Possible values include: "FileEvent", "PeriodicTimerEvent". - :type kind: str or ~azure.mgmt.databoxedge.models.TriggerEventType + :type kind: str or ~azure.mgmt.databoxedge.v2019_07_01.models.TriggerEventType :param source_info: Required. Periodic timer details. - :type source_info: ~azure.mgmt.databoxedge.models.PeriodicTimerSourceInfo + :type source_info: ~azure.mgmt.databoxedge.v2019_07_01.models.PeriodicTimerSourceInfo :param sink_info: Required. Role Sink information. - :type sink_info: ~azure.mgmt.databoxedge.models.RoleSinkInfo + :type sink_info: ~azure.mgmt.databoxedge.v2019_07_01.models.RoleSinkInfo :param custom_context_tag: A custom context tag typically used to correlate the trigger against its usage. For example, if a periodic timer trigger is intended for certain specific IoT modules in the device, the tag can be the name or the image URL of the module. @@ -1999,7 +2002,7 @@ class RoleList(msrest.serialization.Model): Variables are only populated by the server, and will be ignored when sending a request. :ivar value: The Value. - :vartype value: list[~azure.mgmt.databoxedge.models.Role] + :vartype value: list[~azure.mgmt.databoxedge.v2019_07_01.models.Role] :ivar next_link: Link to the next set of results. :vartype next_link: str """ @@ -2065,7 +2068,8 @@ class SecuritySettings(ARMBaseModel): (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: ~azure.mgmt.databoxedge.models.AsymmetricEncryptedSecret + :type device_admin_password: + ~azure.mgmt.databoxedge.v2019_07_01.models.AsymmetricEncryptedSecret """ _validation = { @@ -2094,7 +2098,8 @@ class ServiceSpecification(msrest.serialization.Model): """Service specification. :param metric_specifications: Metric specification as defined by shoebox. - :type metric_specifications: list[~azure.mgmt.databoxedge.models.MetricSpecificationV1] + :type metric_specifications: + list[~azure.mgmt.databoxedge.v2019_07_01.models.MetricSpecificationV1] """ _attribute_map = { @@ -2126,27 +2131,27 @@ class Share(ARMBaseModel): :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 ~azure.mgmt.databoxedge.models.ShareStatus + :type share_status: str or ~azure.mgmt.databoxedge.v2019_07_01.models.ShareStatus :param monitoring_status: Required. Current monitoring status of the share. Possible values include: "Enabled", "Disabled". - :type monitoring_status: str or ~azure.mgmt.databoxedge.models.MonitoringStatus + :type monitoring_status: str or ~azure.mgmt.databoxedge.v2019_07_01.models.MonitoringStatus :param azure_container_info: Azure container mapping for the share. - :type azure_container_info: ~azure.mgmt.databoxedge.models.AzureContainerInfo + :type azure_container_info: ~azure.mgmt.databoxedge.v2019_07_01.models.AzureContainerInfo :param access_protocol: Required. Access protocol to be used by the share. Possible values include: "SMB", "NFS". - :type access_protocol: str or ~azure.mgmt.databoxedge.models.ShareAccessProtocol + :type access_protocol: str or ~azure.mgmt.databoxedge.v2019_07_01.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[~azure.mgmt.databoxedge.models.UserAccessRight] + :type user_access_rights: list[~azure.mgmt.databoxedge.v2019_07_01.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[~azure.mgmt.databoxedge.models.ClientAccessRight] + :type client_access_rights: list[~azure.mgmt.databoxedge.v2019_07_01.models.ClientAccessRight] :param refresh_details: Details of the refresh job on this share. - :type refresh_details: ~azure.mgmt.databoxedge.models.RefreshDetails + :type refresh_details: ~azure.mgmt.databoxedge.v2019_07_01.models.RefreshDetails :ivar share_mappings: Share mount point to the role. - :vartype share_mappings: list[~azure.mgmt.databoxedge.models.MountPointMap] + :vartype share_mappings: list[~azure.mgmt.databoxedge.v2019_07_01.models.MountPointMap] :param data_policy: Data policy of the share. Possible values include: "Cloud", "Local". - :type data_policy: str or ~azure.mgmt.databoxedge.models.DataPolicy + :type data_policy: str or ~azure.mgmt.databoxedge.v2019_07_01.models.DataPolicy """ _validation = { @@ -2201,7 +2206,7 @@ class ShareAccessRight(msrest.serialization.Model): :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 ~azure.mgmt.databoxedge.models.ShareAccessType + :type access_type: str or ~azure.mgmt.databoxedge.v2019_07_01.models.ShareAccessType """ _validation = { @@ -2229,7 +2234,7 @@ class ShareList(msrest.serialization.Model): Variables are only populated by the server, and will be ignored when sending a request. :ivar value: The list of shares. - :vartype value: list[~azure.mgmt.databoxedge.models.Share] + :vartype value: list[~azure.mgmt.databoxedge.v2019_07_01.models.Share] :ivar next_link: Link to the next set of results. :vartype next_link: str """ @@ -2257,9 +2262,9 @@ class Sku(msrest.serialization.Model): """The SKU type. :param name: SKU name. Possible values include: "Gateway", "Edge". - :type name: str or ~azure.mgmt.databoxedge.models.SkuName + :type name: str or ~azure.mgmt.databoxedge.v2019_07_01.models.SkuName :param tier: The SKU tier. This is based on the SKU name. Possible values include: "Standard". - :type tier: str or ~azure.mgmt.databoxedge.models.SkuTier + :type tier: str or ~azure.mgmt.databoxedge.v2019_07_01.models.SkuTier """ _attribute_map = { @@ -2294,18 +2299,18 @@ class StorageAccountCredential(ARMBaseModel): :param user_name: Username for the storage account. :type user_name: str :param account_key: Encrypted storage key. - :type account_key: ~azure.mgmt.databoxedge.models.AsymmetricEncryptedSecret + :type account_key: ~azure.mgmt.databoxedge.v2019_07_01.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 ~azure.mgmt.databoxedge.models.SSLStatus + :type ssl_status: str or ~azure.mgmt.databoxedge.v2019_07_01.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 ~azure.mgmt.databoxedge.models.AccountType + :type account_type: str or ~azure.mgmt.databoxedge.v2019_07_01.models.AccountType :param storage_account_id: Id of the storage account. :type storage_account_id: str """ @@ -2354,7 +2359,7 @@ class StorageAccountCredentialList(msrest.serialization.Model): Variables are only populated by the server, and will be ignored when sending a request. :ivar value: The value. - :vartype value: list[~azure.mgmt.databoxedge.models.StorageAccountCredential] + :vartype value: list[~azure.mgmt.databoxedge.v2019_07_01.models.StorageAccountCredential] :ivar next_link: Link to the next set of results. :vartype next_link: str """ @@ -2382,7 +2387,7 @@ class SymmetricKey(msrest.serialization.Model): """Symmetric key for authentication. :param connection_string: Connection string based on the symmetric key. - :type connection_string: ~azure.mgmt.databoxedge.models.AsymmetricEncryptedSecret + :type connection_string: ~azure.mgmt.databoxedge.v2019_07_01.models.AsymmetricEncryptedSecret """ _attribute_map = { @@ -2434,7 +2439,7 @@ class TriggerList(msrest.serialization.Model): Variables are only populated by the server, and will be ignored when sending a request. :ivar value: The list of triggers. - :vartype value: list[~azure.mgmt.databoxedge.models.Trigger] + :vartype value: list[~azure.mgmt.databoxedge.v2019_07_01.models.Trigger] :ivar next_link: Link to the next set of results. :vartype next_link: str """ @@ -2465,7 +2470,7 @@ class UpdateDownloadProgress(msrest.serialization.Model): :ivar download_phase: The download phase. Possible values include: "Unknown", "Initializing", "Downloading", "Verifying". - :vartype download_phase: str or ~azure.mgmt.databoxedge.models.DownloadPhase + :vartype download_phase: str or ~azure.mgmt.databoxedge.v2019_07_01.models.DownloadPhase :ivar percent_complete: Percentage of completion. :vartype percent_complete: int :ivar total_bytes_to_download: Total bytes to download. @@ -2579,10 +2584,12 @@ class UpdateSummary(ARMBaseModel): :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 ~azure.mgmt.databoxedge.models.InstallRebootBehavior + :vartype reboot_behavior: str or + ~azure.mgmt.databoxedge.v2019_07_01.models.InstallRebootBehavior :ivar ongoing_update_operation: The current update operation. Possible values include: "None", "Scan", "Download", "Install". - :vartype ongoing_update_operation: str or ~azure.mgmt.databoxedge.models.UpdateOperation + :vartype ongoing_update_operation: str or + ~azure.mgmt.databoxedge.v2019_07_01.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. @@ -2672,7 +2679,7 @@ class UploadCertificateRequest(msrest.serialization.Model): :param authentication_type: The authentication type. Possible values include: "Invalid", "AzureActiveDirectory". - :type authentication_type: str or ~azure.mgmt.databoxedge.models.AuthenticationType + :type authentication_type: str or ~azure.mgmt.databoxedge.v2019_07_01.models.AuthenticationType :param certificate: Required. The base64 encoded certificate raw data. :type certificate: str """ @@ -2702,7 +2709,7 @@ class UploadCertificateResponse(msrest.serialization.Model): :param auth_type: Specifies authentication type. Possible values include: "Invalid", "AzureActiveDirectory". - :type auth_type: str or ~azure.mgmt.databoxedge.models.AuthenticationType + :type auth_type: str or ~azure.mgmt.databoxedge.v2019_07_01.models.AuthenticationType :param resource_id: Required. The resource ID of the Data Box Edge/Gateway device. :type resource_id: str :param aad_authority: Required. Azure Active Directory tenant authority. @@ -2764,10 +2771,10 @@ class User(ARMBaseModel): :ivar type: The hierarchical type of the object. :vartype type: str :param encrypted_password: The password details. - :type encrypted_password: ~azure.mgmt.databoxedge.models.AsymmetricEncryptedSecret + :type encrypted_password: ~azure.mgmt.databoxedge.v2019_07_01.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[~azure.mgmt.databoxedge.models.ShareAccessRight] + :type share_access_rights: list[~azure.mgmt.databoxedge.v2019_07_01.models.ShareAccessRight] """ _validation = { @@ -2802,7 +2809,7 @@ class UserAccessRight(msrest.serialization.Model): :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 ~azure.mgmt.databoxedge.models.ShareAccessType + :type access_type: str or ~azure.mgmt.databoxedge.v2019_07_01.models.ShareAccessType """ _validation = { @@ -2830,7 +2837,7 @@ class UserList(msrest.serialization.Model): Variables are only populated by the server, and will be ignored when sending a request. :ivar value: The list of users. - :vartype value: list[~azure.mgmt.databoxedge.models.User] + :vartype value: list[~azure.mgmt.databoxedge.v2019_07_01.models.User] :ivar next_link: Link to the next set of results. :vartype next_link: str """ diff --git a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_07_01/models/_models_py3.py b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_07_01/models/_models_py3.py index 1097569d7632..8ae27675c6ba 100644 --- a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_07_01/models/_models_py3.py +++ b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_07_01/models/_models_py3.py @@ -131,9 +131,9 @@ class Alert(ARMBaseModel): :vartype recommendation: str :ivar severity: Severity of the alert. Possible values include: "Informational", "Warning", "Critical". - :vartype severity: str or ~azure.mgmt.databoxedge.models.AlertSeverity + :vartype severity: str or ~azure.mgmt.databoxedge.v2019_07_01.models.AlertSeverity :ivar error_details: Error details of the alert. - :vartype error_details: ~azure.mgmt.databoxedge.models.AlertErrorDetails + :vartype error_details: ~azure.mgmt.databoxedge.v2019_07_01.models.AlertErrorDetails :ivar detailed_information: Alert details. :vartype detailed_information: dict[str, str] """ @@ -219,7 +219,7 @@ class AlertList(msrest.serialization.Model): Variables are only populated by the server, and will be ignored when sending a request. :ivar value: The value. - :vartype value: list[~azure.mgmt.databoxedge.models.Alert] + :vartype value: list[~azure.mgmt.databoxedge.v2019_07_01.models.Alert] :ivar next_link: Link to the next set of results. :vartype next_link: str """ @@ -255,7 +255,8 @@ class AsymmetricEncryptedSecret(msrest.serialization.Model): :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 ~azure.mgmt.databoxedge.models.EncryptionAlgorithm + :type encryption_algorithm: str or + ~azure.mgmt.databoxedge.v2019_07_01.models.EncryptionAlgorithm """ _validation = { @@ -287,7 +288,7 @@ class Authentication(msrest.serialization.Model): """Authentication mechanism for IoT devices. :param symmetric_key: Symmetric key for authentication. - :type symmetric_key: ~azure.mgmt.databoxedge.models.SymmetricKey + :type symmetric_key: ~azure.mgmt.databoxedge.v2019_07_01.models.SymmetricKey """ _attribute_map = { @@ -317,7 +318,7 @@ class AzureContainerInfo(msrest.serialization.Model): :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 ~azure.mgmt.databoxedge.models.AzureContainerDataFormat + :type data_format: str or ~azure.mgmt.databoxedge.v2019_07_01.models.AzureContainerDataFormat """ _validation = { @@ -366,7 +367,7 @@ class BandwidthSchedule(ARMBaseModel): :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 ~azure.mgmt.databoxedge.models.DayOfWeek] + :type days: list[str or ~azure.mgmt.databoxedge.v2019_07_01.models.DayOfWeek] """ _validation = { @@ -411,7 +412,7 @@ class BandwidthSchedulesList(msrest.serialization.Model): 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[~azure.mgmt.databoxedge.models.BandwidthSchedule] + :vartype value: list[~azure.mgmt.databoxedge.v2019_07_01.models.BandwidthSchedule] :ivar next_link: Link to the next set of results. :vartype next_link: str """ @@ -444,7 +445,7 @@ class ClientAccessRight(msrest.serialization.Model): :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 ~azure.mgmt.databoxedge.models.ClientPermissionType + :type access_permission: str or ~azure.mgmt.databoxedge.v2019_07_01.models.ClientPermissionType """ _validation = { @@ -479,7 +480,7 @@ class CloudErrorBody(msrest.serialization.Model): interface. :type message: str :param details: A list of additional details about the error. - :type details: list[~azure.mgmt.databoxedge.models.CloudErrorBody] + :type details: list[~azure.mgmt.databoxedge.v2019_07_01.models.CloudErrorBody] """ _attribute_map = { @@ -569,14 +570,14 @@ class DataBoxEdgeDevice(ARMBaseModel): to view and group this device (across resource groups). :type tags: dict[str, str] :param sku: The SKU type. - :type sku: ~azure.mgmt.databoxedge.models.Sku + :type sku: ~azure.mgmt.databoxedge.v2019_07_01.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 - ~azure.mgmt.databoxedge.models.DataBoxEdgeDeviceStatus + ~azure.mgmt.databoxedge.v2019_07_01.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. @@ -585,7 +586,7 @@ class DataBoxEdgeDevice(ARMBaseModel): :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 ~azure.mgmt.databoxedge.models.DeviceType + :vartype device_type: str or ~azure.mgmt.databoxedge.v2019_07_01.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. @@ -601,7 +602,8 @@ class DataBoxEdgeDevice(ARMBaseModel): :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 ~azure.mgmt.databoxedge.models.RoleTypes] + :vartype configured_role_types: list[str or + ~azure.mgmt.databoxedge.v2019_07_01.models.RoleTypes] :ivar node_count: The number of nodes in the cluster. :vartype node_count: int """ @@ -736,7 +738,7 @@ class DataBoxEdgeDeviceList(msrest.serialization.Model): 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[~azure.mgmt.databoxedge.models.DataBoxEdgeDevice] + :vartype value: list[~azure.mgmt.databoxedge.v2019_07_01.models.DataBoxEdgeDevice] :ivar next_link: Link to the next set of results. :vartype next_link: str """ @@ -799,7 +801,7 @@ class Trigger(ARMBaseModel): :vartype type: str :param kind: Required. Trigger Kind.Constant filled by server. Possible values include: "FileEvent", "PeriodicTimerEvent". - :type kind: str or ~azure.mgmt.databoxedge.models.TriggerEventType + :type kind: str or ~azure.mgmt.databoxedge.v2019_07_01.models.TriggerEventType """ _validation = { @@ -843,11 +845,11 @@ class FileEventTrigger(Trigger): :vartype type: str :param kind: Required. Trigger Kind.Constant filled by server. Possible values include: "FileEvent", "PeriodicTimerEvent". - :type kind: str or ~azure.mgmt.databoxedge.models.TriggerEventType + :type kind: str or ~azure.mgmt.databoxedge.v2019_07_01.models.TriggerEventType :param source_info: Required. File event source details. - :type source_info: ~azure.mgmt.databoxedge.models.FileSourceInfo + :type source_info: ~azure.mgmt.databoxedge.v2019_07_01.models.FileSourceInfo :param sink_info: Required. Role sink info. - :type sink_info: ~azure.mgmt.databoxedge.models.RoleSinkInfo + :type sink_info: ~azure.mgmt.databoxedge.v2019_07_01.models.RoleSinkInfo :param custom_context_tag: A custom context tag typically used to correlate the trigger against its usage. For example, if a periodic timer trigger is intended for certain specific IoT modules in the device, the tag can be the name or the image URL of the module. @@ -927,7 +929,7 @@ class IoTDeviceInfo(msrest.serialization.Model): :param io_t_host_hub_id: Id of the IoT hub associated to the device. :type io_t_host_hub_id: str :param authentication: IoT device authentication info. - :type authentication: ~azure.mgmt.databoxedge.models.Authentication + :type authentication: ~azure.mgmt.databoxedge.v2019_07_01.models.Authentication """ _validation = { @@ -976,7 +978,7 @@ class Role(ARMBaseModel): :vartype type: str :param kind: Required. Role type.Constant filled by server. Possible values include: "IOT", "ASA", "Functions", "Cognitive". - :type kind: str or ~azure.mgmt.databoxedge.models.RoleTypes + :type kind: str or ~azure.mgmt.databoxedge.v2019_07_01.models.RoleTypes """ _validation = { @@ -1020,19 +1022,19 @@ class IoTRole(Role): :vartype type: str :param kind: Required. Role type.Constant filled by server. Possible values include: "IOT", "ASA", "Functions", "Cognitive". - :type kind: str or ~azure.mgmt.databoxedge.models.RoleTypes + :type kind: str or ~azure.mgmt.databoxedge.v2019_07_01.models.RoleTypes :param host_platform: Host OS supported by the IoT role. Possible values include: "Windows", "Linux". - :type host_platform: str or ~azure.mgmt.databoxedge.models.PlatformType + :type host_platform: str or ~azure.mgmt.databoxedge.v2019_07_01.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: ~azure.mgmt.databoxedge.models.IoTDeviceInfo + :type io_t_device_details: ~azure.mgmt.databoxedge.v2019_07_01.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: ~azure.mgmt.databoxedge.models.IoTDeviceInfo + :type io_t_edge_device_details: ~azure.mgmt.databoxedge.v2019_07_01.models.IoTDeviceInfo :param share_mappings: Mount points of shares in role(s). - :type share_mappings: list[~azure.mgmt.databoxedge.models.MountPointMap] + :type share_mappings: list[~azure.mgmt.databoxedge.v2019_07_01.models.MountPointMap] :param role_status: Role status. Possible values include: "Enabled", "Disabled". - :type role_status: str or ~azure.mgmt.databoxedge.models.RoleStatus + :type role_status: str or ~azure.mgmt.databoxedge.v2019_07_01.models.RoleStatus """ _validation = { @@ -1156,7 +1158,7 @@ class Job(msrest.serialization.Model): :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 ~azure.mgmt.databoxedge.models.JobStatus + :vartype status: str or ~azure.mgmt.databoxedge.v2019_07_01.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. @@ -1164,19 +1166,19 @@ class Job(msrest.serialization.Model): :ivar percent_complete: The percentage of the job that is complete. :vartype percent_complete: int :ivar error: The error details. - :vartype error: ~azure.mgmt.databoxedge.models.JobErrorDetails + :vartype error: ~azure.mgmt.databoxedge.v2019_07_01.models.JobErrorDetails :ivar job_type: The type of the job. Possible values include: "Invalid", "ScanForUpdates", "DownloadUpdates", "InstallUpdates", "RefreshShare". - :vartype job_type: str or ~azure.mgmt.databoxedge.models.JobType + :vartype job_type: str or ~azure.mgmt.databoxedge.v2019_07_01.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 ~azure.mgmt.databoxedge.models.UpdateOperationStage + :vartype current_stage: str or ~azure.mgmt.databoxedge.v2019_07_01.models.UpdateOperationStage :ivar download_progress: The download progress. - :vartype download_progress: ~azure.mgmt.databoxedge.models.UpdateDownloadProgress + :vartype download_progress: ~azure.mgmt.databoxedge.v2019_07_01.models.UpdateDownloadProgress :ivar install_progress: The install progress. - :vartype install_progress: ~azure.mgmt.databoxedge.models.UpdateInstallProgress + :vartype install_progress: ~azure.mgmt.databoxedge.v2019_07_01.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 @@ -1257,7 +1259,7 @@ class JobErrorDetails(msrest.serialization.Model): 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[~azure.mgmt.databoxedge.models.JobErrorItem] + :vartype error_details: list[~azure.mgmt.databoxedge.v2019_07_01.models.JobErrorItem] :ivar code: The code intended for programmatic access. :vartype code: str :ivar message: The message that describes the error in detail. @@ -1363,23 +1365,24 @@ class MetricSpecificationV1(msrest.serialization.Model): :type display_description: str :param unit: Metric units. Possible values include: "NotSpecified", "Percent", "Count", "Seconds", "Milliseconds", "Bytes", "BytesPerSecond", "CountPerSecond". - :type unit: str or ~azure.mgmt.databoxedge.models.MetricUnit + :type unit: str or ~azure.mgmt.databoxedge.v2019_07_01.models.MetricUnit :param aggregation_type: Metric aggregation type. Possible values include: "NotSpecified", "None", "Average", "Minimum", "Maximum", "Total", "Count". - :type aggregation_type: str or ~azure.mgmt.databoxedge.models.MetricAggregationType + :type aggregation_type: str or ~azure.mgmt.databoxedge.v2019_07_01.models.MetricAggregationType :param dimensions: Metric dimensions, other than default dimension which is resource. - :type dimensions: list[~azure.mgmt.databoxedge.models.MetricDimensionV1] + :type dimensions: list[~azure.mgmt.databoxedge.v2019_07_01.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 ~azure.mgmt.databoxedge.models.MetricCategory + :type category: str or ~azure.mgmt.databoxedge.v2019_07_01.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 ~azure.mgmt.databoxedge.models.TimeGrain] + :type supported_time_grain_types: list[str or + ~azure.mgmt.databoxedge.v2019_07_01.models.TimeGrain] :param supported_aggregation_types: Support metric aggregation type. :type supported_aggregation_types: list[str or - ~azure.mgmt.databoxedge.models.MetricAggregationType] + ~azure.mgmt.databoxedge.v2019_07_01.models.MetricAggregationType] """ _attribute_map = { @@ -1440,7 +1443,7 @@ class MountPointMap(msrest.serialization.Model): :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 ~azure.mgmt.databoxedge.models.RoleTypes + :vartype role_type: str or ~azure.mgmt.databoxedge.v2019_07_01.models.RoleTypes """ _validation = { @@ -1478,7 +1481,7 @@ class NetworkAdapter(msrest.serialization.Model): :ivar adapter_id: Instance ID of network adapter. :vartype adapter_id: str :ivar adapter_position: Hardware position of network adapter. - :vartype adapter_position: ~azure.mgmt.databoxedge.models.NetworkAdapterPosition + :vartype adapter_position: ~azure.mgmt.databoxedge.v2019_07_01.models.NetworkAdapterPosition :ivar index: Logical index of the adapter. :vartype index: int :ivar node_id: Node ID of the network adapter. @@ -1493,17 +1496,17 @@ class NetworkAdapter(msrest.serialization.Model): :vartype link_speed: long :ivar status: Value indicating whether this adapter is valid. Possible values include: "Inactive", "Active". - :vartype status: str or ~azure.mgmt.databoxedge.models.NetworkAdapterStatus + :vartype status: str or ~azure.mgmt.databoxedge.v2019_07_01.models.NetworkAdapterStatus :param rdma_status: Value indicating whether this adapter is RDMA capable. Possible values include: "Incapable", "Capable". - :type rdma_status: str or ~azure.mgmt.databoxedge.models.NetworkAdapterRDMAStatus + :type rdma_status: str or ~azure.mgmt.databoxedge.v2019_07_01.models.NetworkAdapterRDMAStatus :param dhcp_status: Value indicating whether this adapter has DHCP enabled. Possible values include: "Disabled", "Enabled". - :type dhcp_status: str or ~azure.mgmt.databoxedge.models.NetworkAdapterDHCPStatus + :type dhcp_status: str or ~azure.mgmt.databoxedge.v2019_07_01.models.NetworkAdapterDHCPStatus :ivar ipv4_configuration: The IPv4 configuration of the network adapter. - :vartype ipv4_configuration: ~azure.mgmt.databoxedge.models.Ipv4Config + :vartype ipv4_configuration: ~azure.mgmt.databoxedge.v2019_07_01.models.Ipv4Config :ivar ipv6_configuration: The IPv6 configuration of the network adapter. - :vartype ipv6_configuration: ~azure.mgmt.databoxedge.models.Ipv6Config + :vartype ipv6_configuration: ~azure.mgmt.databoxedge.v2019_07_01.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. @@ -1575,7 +1578,7 @@ class NetworkAdapterPosition(msrest.serialization.Model): 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 ~azure.mgmt.databoxedge.models.NetworkGroup + :vartype network_group: str or ~azure.mgmt.databoxedge.v2019_07_01.models.NetworkGroup :ivar port: The port. :vartype port: int """ @@ -1611,7 +1614,7 @@ class NetworkSettings(ARMBaseModel): :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[~azure.mgmt.databoxedge.models.NetworkAdapter] + :vartype network_adapters: list[~azure.mgmt.databoxedge.v2019_07_01.models.NetworkAdapter] """ _validation = { @@ -1651,7 +1654,7 @@ class Node(ARMBaseModel): :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 ~azure.mgmt.databoxedge.models.NodeStatus + :vartype node_status: str or ~azure.mgmt.databoxedge.v2019_07_01.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. @@ -1713,7 +1716,7 @@ class NodeList(msrest.serialization.Model): Variables are only populated by the server, and will be ignored when sending a request. :ivar value: The list of Nodes. - :vartype value: list[~azure.mgmt.databoxedge.models.Node] + :vartype value: list[~azure.mgmt.databoxedge.v2019_07_01.models.Node] """ _validation = { @@ -1738,11 +1741,11 @@ class Operation(msrest.serialization.Model): :param name: Name of the operation. :type name: str :param display: Properties displayed for the operation. - :type display: ~azure.mgmt.databoxedge.models.OperationDisplay + :type display: ~azure.mgmt.databoxedge.v2019_07_01.models.OperationDisplay :param origin: Origin of the operation. :type origin: str :param service_specification: Service specification. - :type service_specification: ~azure.mgmt.databoxedge.models.ServiceSpecification + :type service_specification: ~azure.mgmt.databoxedge.v2019_07_01.models.ServiceSpecification """ _attribute_map = { @@ -1810,7 +1813,7 @@ class OperationsList(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. :param value: Required. The value. - :type value: list[~azure.mgmt.databoxedge.models.Operation] + :type value: list[~azure.mgmt.databoxedge.v2019_07_01.models.Operation] :param next_link: Link to the next set of results. :type next_link: str """ @@ -1848,21 +1851,21 @@ class Order(ARMBaseModel): :ivar type: The hierarchical type of the object. :vartype type: str :param contact_information: The contact details. - :type contact_information: ~azure.mgmt.databoxedge.models.ContactDetails + :type contact_information: ~azure.mgmt.databoxedge.v2019_07_01.models.ContactDetails :param shipping_address: The shipping address. - :type shipping_address: ~azure.mgmt.databoxedge.models.Address + :type shipping_address: ~azure.mgmt.databoxedge.v2019_07_01.models.Address :param current_status: Current status of the order. - :type current_status: ~azure.mgmt.databoxedge.models.OrderStatus + :type current_status: ~azure.mgmt.databoxedge.v2019_07_01.models.OrderStatus :ivar order_history: List of status changes in the order. - :vartype order_history: list[~azure.mgmt.databoxedge.models.OrderStatus] + :vartype order_history: list[~azure.mgmt.databoxedge.v2019_07_01.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[~azure.mgmt.databoxedge.models.TrackingInfo] + :vartype delivery_tracking_info: list[~azure.mgmt.databoxedge.v2019_07_01.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[~azure.mgmt.databoxedge.models.TrackingInfo] + :vartype return_tracking_info: list[~azure.mgmt.databoxedge.v2019_07_01.models.TrackingInfo] """ _validation = { @@ -1912,7 +1915,7 @@ class OrderList(msrest.serialization.Model): Variables are only populated by the server, and will be ignored when sending a request. :ivar value: The list of orders. - :vartype value: list[~azure.mgmt.databoxedge.models.Order] + :vartype value: list[~azure.mgmt.databoxedge.v2019_07_01.models.Order] :ivar next_link: Link to the next set of results. :vartype next_link: str """ @@ -1947,7 +1950,7 @@ class OrderStatus(msrest.serialization.Model): include: "Untracked", "AwaitingFulfilment", "AwaitingPreparation", "AwaitingShipment", "Shipped", "Arriving", "Delivered", "ReplacementRequested", "LostDevice", "Declined", "ReturnInitiated", "AwaitingReturnShipment", "ShippedBack", "CollectedAtMicrosoft". - :type status: str or ~azure.mgmt.databoxedge.models.OrderState + :type status: str or ~azure.mgmt.databoxedge.v2019_07_01.models.OrderState :ivar update_date_time: Time of status update. :vartype update_date_time: ~datetime.datetime :param comments: Comments related to this status change. @@ -1993,11 +1996,11 @@ class PeriodicTimerEventTrigger(Trigger): :vartype type: str :param kind: Required. Trigger Kind.Constant filled by server. Possible values include: "FileEvent", "PeriodicTimerEvent". - :type kind: str or ~azure.mgmt.databoxedge.models.TriggerEventType + :type kind: str or ~azure.mgmt.databoxedge.v2019_07_01.models.TriggerEventType :param source_info: Required. Periodic timer details. - :type source_info: ~azure.mgmt.databoxedge.models.PeriodicTimerSourceInfo + :type source_info: ~azure.mgmt.databoxedge.v2019_07_01.models.PeriodicTimerSourceInfo :param sink_info: Required. Role Sink information. - :type sink_info: ~azure.mgmt.databoxedge.models.RoleSinkInfo + :type sink_info: ~azure.mgmt.databoxedge.v2019_07_01.models.RoleSinkInfo :param custom_context_tag: A custom context tag typically used to correlate the trigger against its usage. For example, if a periodic timer trigger is intended for certain specific IoT modules in the device, the tag can be the name or the image URL of the module. @@ -2126,7 +2129,7 @@ class RoleList(msrest.serialization.Model): Variables are only populated by the server, and will be ignored when sending a request. :ivar value: The Value. - :vartype value: list[~azure.mgmt.databoxedge.models.Role] + :vartype value: list[~azure.mgmt.databoxedge.v2019_07_01.models.Role] :ivar next_link: Link to the next set of results. :vartype next_link: str """ @@ -2194,7 +2197,8 @@ class SecuritySettings(ARMBaseModel): (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: ~azure.mgmt.databoxedge.models.AsymmetricEncryptedSecret + :type device_admin_password: + ~azure.mgmt.databoxedge.v2019_07_01.models.AsymmetricEncryptedSecret """ _validation = { @@ -2225,7 +2229,8 @@ class ServiceSpecification(msrest.serialization.Model): """Service specification. :param metric_specifications: Metric specification as defined by shoebox. - :type metric_specifications: list[~azure.mgmt.databoxedge.models.MetricSpecificationV1] + :type metric_specifications: + list[~azure.mgmt.databoxedge.v2019_07_01.models.MetricSpecificationV1] """ _attribute_map = { @@ -2259,27 +2264,27 @@ class Share(ARMBaseModel): :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 ~azure.mgmt.databoxedge.models.ShareStatus + :type share_status: str or ~azure.mgmt.databoxedge.v2019_07_01.models.ShareStatus :param monitoring_status: Required. Current monitoring status of the share. Possible values include: "Enabled", "Disabled". - :type monitoring_status: str or ~azure.mgmt.databoxedge.models.MonitoringStatus + :type monitoring_status: str or ~azure.mgmt.databoxedge.v2019_07_01.models.MonitoringStatus :param azure_container_info: Azure container mapping for the share. - :type azure_container_info: ~azure.mgmt.databoxedge.models.AzureContainerInfo + :type azure_container_info: ~azure.mgmt.databoxedge.v2019_07_01.models.AzureContainerInfo :param access_protocol: Required. Access protocol to be used by the share. Possible values include: "SMB", "NFS". - :type access_protocol: str or ~azure.mgmt.databoxedge.models.ShareAccessProtocol + :type access_protocol: str or ~azure.mgmt.databoxedge.v2019_07_01.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[~azure.mgmt.databoxedge.models.UserAccessRight] + :type user_access_rights: list[~azure.mgmt.databoxedge.v2019_07_01.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[~azure.mgmt.databoxedge.models.ClientAccessRight] + :type client_access_rights: list[~azure.mgmt.databoxedge.v2019_07_01.models.ClientAccessRight] :param refresh_details: Details of the refresh job on this share. - :type refresh_details: ~azure.mgmt.databoxedge.models.RefreshDetails + :type refresh_details: ~azure.mgmt.databoxedge.v2019_07_01.models.RefreshDetails :ivar share_mappings: Share mount point to the role. - :vartype share_mappings: list[~azure.mgmt.databoxedge.models.MountPointMap] + :vartype share_mappings: list[~azure.mgmt.databoxedge.v2019_07_01.models.MountPointMap] :param data_policy: Data policy of the share. Possible values include: "Cloud", "Local". - :type data_policy: str or ~azure.mgmt.databoxedge.models.DataPolicy + :type data_policy: str or ~azure.mgmt.databoxedge.v2019_07_01.models.DataPolicy """ _validation = { @@ -2344,7 +2349,7 @@ class ShareAccessRight(msrest.serialization.Model): :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 ~azure.mgmt.databoxedge.models.ShareAccessType + :type access_type: str or ~azure.mgmt.databoxedge.v2019_07_01.models.ShareAccessType """ _validation = { @@ -2375,7 +2380,7 @@ class ShareList(msrest.serialization.Model): Variables are only populated by the server, and will be ignored when sending a request. :ivar value: The list of shares. - :vartype value: list[~azure.mgmt.databoxedge.models.Share] + :vartype value: list[~azure.mgmt.databoxedge.v2019_07_01.models.Share] :ivar next_link: Link to the next set of results. :vartype next_link: str """ @@ -2403,9 +2408,9 @@ class Sku(msrest.serialization.Model): """The SKU type. :param name: SKU name. Possible values include: "Gateway", "Edge". - :type name: str or ~azure.mgmt.databoxedge.models.SkuName + :type name: str or ~azure.mgmt.databoxedge.v2019_07_01.models.SkuName :param tier: The SKU tier. This is based on the SKU name. Possible values include: "Standard". - :type tier: str or ~azure.mgmt.databoxedge.models.SkuTier + :type tier: str or ~azure.mgmt.databoxedge.v2019_07_01.models.SkuTier """ _attribute_map = { @@ -2443,18 +2448,18 @@ class StorageAccountCredential(ARMBaseModel): :param user_name: Username for the storage account. :type user_name: str :param account_key: Encrypted storage key. - :type account_key: ~azure.mgmt.databoxedge.models.AsymmetricEncryptedSecret + :type account_key: ~azure.mgmt.databoxedge.v2019_07_01.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 ~azure.mgmt.databoxedge.models.SSLStatus + :type ssl_status: str or ~azure.mgmt.databoxedge.v2019_07_01.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 ~azure.mgmt.databoxedge.models.AccountType + :type account_type: str or ~azure.mgmt.databoxedge.v2019_07_01.models.AccountType :param storage_account_id: Id of the storage account. :type storage_account_id: str """ @@ -2512,7 +2517,7 @@ class StorageAccountCredentialList(msrest.serialization.Model): Variables are only populated by the server, and will be ignored when sending a request. :ivar value: The value. - :vartype value: list[~azure.mgmt.databoxedge.models.StorageAccountCredential] + :vartype value: list[~azure.mgmt.databoxedge.v2019_07_01.models.StorageAccountCredential] :ivar next_link: Link to the next set of results. :vartype next_link: str """ @@ -2540,7 +2545,7 @@ class SymmetricKey(msrest.serialization.Model): """Symmetric key for authentication. :param connection_string: Connection string based on the symmetric key. - :type connection_string: ~azure.mgmt.databoxedge.models.AsymmetricEncryptedSecret + :type connection_string: ~azure.mgmt.databoxedge.v2019_07_01.models.AsymmetricEncryptedSecret """ _attribute_map = { @@ -2599,7 +2604,7 @@ class TriggerList(msrest.serialization.Model): Variables are only populated by the server, and will be ignored when sending a request. :ivar value: The list of triggers. - :vartype value: list[~azure.mgmt.databoxedge.models.Trigger] + :vartype value: list[~azure.mgmt.databoxedge.v2019_07_01.models.Trigger] :ivar next_link: Link to the next set of results. :vartype next_link: str """ @@ -2630,7 +2635,7 @@ class UpdateDownloadProgress(msrest.serialization.Model): :ivar download_phase: The download phase. Possible values include: "Unknown", "Initializing", "Downloading", "Verifying". - :vartype download_phase: str or ~azure.mgmt.databoxedge.models.DownloadPhase + :vartype download_phase: str or ~azure.mgmt.databoxedge.v2019_07_01.models.DownloadPhase :ivar percent_complete: Percentage of completion. :vartype percent_complete: int :ivar total_bytes_to_download: Total bytes to download. @@ -2744,10 +2749,12 @@ class UpdateSummary(ARMBaseModel): :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 ~azure.mgmt.databoxedge.models.InstallRebootBehavior + :vartype reboot_behavior: str or + ~azure.mgmt.databoxedge.v2019_07_01.models.InstallRebootBehavior :ivar ongoing_update_operation: The current update operation. Possible values include: "None", "Scan", "Download", "Install". - :vartype ongoing_update_operation: str or ~azure.mgmt.databoxedge.models.UpdateOperation + :vartype ongoing_update_operation: str or + ~azure.mgmt.databoxedge.v2019_07_01.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. @@ -2842,7 +2849,7 @@ class UploadCertificateRequest(msrest.serialization.Model): :param authentication_type: The authentication type. Possible values include: "Invalid", "AzureActiveDirectory". - :type authentication_type: str or ~azure.mgmt.databoxedge.models.AuthenticationType + :type authentication_type: str or ~azure.mgmt.databoxedge.v2019_07_01.models.AuthenticationType :param certificate: Required. The base64 encoded certificate raw data. :type certificate: str """ @@ -2875,7 +2882,7 @@ class UploadCertificateResponse(msrest.serialization.Model): :param auth_type: Specifies authentication type. Possible values include: "Invalid", "AzureActiveDirectory". - :type auth_type: str or ~azure.mgmt.databoxedge.models.AuthenticationType + :type auth_type: str or ~azure.mgmt.databoxedge.v2019_07_01.models.AuthenticationType :param resource_id: Required. The resource ID of the Data Box Edge/Gateway device. :type resource_id: str :param aad_authority: Required. Azure Active Directory tenant authority. @@ -2945,10 +2952,10 @@ class User(ARMBaseModel): :ivar type: The hierarchical type of the object. :vartype type: str :param encrypted_password: The password details. - :type encrypted_password: ~azure.mgmt.databoxedge.models.AsymmetricEncryptedSecret + :type encrypted_password: ~azure.mgmt.databoxedge.v2019_07_01.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[~azure.mgmt.databoxedge.models.ShareAccessRight] + :type share_access_rights: list[~azure.mgmt.databoxedge.v2019_07_01.models.ShareAccessRight] """ _validation = { @@ -2986,7 +2993,7 @@ class UserAccessRight(msrest.serialization.Model): :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 ~azure.mgmt.databoxedge.models.ShareAccessType + :type access_type: str or ~azure.mgmt.databoxedge.v2019_07_01.models.ShareAccessType """ _validation = { @@ -3017,7 +3024,7 @@ class UserList(msrest.serialization.Model): Variables are only populated by the server, and will be ignored when sending a request. :ivar value: The list of users. - :vartype value: list[~azure.mgmt.databoxedge.models.User] + :vartype value: list[~azure.mgmt.databoxedge.v2019_07_01.models.User] :ivar next_link: Link to the next set of results. :vartype next_link: str """ diff --git a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_07_01/operations/_alerts_operations.py b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_07_01/operations/_alerts_operations.py index b403ad2c9929..a9186ae3352d 100644 --- a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_07_01/operations/_alerts_operations.py +++ b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_07_01/operations/_alerts_operations.py @@ -30,7 +30,7 @@ class AlertsOperations(object): instantiates it for you and attaches it as an attribute. :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.databoxedge.models + :type models: ~azure.mgmt.databoxedge.v2019_07_01.models :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. @@ -60,7 +60,7 @@ def list_by_data_box_edge_device( :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[~azure.mgmt.databoxedge.models.AlertList] + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.databoxedge.v2019_07_01.models.AlertList] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.AlertList"] @@ -140,7 +140,7 @@ def get( :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: ~azure.mgmt.databoxedge.models.Alert + :rtype: ~azure.mgmt.databoxedge.v2019_07_01.models.Alert :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.Alert"] diff --git a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_07_01/operations/_bandwidth_schedules_operations.py b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_07_01/operations/_bandwidth_schedules_operations.py index 727445b727cc..2d59ed718fa0 100644 --- a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_07_01/operations/_bandwidth_schedules_operations.py +++ b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_07_01/operations/_bandwidth_schedules_operations.py @@ -32,7 +32,7 @@ class BandwidthSchedulesOperations(object): instantiates it for you and attaches it as an attribute. :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.databoxedge.models + :type models: ~azure.mgmt.databoxedge.v2019_07_01.models :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. @@ -62,7 +62,7 @@ def list_by_data_box_edge_device( :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[~azure.mgmt.databoxedge.models.BandwidthSchedulesList] + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.databoxedge.v2019_07_01.models.BandwidthSchedulesList] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.BandwidthSchedulesList"] @@ -140,7 +140,7 @@ def get( :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: ~azure.mgmt.databoxedge.models.BandwidthSchedule + :rtype: ~azure.mgmt.databoxedge.v2019_07_01.models.BandwidthSchedule :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.BandwidthSchedule"] @@ -261,15 +261,15 @@ def begin_create_or_update( :param resource_group_name: The resource group name. :type resource_group_name: str :param parameters: The bandwidth schedule to be added or updated. - :type parameters: ~azure.mgmt.databoxedge.models.BandwidthSchedule + :type parameters: ~azure.mgmt.databoxedge.v2019_07_01.models.BandwidthSchedule :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: True for ARMPolling, False for no polling, or a - polling object for personal polling strategy + :keyword polling: Pass in True if you'd like the ARMPolling polling method, + False for no polling, or your own initialized polling object for a 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[~azure.mgmt.databoxedge.models.BandwidthSchedule] + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.databoxedge.v2019_07_01.models.BandwidthSchedule] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] @@ -385,8 +385,8 @@ def begin_delete( :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 + :keyword polling: Pass in True if you'd like the ARMPolling polling method, + False for no polling, or your own initialized polling object for a 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) diff --git a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_07_01/operations/_devices_operations.py b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_07_01/operations/_devices_operations.py index 510c81d28240..e1c98ec9a63f 100644 --- a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_07_01/operations/_devices_operations.py +++ b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_07_01/operations/_devices_operations.py @@ -32,7 +32,7 @@ class DevicesOperations(object): instantiates it for you and attaches it as an attribute. :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.databoxedge.models + :type models: ~azure.mgmt.databoxedge.v2019_07_01.models :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. @@ -60,7 +60,7 @@ def list_by_subscription( :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[~azure.mgmt.databoxedge.models.DataBoxEdgeDeviceList] + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.databoxedge.v2019_07_01.models.DataBoxEdgeDeviceList] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.DataBoxEdgeDeviceList"] @@ -136,7 +136,7 @@ def list_by_resource_group( :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[~azure.mgmt.databoxedge.models.DataBoxEdgeDeviceList] + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.databoxedge.v2019_07_01.models.DataBoxEdgeDeviceList] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.DataBoxEdgeDeviceList"] @@ -212,7 +212,7 @@ def get( :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: ~azure.mgmt.databoxedge.models.DataBoxEdgeDevice + :rtype: ~azure.mgmt.databoxedge.v2019_07_01.models.DataBoxEdgeDevice :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.DataBoxEdgeDevice"] @@ -325,15 +325,15 @@ def begin_create_or_update( :param resource_group_name: The resource group name. :type resource_group_name: str :param data_box_edge_device: The resource object. - :type data_box_edge_device: ~azure.mgmt.databoxedge.models.DataBoxEdgeDevice + :type data_box_edge_device: ~azure.mgmt.databoxedge.v2019_07_01.models.DataBoxEdgeDevice :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 + :keyword polling: Pass in True if you'd like the ARMPolling polling method, + False for no polling, or your own initialized polling object for a 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[~azure.mgmt.databoxedge.models.DataBoxEdgeDevice] + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.databoxedge.v2019_07_01.models.DataBoxEdgeDevice] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] @@ -442,8 +442,8 @@ def begin_delete( :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 + :keyword polling: Pass in True if you'd like the ARMPolling polling method, + False for no polling, or your own initialized polling object for a 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) @@ -507,10 +507,10 @@ def update( :param resource_group_name: The resource group name. :type resource_group_name: str :param parameters: The resource parameters. - :type parameters: ~azure.mgmt.databoxedge.models.DataBoxEdgeDevicePatch + :type parameters: ~azure.mgmt.databoxedge.v2019_07_01.models.DataBoxEdgeDevicePatch :keyword callable cls: A custom type or function that will be passed the direct response :return: DataBoxEdgeDevice, or the result of cls(response) - :rtype: ~azure.mgmt.databoxedge.models.DataBoxEdgeDevice + :rtype: ~azure.mgmt.databoxedge.v2019_07_01.models.DataBoxEdgeDevice :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.DataBoxEdgeDevice"] @@ -621,8 +621,8 @@ def begin_download_updates( :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 + :keyword polling: Pass in True if you'd like the ARMPolling polling method, + False for no polling, or your own initialized polling object for a 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) @@ -686,7 +686,7 @@ def get_extended_information( :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: ~azure.mgmt.databoxedge.models.DataBoxEdgeDeviceExtendedInfo + :rtype: ~azure.mgmt.databoxedge.v2019_07_01.models.DataBoxEdgeDeviceExtendedInfo :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.DataBoxEdgeDeviceExtendedInfo"] @@ -792,8 +792,8 @@ def begin_install_updates( :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 + :keyword polling: Pass in True if you'd like the ARMPolling polling method, + False for no polling, or your own initialized polling object for a 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) @@ -857,7 +857,7 @@ def get_network_settings( :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: ~azure.mgmt.databoxedge.models.NetworkSettings + :rtype: ~azure.mgmt.databoxedge.v2019_07_01.models.NetworkSettings :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkSettings"] @@ -963,8 +963,8 @@ def begin_scan_for_updates( :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 + :keyword polling: Pass in True if you'd like the ARMPolling polling method, + False for no polling, or your own initialized polling object for a 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) @@ -1079,11 +1079,11 @@ def begin_create_or_update_security_settings( :param resource_group_name: The resource group name. :type resource_group_name: str :param security_settings: The security settings. - :type security_settings: ~azure.mgmt.databoxedge.models.SecuritySettings + :type security_settings: ~azure.mgmt.databoxedge.v2019_07_01.models.SecuritySettings :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: True for ARMPolling, False for no polling, or a - polling object for personal polling strategy + :keyword polling: Pass in True if you'd like the ARMPolling polling method, + False for no polling, or your own initialized polling object for a 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) @@ -1151,7 +1151,7 @@ def get_update_summary( :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: ~azure.mgmt.databoxedge.models.UpdateSummary + :rtype: ~azure.mgmt.databoxedge.v2019_07_01.models.UpdateSummary :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.UpdateSummary"] @@ -1210,10 +1210,10 @@ def upload_certificate( :param resource_group_name: The resource group name. :type resource_group_name: str :param parameters: The upload certificate request. - :type parameters: ~azure.mgmt.databoxedge.models.UploadCertificateRequest + :type parameters: ~azure.mgmt.databoxedge.v2019_07_01.models.UploadCertificateRequest :keyword callable cls: A custom type or function that will be passed the direct response :return: UploadCertificateResponse, or the result of cls(response) - :rtype: ~azure.mgmt.databoxedge.models.UploadCertificateResponse + :rtype: ~azure.mgmt.databoxedge.v2019_07_01.models.UploadCertificateResponse :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.UploadCertificateResponse"] diff --git a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_07_01/operations/_jobs_operations.py b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_07_01/operations/_jobs_operations.py index 23ac010f92f1..561dd867f1e6 100644 --- a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_07_01/operations/_jobs_operations.py +++ b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_07_01/operations/_jobs_operations.py @@ -29,7 +29,7 @@ class JobsOperations(object): instantiates it for you and attaches it as an attribute. :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.databoxedge.models + :type models: ~azure.mgmt.databoxedge.v2019_07_01.models :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. @@ -64,7 +64,7 @@ def get( :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: ~azure.mgmt.databoxedge.models.Job + :rtype: ~azure.mgmt.databoxedge.v2019_07_01.models.Job :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.Job"] diff --git a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_07_01/operations/_nodes_operations.py b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_07_01/operations/_nodes_operations.py index 7c21eb6986e2..d27783f71dc1 100644 --- a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_07_01/operations/_nodes_operations.py +++ b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_07_01/operations/_nodes_operations.py @@ -30,7 +30,7 @@ class NodesOperations(object): instantiates it for you and attaches it as an attribute. :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.databoxedge.models + :type models: ~azure.mgmt.databoxedge.v2019_07_01.models :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. @@ -60,7 +60,7 @@ def list_by_data_box_edge_device( :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[~azure.mgmt.databoxedge.models.NodeList] + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.databoxedge.v2019_07_01.models.NodeList] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.NodeList"] diff --git a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_07_01/operations/_operations.py b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_07_01/operations/_operations.py index accdd9530127..175e9a141ede 100644 --- a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_07_01/operations/_operations.py +++ b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_07_01/operations/_operations.py @@ -30,7 +30,7 @@ class Operations(object): instantiates it for you and attaches it as an attribute. :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.databoxedge.models + :type models: ~azure.mgmt.databoxedge.v2019_07_01.models :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. @@ -56,7 +56,7 @@ def list( :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[~azure.mgmt.databoxedge.models.OperationsList] + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.databoxedge.v2019_07_01.models.OperationsList] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationsList"] diff --git a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_07_01/operations/_operations_status_operations.py b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_07_01/operations/_operations_status_operations.py index 617e5112afaa..e67f78f60dad 100644 --- a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_07_01/operations/_operations_status_operations.py +++ b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_07_01/operations/_operations_status_operations.py @@ -29,7 +29,7 @@ class OperationsStatusOperations(object): instantiates it for you and attaches it as an attribute. :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.databoxedge.models + :type models: ~azure.mgmt.databoxedge.v2019_07_01.models :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. @@ -64,7 +64,7 @@ def get( :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: ~azure.mgmt.databoxedge.models.Job + :rtype: ~azure.mgmt.databoxedge.v2019_07_01.models.Job :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.Job"] diff --git a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_07_01/operations/_orders_operations.py b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_07_01/operations/_orders_operations.py index 64266df2480e..fa7e56a2dcb7 100644 --- a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_07_01/operations/_orders_operations.py +++ b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_07_01/operations/_orders_operations.py @@ -32,7 +32,7 @@ class OrdersOperations(object): instantiates it for you and attaches it as an attribute. :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.databoxedge.models + :type models: ~azure.mgmt.databoxedge.v2019_07_01.models :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. @@ -64,7 +64,7 @@ def list_by_data_box_edge_device( :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[~azure.mgmt.databoxedge.models.OrderList] + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.databoxedge.v2019_07_01.models.OrderList] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.OrderList"] @@ -141,7 +141,7 @@ def get( :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: ~azure.mgmt.databoxedge.models.Order + :rtype: ~azure.mgmt.databoxedge.v2019_07_01.models.Order :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.Order"] @@ -258,15 +258,15 @@ def begin_create_or_update( :param resource_group_name: The resource group name. :type resource_group_name: str :param order: The order to be created or updated. - :type order: ~azure.mgmt.databoxedge.models.Order + :type order: ~azure.mgmt.databoxedge.v2019_07_01.models.Order :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: True for ARMPolling, False for no polling, or a - polling object for personal polling strategy + :keyword polling: Pass in True if you'd like the ARMPolling polling method, + False for no polling, or your own initialized polling object for a 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[~azure.mgmt.databoxedge.models.Order] + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.databoxedge.v2019_07_01.models.Order] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] @@ -377,8 +377,8 @@ def begin_delete( :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 + :keyword polling: Pass in True if you'd like the ARMPolling polling method, + False for no polling, or your own initialized polling object for a 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) diff --git a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_07_01/operations/_roles_operations.py b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_07_01/operations/_roles_operations.py index 8d2e610afc0e..2c7f33f1d31e 100644 --- a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_07_01/operations/_roles_operations.py +++ b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_07_01/operations/_roles_operations.py @@ -32,7 +32,7 @@ class RolesOperations(object): instantiates it for you and attaches it as an attribute. :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.databoxedge.models + :type models: ~azure.mgmt.databoxedge.v2019_07_01.models :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. @@ -62,7 +62,7 @@ def list_by_data_box_edge_device( :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[~azure.mgmt.databoxedge.models.RoleList] + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.databoxedge.v2019_07_01.models.RoleList] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.RoleList"] @@ -140,7 +140,7 @@ def get( :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: ~azure.mgmt.databoxedge.models.Role + :rtype: ~azure.mgmt.databoxedge.v2019_07_01.models.Role :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.Role"] @@ -261,15 +261,15 @@ def begin_create_or_update( :param resource_group_name: The resource group name. :type resource_group_name: str :param role: The role properties. - :type role: ~azure.mgmt.databoxedge.models.Role + :type role: ~azure.mgmt.databoxedge.v2019_07_01.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 + :keyword polling: Pass in True if you'd like the ARMPolling polling method, + False for no polling, or your own initialized polling object for a 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[~azure.mgmt.databoxedge.models.Role] + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.databoxedge.v2019_07_01.models.Role] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] @@ -385,8 +385,8 @@ def begin_delete( :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 + :keyword polling: Pass in True if you'd like the ARMPolling polling method, + False for no polling, or your own initialized polling object for a 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) diff --git a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_07_01/operations/_shares_operations.py b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_07_01/operations/_shares_operations.py index 67fd5bddb455..dc6a461b1808 100644 --- a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_07_01/operations/_shares_operations.py +++ b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_07_01/operations/_shares_operations.py @@ -32,7 +32,7 @@ class SharesOperations(object): instantiates it for you and attaches it as an attribute. :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.databoxedge.models + :type models: ~azure.mgmt.databoxedge.v2019_07_01.models :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. @@ -64,7 +64,7 @@ def list_by_data_box_edge_device( :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[~azure.mgmt.databoxedge.models.ShareList] + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.databoxedge.v2019_07_01.models.ShareList] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.ShareList"] @@ -144,7 +144,7 @@ def get( :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: ~azure.mgmt.databoxedge.models.Share + :rtype: ~azure.mgmt.databoxedge.v2019_07_01.models.Share :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.Share"] @@ -267,15 +267,15 @@ def begin_create_or_update( :param resource_group_name: The resource group name. :type resource_group_name: str :param share: The share properties. - :type share: ~azure.mgmt.databoxedge.models.Share + :type share: ~azure.mgmt.databoxedge.v2019_07_01.models.Share :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: True for ARMPolling, False for no polling, or a - polling object for personal polling strategy + :keyword polling: Pass in True if you'd like the ARMPolling polling method, + False for no polling, or your own initialized polling object for a 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[~azure.mgmt.databoxedge.models.Share] + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.databoxedge.v2019_07_01.models.Share] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] @@ -391,8 +391,8 @@ def begin_delete( :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 + :keyword polling: Pass in True if you'd like the ARMPolling polling method, + False for no polling, or your own initialized polling object for a 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) @@ -510,8 +510,8 @@ def begin_refresh( :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 + :keyword polling: Pass in True if you'd like the ARMPolling polling method, + False for no polling, or your own initialized polling object for a 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) diff --git a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_07_01/operations/_storage_account_credentials_operations.py b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_07_01/operations/_storage_account_credentials_operations.py index 7c4b6e83f263..5f5eefec1248 100644 --- a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_07_01/operations/_storage_account_credentials_operations.py +++ b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_07_01/operations/_storage_account_credentials_operations.py @@ -32,7 +32,7 @@ class StorageAccountCredentialsOperations(object): instantiates it for you and attaches it as an attribute. :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.databoxedge.models + :type models: ~azure.mgmt.databoxedge.v2019_07_01.models :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. @@ -64,7 +64,7 @@ def list_by_data_box_edge_device( :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[~azure.mgmt.databoxedge.models.StorageAccountCredentialList] + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.databoxedge.v2019_07_01.models.StorageAccountCredentialList] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.StorageAccountCredentialList"] @@ -142,7 +142,7 @@ def get( :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: ~azure.mgmt.databoxedge.models.StorageAccountCredential + :rtype: ~azure.mgmt.databoxedge.v2019_07_01.models.StorageAccountCredential :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.StorageAccountCredential"] @@ -263,15 +263,15 @@ def begin_create_or_update( :param resource_group_name: The resource group name. :type resource_group_name: str :param storage_account_credential: The storage account credential. - :type storage_account_credential: ~azure.mgmt.databoxedge.models.StorageAccountCredential + :type storage_account_credential: ~azure.mgmt.databoxedge.v2019_07_01.models.StorageAccountCredential :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: True for ARMPolling, False for no polling, or a - polling object for personal polling strategy + :keyword polling: Pass in True if you'd like the ARMPolling polling method, + False for no polling, or your own initialized polling object for a 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[~azure.mgmt.databoxedge.models.StorageAccountCredential] + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.databoxedge.v2019_07_01.models.StorageAccountCredential] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] @@ -387,8 +387,8 @@ def begin_delete( :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 + :keyword polling: Pass in True if you'd like the ARMPolling polling method, + False for no polling, or your own initialized polling object for a 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) diff --git a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_07_01/operations/_triggers_operations.py b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_07_01/operations/_triggers_operations.py index 00f0d161b5ef..9c2ed94ccc52 100644 --- a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_07_01/operations/_triggers_operations.py +++ b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_07_01/operations/_triggers_operations.py @@ -32,7 +32,7 @@ class TriggersOperations(object): instantiates it for you and attaches it as an attribute. :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.databoxedge.models + :type models: ~azure.mgmt.databoxedge.v2019_07_01.models :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. @@ -66,7 +66,7 @@ def list_by_data_box_edge_device( :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 TriggerList or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.databoxedge.models.TriggerList] + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.databoxedge.v2019_07_01.models.TriggerList] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.TriggerList"] @@ -146,7 +146,7 @@ def get( :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: ~azure.mgmt.databoxedge.models.Trigger + :rtype: ~azure.mgmt.databoxedge.v2019_07_01.models.Trigger :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.Trigger"] @@ -267,15 +267,15 @@ def begin_create_or_update( :param resource_group_name: The resource group name. :type resource_group_name: str :param trigger: The trigger. - :type trigger: ~azure.mgmt.databoxedge.models.Trigger + :type trigger: ~azure.mgmt.databoxedge.v2019_07_01.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 + :keyword polling: Pass in True if you'd like the ARMPolling polling method, + False for no polling, or your own initialized polling object for a 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[~azure.mgmt.databoxedge.models.Trigger] + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.databoxedge.v2019_07_01.models.Trigger] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] @@ -391,8 +391,8 @@ def begin_delete( :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 + :keyword polling: Pass in True if you'd like the ARMPolling polling method, + False for no polling, or your own initialized polling object for a 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) diff --git a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_07_01/operations/_users_operations.py b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_07_01/operations/_users_operations.py index 665edc0435b7..6eea2a22d3d6 100644 --- a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_07_01/operations/_users_operations.py +++ b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_07_01/operations/_users_operations.py @@ -32,7 +32,7 @@ class UsersOperations(object): instantiates it for you and attaches it as an attribute. :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.databoxedge.models + :type models: ~azure.mgmt.databoxedge.v2019_07_01.models :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. @@ -62,7 +62,7 @@ def list_by_data_box_edge_device( :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 UserList or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.databoxedge.models.UserList] + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.databoxedge.v2019_07_01.models.UserList] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.UserList"] @@ -140,7 +140,7 @@ def get( :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: ~azure.mgmt.databoxedge.models.User + :rtype: ~azure.mgmt.databoxedge.v2019_07_01.models.User :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.User"] @@ -262,15 +262,15 @@ def begin_create_or_update( :param resource_group_name: The resource group name. :type resource_group_name: str :param user: The user details. - :type user: ~azure.mgmt.databoxedge.models.User + :type user: ~azure.mgmt.databoxedge.v2019_07_01.models.User :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: True for ARMPolling, False for no polling, or a - polling object for personal polling strategy + :keyword polling: Pass in True if you'd like the ARMPolling polling method, + False for no polling, or your own initialized polling object for a 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[~azure.mgmt.databoxedge.models.User] + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.databoxedge.v2019_07_01.models.User] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] @@ -386,8 +386,8 @@ def begin_delete( :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 + :keyword polling: Pass in True if you'd like the ARMPolling polling method, + False for no polling, or your own initialized polling object for a 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) diff --git a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_08_01/_data_box_edge_management_client.py b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_08_01/_data_box_edge_management_client.py index 0be723e7c905..0af6918216f3 100644 --- a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_08_01/_data_box_edge_management_client.py +++ b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_08_01/_data_box_edge_management_client.py @@ -16,6 +16,7 @@ from typing import Any, Optional from azure.core.credentials import TokenCredential + from azure.core.pipeline.transport import HttpRequest, HttpResponse from ._configuration import DataBoxEdgeManagementClientConfiguration from .operations import Operations @@ -41,37 +42,37 @@ class DataBoxEdgeManagementClient(object): """The DataBoxEdge Client. :ivar operations: Operations operations - :vartype operations: azure.mgmt.databoxedge.operations.Operations + :vartype operations: azure.mgmt.databoxedge.v2019_08_01.operations.Operations :ivar devices: DevicesOperations operations - :vartype devices: azure.mgmt.databoxedge.operations.DevicesOperations + :vartype devices: azure.mgmt.databoxedge.v2019_08_01.operations.DevicesOperations :ivar alerts: AlertsOperations operations - :vartype alerts: azure.mgmt.databoxedge.operations.AlertsOperations + :vartype alerts: azure.mgmt.databoxedge.v2019_08_01.operations.AlertsOperations :ivar bandwidth_schedules: BandwidthSchedulesOperations operations - :vartype bandwidth_schedules: azure.mgmt.databoxedge.operations.BandwidthSchedulesOperations + :vartype bandwidth_schedules: azure.mgmt.databoxedge.v2019_08_01.operations.BandwidthSchedulesOperations :ivar jobs: JobsOperations operations - :vartype jobs: azure.mgmt.databoxedge.operations.JobsOperations + :vartype jobs: azure.mgmt.databoxedge.v2019_08_01.operations.JobsOperations :ivar nodes: NodesOperations operations - :vartype nodes: azure.mgmt.databoxedge.operations.NodesOperations + :vartype nodes: azure.mgmt.databoxedge.v2019_08_01.operations.NodesOperations :ivar operations_status: OperationsStatusOperations operations - :vartype operations_status: azure.mgmt.databoxedge.operations.OperationsStatusOperations + :vartype operations_status: azure.mgmt.databoxedge.v2019_08_01.operations.OperationsStatusOperations :ivar orders: OrdersOperations operations - :vartype orders: azure.mgmt.databoxedge.operations.OrdersOperations + :vartype orders: azure.mgmt.databoxedge.v2019_08_01.operations.OrdersOperations :ivar roles: RolesOperations operations - :vartype roles: azure.mgmt.databoxedge.operations.RolesOperations + :vartype roles: azure.mgmt.databoxedge.v2019_08_01.operations.RolesOperations :ivar shares: SharesOperations operations - :vartype shares: azure.mgmt.databoxedge.operations.SharesOperations + :vartype shares: azure.mgmt.databoxedge.v2019_08_01.operations.SharesOperations :ivar storage_account_credentials: StorageAccountCredentialsOperations operations - :vartype storage_account_credentials: azure.mgmt.databoxedge.operations.StorageAccountCredentialsOperations + :vartype storage_account_credentials: azure.mgmt.databoxedge.v2019_08_01.operations.StorageAccountCredentialsOperations :ivar storage_accounts: StorageAccountsOperations operations - :vartype storage_accounts: azure.mgmt.databoxedge.operations.StorageAccountsOperations + :vartype storage_accounts: azure.mgmt.databoxedge.v2019_08_01.operations.StorageAccountsOperations :ivar containers: ContainersOperations operations - :vartype containers: azure.mgmt.databoxedge.operations.ContainersOperations + :vartype containers: azure.mgmt.databoxedge.v2019_08_01.operations.ContainersOperations :ivar triggers: TriggersOperations operations - :vartype triggers: azure.mgmt.databoxedge.operations.TriggersOperations + :vartype triggers: azure.mgmt.databoxedge.v2019_08_01.operations.TriggersOperations :ivar users: UsersOperations operations - :vartype users: azure.mgmt.databoxedge.operations.UsersOperations + :vartype users: azure.mgmt.databoxedge.v2019_08_01.operations.UsersOperations :ivar skus: SkusOperations operations - :vartype skus: azure.mgmt.databoxedge.operations.SkusOperations + :vartype skus: azure.mgmt.databoxedge.v2019_08_01.operations.SkusOperations :param credential: Credential needed for the client to connect to Azure. :type credential: ~azure.core.credentials.TokenCredential :param subscription_id: The subscription ID. @@ -131,6 +132,24 @@ def __init__( self.skus = SkusOperations( self._client, self._config, self._serialize, self._deserialize) + def _send_request(self, http_request, **kwargs): + # type: (HttpRequest, Any) -> HttpResponse + """Runs the network request through the client's chained policies. + + :param http_request: The network request you want to make. Required. + :type http_request: ~azure.core.pipeline.transport.HttpRequest + :keyword bool stream: Whether the response payload will be streamed. Defaults to True. + :return: The response of your network call. Does not do error handling on your response. + :rtype: ~azure.core.pipeline.transport.HttpResponse + """ + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + http_request.url = self._client.format_url(http_request.url, **path_format_arguments) + stream = kwargs.pop("stream", True) + pipeline_response = self._client._pipeline.run(http_request, stream=stream, **kwargs) + return pipeline_response.http_response + def close(self): # type: () -> None self._client.close() diff --git a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_08_01/_metadata.json b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_08_01/_metadata.json index 972f6ab4463a..df175d3bbf33 100644 --- a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_08_01/_metadata.json +++ b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_08_01/_metadata.json @@ -9,7 +9,9 @@ "custom_base_url": null, "azure_arm": true, "has_lro_operations": true, - "client_side_validation": false + "client_side_validation": false, + "sync_imports": "{\"typing\": {\"azurecore\": {\"azure.core.credentials\": [\"TokenCredential\"]}}, \"regular\": {\"azurecore\": {\"azure.profiles\": [\"KnownProfiles\", \"ProfileDefinition\"], \"azure.profiles.multiapiclient\": [\"MultiApiClientMixin\"], \"msrest\": [\"Deserializer\", \"Serializer\"], \"azure.mgmt.core\": [\"ARMPipelineClient\"]}, \"local\": {\"._configuration\": [\"DataBoxEdgeManagementClientConfiguration\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}, \"azurecore\": {\"azure.core.pipeline.transport\": [\"HttpRequest\", \"HttpResponse\"]}}}", + "async_imports": "{\"typing\": {\"azurecore\": {\"azure.core.credentials_async\": [\"AsyncTokenCredential\"]}}, \"regular\": {\"azurecore\": {\"azure.profiles\": [\"KnownProfiles\", \"ProfileDefinition\"], \"azure.profiles.multiapiclient\": [\"MultiApiClientMixin\"], \"msrest\": [\"Deserializer\", \"Serializer\"], \"azure.mgmt.core\": [\"AsyncARMPipelineClient\"]}, \"local\": {\"._configuration\": [\"DataBoxEdgeManagementClientConfiguration\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}, \"azurecore\": {\"azure.core.pipeline.transport\": [\"AsyncHttpResponse\", \"HttpRequest\"]}}}" }, "global_parameters": { "sync": { @@ -28,13 +30,13 @@ }, "async": { "credential": { - "signature": "credential, # type: \"AsyncTokenCredential\"", + "signature": "credential: \"AsyncTokenCredential\",", "description": "Credential needed for the client to connect to Azure.", "docstring_type": "~azure.core.credentials_async.AsyncTokenCredential", "required": true }, "subscription_id": { - "signature": "subscription_id, # type: str", + "signature": "subscription_id: str,", "description": "The subscription ID.", "docstring_type": "str", "required": true @@ -42,14 +44,58 @@ }, "constant": { }, - "call": "credential, subscription_id" + "call": "credential, subscription_id", + "service_client_specific": { + "sync": { + "api_version": { + "signature": "api_version=None, # type: Optional[str]", + "description": "API version to use if no profile is provided, or if missing in profile.", + "docstring_type": "str", + "required": false + }, + "base_url": { + "signature": "base_url=None, # type: Optional[str]", + "description": "Service URL", + "docstring_type": "str", + "required": false + }, + "profile": { + "signature": "profile=KnownProfiles.default, # type: KnownProfiles", + "description": "A profile definition, from KnownProfiles to dict.", + "docstring_type": "azure.profiles.KnownProfiles", + "required": false + } + }, + "async": { + "api_version": { + "signature": "api_version: Optional[str] = None,", + "description": "API version to use if no profile is provided, or if missing in profile.", + "docstring_type": "str", + "required": false + }, + "base_url": { + "signature": "base_url: Optional[str] = None,", + "description": "Service URL", + "docstring_type": "str", + "required": false + }, + "profile": { + "signature": "profile: KnownProfiles = KnownProfiles.default,", + "description": "A profile definition, from KnownProfiles to dict.", + "docstring_type": "azure.profiles.KnownProfiles", + "required": false + } + } + } }, "config": { "credential": true, "credential_scopes": ["https://management.azure.com/.default"], "credential_default_policy_type": "BearerTokenCredentialPolicy", "credential_default_policy_type_has_async_version": true, - "credential_key_header_name": null + "credential_key_header_name": null, + "sync_imports": "{\"regular\": {\"azurecore\": {\"azure.core.configuration\": [\"Configuration\"], \"azure.core.pipeline\": [\"policies\"], \"azure.mgmt.core.policies\": [\"ARMHttpLoggingPolicy\"]}, \"local\": {\"._version\": [\"VERSION\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\"]}}, \"typing\": {\"azurecore\": {\"azure.core.credentials\": [\"TokenCredential\"]}}}", + "async_imports": "{\"regular\": {\"azurecore\": {\"azure.core.configuration\": [\"Configuration\"], \"azure.core.pipeline\": [\"policies\"], \"azure.mgmt.core.policies\": [\"ARMHttpLoggingPolicy\"]}, \"local\": {\".._version\": [\"VERSION\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\"]}}, \"typing\": {\"azurecore\": {\"azure.core.credentials_async\": [\"AsyncTokenCredential\"]}}}" }, "operation_groups": { "operations": "Operations", @@ -68,9 +114,5 @@ "triggers": "TriggersOperations", "users": "UsersOperations", "skus": "SkusOperations" - }, - "operation_mixins": { - }, - "sync_imports": "None", - "async_imports": "None" + } } \ No newline at end of file diff --git a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_08_01/aio/_data_box_edge_management_client.py b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_08_01/aio/_data_box_edge_management_client.py index 8cc9c43813e2..478a535da5e8 100644 --- a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_08_01/aio/_data_box_edge_management_client.py +++ b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_08_01/aio/_data_box_edge_management_client.py @@ -8,6 +8,7 @@ from typing import Any, Optional, TYPE_CHECKING +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core import AsyncARMPipelineClient from msrest import Deserializer, Serializer @@ -39,37 +40,37 @@ class DataBoxEdgeManagementClient(object): """The DataBoxEdge Client. :ivar operations: Operations operations - :vartype operations: azure.mgmt.databoxedge.aio.operations.Operations + :vartype operations: azure.mgmt.databoxedge.v2019_08_01.aio.operations.Operations :ivar devices: DevicesOperations operations - :vartype devices: azure.mgmt.databoxedge.aio.operations.DevicesOperations + :vartype devices: azure.mgmt.databoxedge.v2019_08_01.aio.operations.DevicesOperations :ivar alerts: AlertsOperations operations - :vartype alerts: azure.mgmt.databoxedge.aio.operations.AlertsOperations + :vartype alerts: azure.mgmt.databoxedge.v2019_08_01.aio.operations.AlertsOperations :ivar bandwidth_schedules: BandwidthSchedulesOperations operations - :vartype bandwidth_schedules: azure.mgmt.databoxedge.aio.operations.BandwidthSchedulesOperations + :vartype bandwidth_schedules: azure.mgmt.databoxedge.v2019_08_01.aio.operations.BandwidthSchedulesOperations :ivar jobs: JobsOperations operations - :vartype jobs: azure.mgmt.databoxedge.aio.operations.JobsOperations + :vartype jobs: azure.mgmt.databoxedge.v2019_08_01.aio.operations.JobsOperations :ivar nodes: NodesOperations operations - :vartype nodes: azure.mgmt.databoxedge.aio.operations.NodesOperations + :vartype nodes: azure.mgmt.databoxedge.v2019_08_01.aio.operations.NodesOperations :ivar operations_status: OperationsStatusOperations operations - :vartype operations_status: azure.mgmt.databoxedge.aio.operations.OperationsStatusOperations + :vartype operations_status: azure.mgmt.databoxedge.v2019_08_01.aio.operations.OperationsStatusOperations :ivar orders: OrdersOperations operations - :vartype orders: azure.mgmt.databoxedge.aio.operations.OrdersOperations + :vartype orders: azure.mgmt.databoxedge.v2019_08_01.aio.operations.OrdersOperations :ivar roles: RolesOperations operations - :vartype roles: azure.mgmt.databoxedge.aio.operations.RolesOperations + :vartype roles: azure.mgmt.databoxedge.v2019_08_01.aio.operations.RolesOperations :ivar shares: SharesOperations operations - :vartype shares: azure.mgmt.databoxedge.aio.operations.SharesOperations + :vartype shares: azure.mgmt.databoxedge.v2019_08_01.aio.operations.SharesOperations :ivar storage_account_credentials: StorageAccountCredentialsOperations operations - :vartype storage_account_credentials: azure.mgmt.databoxedge.aio.operations.StorageAccountCredentialsOperations + :vartype storage_account_credentials: azure.mgmt.databoxedge.v2019_08_01.aio.operations.StorageAccountCredentialsOperations :ivar storage_accounts: StorageAccountsOperations operations - :vartype storage_accounts: azure.mgmt.databoxedge.aio.operations.StorageAccountsOperations + :vartype storage_accounts: azure.mgmt.databoxedge.v2019_08_01.aio.operations.StorageAccountsOperations :ivar containers: ContainersOperations operations - :vartype containers: azure.mgmt.databoxedge.aio.operations.ContainersOperations + :vartype containers: azure.mgmt.databoxedge.v2019_08_01.aio.operations.ContainersOperations :ivar triggers: TriggersOperations operations - :vartype triggers: azure.mgmt.databoxedge.aio.operations.TriggersOperations + :vartype triggers: azure.mgmt.databoxedge.v2019_08_01.aio.operations.TriggersOperations :ivar users: UsersOperations operations - :vartype users: azure.mgmt.databoxedge.aio.operations.UsersOperations + :vartype users: azure.mgmt.databoxedge.v2019_08_01.aio.operations.UsersOperations :ivar skus: SkusOperations operations - :vartype skus: azure.mgmt.databoxedge.aio.operations.SkusOperations + :vartype skus: azure.mgmt.databoxedge.v2019_08_01.aio.operations.SkusOperations :param credential: Credential needed for the client to connect to Azure. :type credential: ~azure.core.credentials_async.AsyncTokenCredential :param subscription_id: The subscription ID. @@ -128,6 +129,23 @@ def __init__( self.skus = SkusOperations( self._client, self._config, self._serialize, self._deserialize) + async def _send_request(self, http_request: HttpRequest, **kwargs: Any) -> AsyncHttpResponse: + """Runs the network request through the client's chained policies. + + :param http_request: The network request you want to make. Required. + :type http_request: ~azure.core.pipeline.transport.HttpRequest + :keyword bool stream: Whether the response payload will be streamed. Defaults to True. + :return: The response of your network call. Does not do error handling on your response. + :rtype: ~azure.core.pipeline.transport.AsyncHttpResponse + """ + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + http_request.url = self._client.format_url(http_request.url, **path_format_arguments) + stream = kwargs.pop("stream", True) + pipeline_response = await self._client._pipeline.run(http_request, stream=stream, **kwargs) + return pipeline_response.http_response + async def close(self) -> None: await self._client.close() diff --git a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_08_01/aio/operations/_alerts_operations.py b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_08_01/aio/operations/_alerts_operations.py index 6a3053172848..a2fb12fcaa76 100644 --- a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_08_01/aio/operations/_alerts_operations.py +++ b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_08_01/aio/operations/_alerts_operations.py @@ -26,7 +26,7 @@ class AlertsOperations: instantiates it for you and attaches it as an attribute. :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.databoxedge.models + :type models: ~azure.mgmt.databoxedge.v2019_08_01.models :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. @@ -55,7 +55,7 @@ def list_by_data_box_edge_device( :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[~azure.mgmt.databoxedge.models.AlertList] + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.databoxedge.v2019_08_01.models.AlertList] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.AlertList"] @@ -134,7 +134,7 @@ async def get( :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: ~azure.mgmt.databoxedge.models.Alert + :rtype: ~azure.mgmt.databoxedge.v2019_08_01.models.Alert :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.Alert"] diff --git a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_08_01/aio/operations/_bandwidth_schedules_operations.py b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_08_01/aio/operations/_bandwidth_schedules_operations.py index 759abae259ee..ad93fee72241 100644 --- a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_08_01/aio/operations/_bandwidth_schedules_operations.py +++ b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_08_01/aio/operations/_bandwidth_schedules_operations.py @@ -28,7 +28,7 @@ class BandwidthSchedulesOperations: instantiates it for you and attaches it as an attribute. :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.databoxedge.models + :type models: ~azure.mgmt.databoxedge.v2019_08_01.models :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. @@ -57,7 +57,7 @@ def list_by_data_box_edge_device( :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[~azure.mgmt.databoxedge.models.BandwidthSchedulesList] + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.databoxedge.v2019_08_01.models.BandwidthSchedulesList] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.BandwidthSchedulesList"] @@ -134,7 +134,7 @@ async def get( :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: ~azure.mgmt.databoxedge.models.BandwidthSchedule + :rtype: ~azure.mgmt.databoxedge.v2019_08_01.models.BandwidthSchedule :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.BandwidthSchedule"] @@ -253,15 +253,15 @@ async def begin_create_or_update( :param resource_group_name: The resource group name. :type resource_group_name: str :param parameters: The bandwidth schedule to be added or updated. - :type parameters: ~azure.mgmt.databoxedge.models.BandwidthSchedule + :type parameters: ~azure.mgmt.databoxedge.v2019_08_01.models.BandwidthSchedule :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: True for ARMPolling, False for no polling, or a - polling object for personal polling strategy + :keyword polling: Pass in True if you'd like the AsyncARMPolling polling method, + False for no polling, or your own initialized polling object for a 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[~azure.mgmt.databoxedge.models.BandwidthSchedule] + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.databoxedge.v2019_08_01.models.BandwidthSchedule] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -375,8 +375,8 @@ async def begin_delete( :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 + :keyword polling: Pass in True if you'd like the AsyncARMPolling polling method, + False for no polling, or your own initialized polling object for a 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) diff --git a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_08_01/aio/operations/_containers_operations.py b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_08_01/aio/operations/_containers_operations.py index 93edc4b9b91b..1ed42763c01f 100644 --- a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_08_01/aio/operations/_containers_operations.py +++ b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_08_01/aio/operations/_containers_operations.py @@ -28,7 +28,7 @@ class ContainersOperations: instantiates it for you and attaches it as an attribute. :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.databoxedge.models + :type models: ~azure.mgmt.databoxedge.v2019_08_01.models :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. @@ -62,7 +62,7 @@ def list_by_storage_account( :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[~azure.mgmt.databoxedge.models.ContainerList] + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.databoxedge.v2019_08_01.models.ContainerList] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.ContainerList"] @@ -145,7 +145,7 @@ async def get( :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: ~azure.mgmt.databoxedge.models.Container + :rtype: ~azure.mgmt.databoxedge.v2019_08_01.models.Container :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.Container"] @@ -272,15 +272,15 @@ async def begin_create_or_update( :param resource_group_name: The resource group name. :type resource_group_name: str :param container: The container properties. - :type container: ~azure.mgmt.databoxedge.models.Container + :type container: ~azure.mgmt.databoxedge.v2019_08_01.models.Container :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: True for ARMPolling, False for no polling, or a - polling object for personal polling strategy + :keyword polling: Pass in True if you'd like the AsyncARMPolling polling method, + False for no polling, or your own initialized polling object for a 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[~azure.mgmt.databoxedge.models.Container] + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.databoxedge.v2019_08_01.models.Container] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -401,8 +401,8 @@ async def begin_delete( :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 + :keyword polling: Pass in True if you'd like the AsyncARMPolling polling method, + False for no polling, or your own initialized polling object for a 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) @@ -525,8 +525,8 @@ async def begin_refresh( :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 + :keyword polling: Pass in True if you'd like the AsyncARMPolling polling method, + False for no polling, or your own initialized polling object for a 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) diff --git a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_08_01/aio/operations/_devices_operations.py b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_08_01/aio/operations/_devices_operations.py index 7159b6e41f95..3bccba17df82 100644 --- a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_08_01/aio/operations/_devices_operations.py +++ b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_08_01/aio/operations/_devices_operations.py @@ -28,7 +28,7 @@ class DevicesOperations: instantiates it for you and attaches it as an attribute. :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.databoxedge.models + :type models: ~azure.mgmt.databoxedge.v2019_08_01.models :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. @@ -55,7 +55,7 @@ def list_by_subscription( :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[~azure.mgmt.databoxedge.models.DataBoxEdgeDeviceList] + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.databoxedge.v2019_08_01.models.DataBoxEdgeDeviceList] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.DataBoxEdgeDeviceList"] @@ -130,7 +130,7 @@ def list_by_resource_group( :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[~azure.mgmt.databoxedge.models.DataBoxEdgeDeviceList] + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.databoxedge.v2019_08_01.models.DataBoxEdgeDeviceList] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.DataBoxEdgeDeviceList"] @@ -205,7 +205,7 @@ async def get( :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: ~azure.mgmt.databoxedge.models.DataBoxEdgeDevice + :rtype: ~azure.mgmt.databoxedge.v2019_08_01.models.DataBoxEdgeDevice :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.DataBoxEdgeDevice"] @@ -316,15 +316,15 @@ async def begin_create_or_update( :param resource_group_name: The resource group name. :type resource_group_name: str :param data_box_edge_device: The resource object. - :type data_box_edge_device: ~azure.mgmt.databoxedge.models.DataBoxEdgeDevice + :type data_box_edge_device: ~azure.mgmt.databoxedge.v2019_08_01.models.DataBoxEdgeDevice :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 + :keyword polling: Pass in True if you'd like the AsyncARMPolling polling method, + False for no polling, or your own initialized polling object for a 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[~azure.mgmt.databoxedge.models.DataBoxEdgeDevice] + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.databoxedge.v2019_08_01.models.DataBoxEdgeDevice] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -431,8 +431,8 @@ async def begin_delete( :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 + :keyword polling: Pass in True if you'd like the AsyncARMPolling polling method, + False for no polling, or your own initialized polling object for a 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) @@ -495,10 +495,10 @@ async def update( :param resource_group_name: The resource group name. :type resource_group_name: str :param parameters: The resource parameters. - :type parameters: ~azure.mgmt.databoxedge.models.DataBoxEdgeDevicePatch + :type parameters: ~azure.mgmt.databoxedge.v2019_08_01.models.DataBoxEdgeDevicePatch :keyword callable cls: A custom type or function that will be passed the direct response :return: DataBoxEdgeDevice, or the result of cls(response) - :rtype: ~azure.mgmt.databoxedge.models.DataBoxEdgeDevice + :rtype: ~azure.mgmt.databoxedge.v2019_08_01.models.DataBoxEdgeDevice :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.DataBoxEdgeDevice"] @@ -607,8 +607,8 @@ async def begin_download_updates( :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 + :keyword polling: Pass in True if you'd like the AsyncARMPolling polling method, + False for no polling, or your own initialized polling object for a 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) @@ -671,7 +671,7 @@ async def get_extended_information( :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: ~azure.mgmt.databoxedge.models.DataBoxEdgeDeviceExtendedInfo + :rtype: ~azure.mgmt.databoxedge.v2019_08_01.models.DataBoxEdgeDeviceExtendedInfo :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.DataBoxEdgeDeviceExtendedInfo"] @@ -775,8 +775,8 @@ async def begin_install_updates( :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 + :keyword polling: Pass in True if you'd like the AsyncARMPolling polling method, + False for no polling, or your own initialized polling object for a 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) @@ -839,7 +839,7 @@ async def get_network_settings( :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: ~azure.mgmt.databoxedge.models.NetworkSettings + :rtype: ~azure.mgmt.databoxedge.v2019_08_01.models.NetworkSettings :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkSettings"] @@ -943,8 +943,8 @@ async def begin_scan_for_updates( :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 + :keyword polling: Pass in True if you'd like the AsyncARMPolling polling method, + False for no polling, or your own initialized polling object for a 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) @@ -1057,11 +1057,11 @@ async def begin_create_or_update_security_settings( :param resource_group_name: The resource group name. :type resource_group_name: str :param security_settings: The security settings. - :type security_settings: ~azure.mgmt.databoxedge.models.SecuritySettings + :type security_settings: ~azure.mgmt.databoxedge.v2019_08_01.models.SecuritySettings :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: True for ARMPolling, False for no polling, or a - polling object for personal polling strategy + :keyword polling: Pass in True if you'd like the AsyncARMPolling polling method, + False for no polling, or your own initialized polling object for a 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) @@ -1128,7 +1128,7 @@ async def get_update_summary( :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: ~azure.mgmt.databoxedge.models.UpdateSummary + :rtype: ~azure.mgmt.databoxedge.v2019_08_01.models.UpdateSummary :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.UpdateSummary"] @@ -1186,10 +1186,10 @@ async def upload_certificate( :param resource_group_name: The resource group name. :type resource_group_name: str :param parameters: The upload certificate request. - :type parameters: ~azure.mgmt.databoxedge.models.UploadCertificateRequest + :type parameters: ~azure.mgmt.databoxedge.v2019_08_01.models.UploadCertificateRequest :keyword callable cls: A custom type or function that will be passed the direct response :return: UploadCertificateResponse, or the result of cls(response) - :rtype: ~azure.mgmt.databoxedge.models.UploadCertificateResponse + :rtype: ~azure.mgmt.databoxedge.v2019_08_01.models.UploadCertificateResponse :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.UploadCertificateResponse"] diff --git a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_08_01/aio/operations/_jobs_operations.py b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_08_01/aio/operations/_jobs_operations.py index 88189f659a01..b03d8568a77a 100644 --- a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_08_01/aio/operations/_jobs_operations.py +++ b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_08_01/aio/operations/_jobs_operations.py @@ -25,7 +25,7 @@ class JobsOperations: instantiates it for you and attaches it as an attribute. :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.databoxedge.models + :type models: ~azure.mgmt.databoxedge.v2019_08_01.models :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. @@ -59,7 +59,7 @@ async def get( :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: ~azure.mgmt.databoxedge.models.Job + :rtype: ~azure.mgmt.databoxedge.v2019_08_01.models.Job :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.Job"] diff --git a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_08_01/aio/operations/_nodes_operations.py b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_08_01/aio/operations/_nodes_operations.py index 1c6c3dce1423..d9d6afc3ee45 100644 --- a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_08_01/aio/operations/_nodes_operations.py +++ b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_08_01/aio/operations/_nodes_operations.py @@ -26,7 +26,7 @@ class NodesOperations: instantiates it for you and attaches it as an attribute. :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.databoxedge.models + :type models: ~azure.mgmt.databoxedge.v2019_08_01.models :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. @@ -55,7 +55,7 @@ def list_by_data_box_edge_device( :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[~azure.mgmt.databoxedge.models.NodeList] + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.databoxedge.v2019_08_01.models.NodeList] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.NodeList"] diff --git a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_08_01/aio/operations/_operations.py b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_08_01/aio/operations/_operations.py index e71848ae3bb5..336edd0b9ab2 100644 --- a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_08_01/aio/operations/_operations.py +++ b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_08_01/aio/operations/_operations.py @@ -26,7 +26,7 @@ class Operations: instantiates it for you and attaches it as an attribute. :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.databoxedge.models + :type models: ~azure.mgmt.databoxedge.v2019_08_01.models :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. @@ -51,7 +51,7 @@ def list( :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[~azure.mgmt.databoxedge.models.OperationsList] + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.databoxedge.v2019_08_01.models.OperationsList] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationsList"] diff --git a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_08_01/aio/operations/_operations_status_operations.py b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_08_01/aio/operations/_operations_status_operations.py index 945a565a8634..62707ccfeba5 100644 --- a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_08_01/aio/operations/_operations_status_operations.py +++ b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_08_01/aio/operations/_operations_status_operations.py @@ -25,7 +25,7 @@ class OperationsStatusOperations: instantiates it for you and attaches it as an attribute. :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.databoxedge.models + :type models: ~azure.mgmt.databoxedge.v2019_08_01.models :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. @@ -59,7 +59,7 @@ async def get( :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: ~azure.mgmt.databoxedge.models.Job + :rtype: ~azure.mgmt.databoxedge.v2019_08_01.models.Job :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.Job"] diff --git a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_08_01/aio/operations/_orders_operations.py b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_08_01/aio/operations/_orders_operations.py index d5b346983ce7..f4b7df965092 100644 --- a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_08_01/aio/operations/_orders_operations.py +++ b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_08_01/aio/operations/_orders_operations.py @@ -28,7 +28,7 @@ class OrdersOperations: instantiates it for you and attaches it as an attribute. :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.databoxedge.models + :type models: ~azure.mgmt.databoxedge.v2019_08_01.models :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. @@ -59,7 +59,7 @@ def list_by_data_box_edge_device( :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[~azure.mgmt.databoxedge.models.OrderList] + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.databoxedge.v2019_08_01.models.OrderList] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.OrderList"] @@ -135,7 +135,7 @@ async def get( :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: ~azure.mgmt.databoxedge.models.Order + :rtype: ~azure.mgmt.databoxedge.v2019_08_01.models.Order :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.Order"] @@ -250,15 +250,15 @@ async def begin_create_or_update( :param resource_group_name: The resource group name. :type resource_group_name: str :param order: The order to be created or updated. - :type order: ~azure.mgmt.databoxedge.models.Order + :type order: ~azure.mgmt.databoxedge.v2019_08_01.models.Order :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: True for ARMPolling, False for no polling, or a - polling object for personal polling strategy + :keyword polling: Pass in True if you'd like the AsyncARMPolling polling method, + False for no polling, or your own initialized polling object for a 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[~azure.mgmt.databoxedge.models.Order] + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.databoxedge.v2019_08_01.models.Order] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -367,8 +367,8 @@ async def begin_delete( :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 + :keyword polling: Pass in True if you'd like the AsyncARMPolling polling method, + False for no polling, or your own initialized polling object for a 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) diff --git a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_08_01/aio/operations/_roles_operations.py b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_08_01/aio/operations/_roles_operations.py index a3b9b6456887..822acd6ddbe0 100644 --- a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_08_01/aio/operations/_roles_operations.py +++ b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_08_01/aio/operations/_roles_operations.py @@ -28,7 +28,7 @@ class RolesOperations: instantiates it for you and attaches it as an attribute. :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.databoxedge.models + :type models: ~azure.mgmt.databoxedge.v2019_08_01.models :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. @@ -57,7 +57,7 @@ def list_by_data_box_edge_device( :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[~azure.mgmt.databoxedge.models.RoleList] + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.databoxedge.v2019_08_01.models.RoleList] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.RoleList"] @@ -134,7 +134,7 @@ async def get( :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: ~azure.mgmt.databoxedge.models.Role + :rtype: ~azure.mgmt.databoxedge.v2019_08_01.models.Role :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.Role"] @@ -253,15 +253,15 @@ async def begin_create_or_update( :param resource_group_name: The resource group name. :type resource_group_name: str :param role: The role properties. - :type role: ~azure.mgmt.databoxedge.models.Role + :type role: ~azure.mgmt.databoxedge.v2019_08_01.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 + :keyword polling: Pass in True if you'd like the AsyncARMPolling polling method, + False for no polling, or your own initialized polling object for a 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[~azure.mgmt.databoxedge.models.Role] + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.databoxedge.v2019_08_01.models.Role] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -375,8 +375,8 @@ async def begin_delete( :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 + :keyword polling: Pass in True if you'd like the AsyncARMPolling polling method, + False for no polling, or your own initialized polling object for a 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) diff --git a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_08_01/aio/operations/_shares_operations.py b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_08_01/aio/operations/_shares_operations.py index 6787b5b9ba71..1546cffb958f 100644 --- a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_08_01/aio/operations/_shares_operations.py +++ b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_08_01/aio/operations/_shares_operations.py @@ -28,7 +28,7 @@ class SharesOperations: instantiates it for you and attaches it as an attribute. :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.databoxedge.models + :type models: ~azure.mgmt.databoxedge.v2019_08_01.models :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. @@ -59,7 +59,7 @@ def list_by_data_box_edge_device( :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[~azure.mgmt.databoxedge.models.ShareList] + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.databoxedge.v2019_08_01.models.ShareList] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.ShareList"] @@ -138,7 +138,7 @@ async def get( :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: ~azure.mgmt.databoxedge.models.Share + :rtype: ~azure.mgmt.databoxedge.v2019_08_01.models.Share :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.Share"] @@ -259,15 +259,15 @@ async def begin_create_or_update( :param resource_group_name: The resource group name. :type resource_group_name: str :param share: The share properties. - :type share: ~azure.mgmt.databoxedge.models.Share + :type share: ~azure.mgmt.databoxedge.v2019_08_01.models.Share :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: True for ARMPolling, False for no polling, or a - polling object for personal polling strategy + :keyword polling: Pass in True if you'd like the AsyncARMPolling polling method, + False for no polling, or your own initialized polling object for a 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[~azure.mgmt.databoxedge.models.Share] + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.databoxedge.v2019_08_01.models.Share] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -381,8 +381,8 @@ async def begin_delete( :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 + :keyword polling: Pass in True if you'd like the AsyncARMPolling polling method, + False for no polling, or your own initialized polling object for a 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) @@ -498,8 +498,8 @@ async def begin_refresh( :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 + :keyword polling: Pass in True if you'd like the AsyncARMPolling polling method, + False for no polling, or your own initialized polling object for a 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) diff --git a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_08_01/aio/operations/_skus_operations.py b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_08_01/aio/operations/_skus_operations.py index cb2f8b98befd..45fbdcb005d9 100644 --- a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_08_01/aio/operations/_skus_operations.py +++ b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_08_01/aio/operations/_skus_operations.py @@ -26,7 +26,7 @@ class SkusOperations: instantiates it for you and attaches it as an attribute. :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.databoxedge.models + :type models: ~azure.mgmt.databoxedge.v2019_08_01.models :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. @@ -54,7 +54,7 @@ def list( :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[~azure.mgmt.databoxedge.models.SkuInformationList] + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.databoxedge.v2019_08_01.models.SkuInformationList] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.SkuInformationList"] diff --git a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_08_01/aio/operations/_storage_account_credentials_operations.py b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_08_01/aio/operations/_storage_account_credentials_operations.py index e68b7d180162..1b7fc04d944c 100644 --- a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_08_01/aio/operations/_storage_account_credentials_operations.py +++ b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_08_01/aio/operations/_storage_account_credentials_operations.py @@ -28,7 +28,7 @@ class StorageAccountCredentialsOperations: instantiates it for you and attaches it as an attribute. :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.databoxedge.models + :type models: ~azure.mgmt.databoxedge.v2019_08_01.models :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. @@ -59,7 +59,7 @@ def list_by_data_box_edge_device( :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[~azure.mgmt.databoxedge.models.StorageAccountCredentialList] + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.databoxedge.v2019_08_01.models.StorageAccountCredentialList] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.StorageAccountCredentialList"] @@ -136,7 +136,7 @@ async def get( :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: ~azure.mgmt.databoxedge.models.StorageAccountCredential + :rtype: ~azure.mgmt.databoxedge.v2019_08_01.models.StorageAccountCredential :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.StorageAccountCredential"] @@ -255,15 +255,15 @@ async def begin_create_or_update( :param resource_group_name: The resource group name. :type resource_group_name: str :param storage_account_credential: The storage account credential. - :type storage_account_credential: ~azure.mgmt.databoxedge.models.StorageAccountCredential + :type storage_account_credential: ~azure.mgmt.databoxedge.v2019_08_01.models.StorageAccountCredential :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: True for ARMPolling, False for no polling, or a - polling object for personal polling strategy + :keyword polling: Pass in True if you'd like the AsyncARMPolling polling method, + False for no polling, or your own initialized polling object for a 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[~azure.mgmt.databoxedge.models.StorageAccountCredential] + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.databoxedge.v2019_08_01.models.StorageAccountCredential] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -377,8 +377,8 @@ async def begin_delete( :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 + :keyword polling: Pass in True if you'd like the AsyncARMPolling polling method, + False for no polling, or your own initialized polling object for a 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) diff --git a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_08_01/aio/operations/_storage_accounts_operations.py b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_08_01/aio/operations/_storage_accounts_operations.py index ed93ea04e2ee..65fdbb465b3b 100644 --- a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_08_01/aio/operations/_storage_accounts_operations.py +++ b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_08_01/aio/operations/_storage_accounts_operations.py @@ -28,7 +28,7 @@ class StorageAccountsOperations: instantiates it for you and attaches it as an attribute. :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.databoxedge.models + :type models: ~azure.mgmt.databoxedge.v2019_08_01.models :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. @@ -59,7 +59,7 @@ def list_by_data_box_edge_device( :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[~azure.mgmt.databoxedge.models.StorageAccountList] + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.databoxedge.v2019_08_01.models.StorageAccountList] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.StorageAccountList"] @@ -138,7 +138,7 @@ async def get( :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: ~azure.mgmt.databoxedge.models.StorageAccount + :rtype: ~azure.mgmt.databoxedge.v2019_08_01.models.StorageAccount :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.StorageAccount"] @@ -259,15 +259,15 @@ async def begin_create_or_update( :param resource_group_name: The resource group name. :type resource_group_name: str :param storage_account: The StorageAccount properties. - :type storage_account: ~azure.mgmt.databoxedge.models.StorageAccount + :type storage_account: ~azure.mgmt.databoxedge.v2019_08_01.models.StorageAccount :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: True for ARMPolling, False for no polling, or a - polling object for personal polling strategy + :keyword polling: Pass in True if you'd like the AsyncARMPolling polling method, + False for no polling, or your own initialized polling object for a 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[~azure.mgmt.databoxedge.models.StorageAccount] + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.databoxedge.v2019_08_01.models.StorageAccount] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -381,8 +381,8 @@ async def begin_delete( :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 + :keyword polling: Pass in True if you'd like the AsyncARMPolling polling method, + False for no polling, or your own initialized polling object for a 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) diff --git a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_08_01/aio/operations/_triggers_operations.py b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_08_01/aio/operations/_triggers_operations.py index c3b016d7119c..d066a5070140 100644 --- a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_08_01/aio/operations/_triggers_operations.py +++ b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_08_01/aio/operations/_triggers_operations.py @@ -28,7 +28,7 @@ class TriggersOperations: instantiates it for you and attaches it as an attribute. :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.databoxedge.models + :type models: ~azure.mgmt.databoxedge.v2019_08_01.models :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. @@ -61,7 +61,7 @@ def list_by_data_box_edge_device( :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[~azure.mgmt.databoxedge.models.TriggerList] + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.databoxedge.v2019_08_01.models.TriggerList] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.TriggerList"] @@ -140,7 +140,7 @@ async def get( :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: ~azure.mgmt.databoxedge.models.Trigger + :rtype: ~azure.mgmt.databoxedge.v2019_08_01.models.Trigger :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.Trigger"] @@ -259,15 +259,15 @@ async def begin_create_or_update( :param resource_group_name: The resource group name. :type resource_group_name: str :param trigger: The trigger. - :type trigger: ~azure.mgmt.databoxedge.models.Trigger + :type trigger: ~azure.mgmt.databoxedge.v2019_08_01.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 + :keyword polling: Pass in True if you'd like the AsyncARMPolling polling method, + False for no polling, or your own initialized polling object for a 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[~azure.mgmt.databoxedge.models.Trigger] + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.databoxedge.v2019_08_01.models.Trigger] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -381,8 +381,8 @@ async def begin_delete( :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 + :keyword polling: Pass in True if you'd like the AsyncARMPolling polling method, + False for no polling, or your own initialized polling object for a 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) diff --git a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_08_01/aio/operations/_users_operations.py b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_08_01/aio/operations/_users_operations.py index 279951fd51cc..456ca3b771d3 100644 --- a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_08_01/aio/operations/_users_operations.py +++ b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_08_01/aio/operations/_users_operations.py @@ -28,7 +28,7 @@ class UsersOperations: instantiates it for you and attaches it as an attribute. :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.databoxedge.models + :type models: ~azure.mgmt.databoxedge.v2019_08_01.models :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. @@ -60,7 +60,7 @@ def list_by_data_box_edge_device( :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[~azure.mgmt.databoxedge.models.UserList] + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.databoxedge.v2019_08_01.models.UserList] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.UserList"] @@ -139,7 +139,7 @@ async def get( :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: ~azure.mgmt.databoxedge.models.User + :rtype: ~azure.mgmt.databoxedge.v2019_08_01.models.User :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.User"] @@ -259,15 +259,15 @@ async def begin_create_or_update( :param resource_group_name: The resource group name. :type resource_group_name: str :param user: The user details. - :type user: ~azure.mgmt.databoxedge.models.User + :type user: ~azure.mgmt.databoxedge.v2019_08_01.models.User :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: True for ARMPolling, False for no polling, or a - polling object for personal polling strategy + :keyword polling: Pass in True if you'd like the AsyncARMPolling polling method, + False for no polling, or your own initialized polling object for a 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[~azure.mgmt.databoxedge.models.User] + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.databoxedge.v2019_08_01.models.User] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -381,8 +381,8 @@ async def begin_delete( :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 + :keyword polling: Pass in True if you'd like the AsyncARMPolling polling method, + False for no polling, or your own initialized polling object for a 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) diff --git a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_08_01/models/_models.py b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_08_01/models/_models.py index 39aa76810f81..de25c17e49f4 100644 --- a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_08_01/models/_models.py +++ b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_08_01/models/_models.py @@ -118,9 +118,9 @@ class Alert(ARMBaseModel): :vartype recommendation: str :ivar severity: Severity of the alert. Possible values include: "Informational", "Warning", "Critical". - :vartype severity: str or ~azure.mgmt.databoxedge.models.AlertSeverity + :vartype severity: str or ~azure.mgmt.databoxedge.v2019_08_01.models.AlertSeverity :ivar error_details: Error details of the alert. - :vartype error_details: ~azure.mgmt.databoxedge.models.AlertErrorDetails + :vartype error_details: ~azure.mgmt.databoxedge.v2019_08_01.models.AlertErrorDetails :ivar detailed_information: Alert details. :vartype detailed_information: dict[str, str] """ @@ -206,7 +206,7 @@ class AlertList(msrest.serialization.Model): Variables are only populated by the server, and will be ignored when sending a request. :ivar value: The value. - :vartype value: list[~azure.mgmt.databoxedge.models.Alert] + :vartype value: list[~azure.mgmt.databoxedge.v2019_08_01.models.Alert] :ivar next_link: Link to the next set of results. :vartype next_link: str """ @@ -242,7 +242,8 @@ class AsymmetricEncryptedSecret(msrest.serialization.Model): :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 ~azure.mgmt.databoxedge.models.EncryptionAlgorithm + :type encryption_algorithm: str or + ~azure.mgmt.databoxedge.v2019_08_01.models.EncryptionAlgorithm """ _validation = { @@ -270,7 +271,7 @@ class Authentication(msrest.serialization.Model): """Authentication mechanism for IoT devices. :param symmetric_key: Symmetric key for authentication. - :type symmetric_key: ~azure.mgmt.databoxedge.models.SymmetricKey + :type symmetric_key: ~azure.mgmt.databoxedge.v2019_08_01.models.SymmetricKey """ _attribute_map = { @@ -298,7 +299,7 @@ class AzureContainerInfo(msrest.serialization.Model): :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 ~azure.mgmt.databoxedge.models.AzureContainerDataFormat + :type data_format: str or ~azure.mgmt.databoxedge.v2019_08_01.models.AzureContainerDataFormat """ _validation = { @@ -343,7 +344,7 @@ class BandwidthSchedule(ARMBaseModel): :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 ~azure.mgmt.databoxedge.models.DayOfWeek] + :type days: list[str or ~azure.mgmt.databoxedge.v2019_08_01.models.DayOfWeek] """ _validation = { @@ -383,7 +384,7 @@ class BandwidthSchedulesList(msrest.serialization.Model): 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[~azure.mgmt.databoxedge.models.BandwidthSchedule] + :vartype value: list[~azure.mgmt.databoxedge.v2019_08_01.models.BandwidthSchedule] :ivar next_link: Link to the next set of results. :vartype next_link: str """ @@ -416,7 +417,7 @@ class ClientAccessRight(msrest.serialization.Model): :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 ~azure.mgmt.databoxedge.models.ClientPermissionType + :type access_permission: str or ~azure.mgmt.databoxedge.v2019_08_01.models.ClientPermissionType """ _validation = { @@ -448,7 +449,7 @@ class CloudErrorBody(msrest.serialization.Model): interface. :type message: str :param details: A list of additional details about the error. - :type details: list[~azure.mgmt.databoxedge.models.CloudErrorBody] + :type details: list[~azure.mgmt.databoxedge.v2019_08_01.models.CloudErrorBody] """ _attribute_map = { @@ -522,12 +523,12 @@ class Container(ARMBaseModel): :vartype type: str :ivar container_status: Current status of the container. Possible values include: "OK", "Offline", "Unknown", "Updating", "NeedsAttention". - :vartype container_status: str or ~azure.mgmt.databoxedge.models.ContainerStatus + :vartype container_status: str or ~azure.mgmt.databoxedge.v2019_08_01.models.ContainerStatus :param data_format: Required. DataFormat for Container. Possible values include: "BlockBlob", "PageBlob", "AzureFile". - :type data_format: str or ~azure.mgmt.databoxedge.models.AzureContainerDataFormat + :type data_format: str or ~azure.mgmt.databoxedge.v2019_08_01.models.AzureContainerDataFormat :ivar refresh_details: Details of the refresh job on this container. - :vartype refresh_details: ~azure.mgmt.databoxedge.models.RefreshDetails + :vartype refresh_details: ~azure.mgmt.databoxedge.v2019_08_01.models.RefreshDetails :ivar created_date_time: The UTC time when container got created. :vartype created_date_time: ~datetime.datetime """ @@ -569,7 +570,7 @@ class ContainerList(msrest.serialization.Model): Variables are only populated by the server, and will be ignored when sending a request. :ivar value: The list of containers. - :vartype value: list[~azure.mgmt.databoxedge.models.Container] + :vartype value: list[~azure.mgmt.databoxedge.v2019_08_01.models.Container] :ivar next_link: Link to the next set of results. :vartype next_link: str """ @@ -615,14 +616,14 @@ class DataBoxEdgeDevice(ARMBaseModel): to view and group this device (across resource groups). :type tags: dict[str, str] :param sku: The SKU type. - :type sku: ~azure.mgmt.databoxedge.models.Sku + :type sku: ~azure.mgmt.databoxedge.v2019_08_01.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 - ~azure.mgmt.databoxedge.models.DataBoxEdgeDeviceStatus + ~azure.mgmt.databoxedge.v2019_08_01.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. @@ -631,7 +632,7 @@ class DataBoxEdgeDevice(ARMBaseModel): :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 ~azure.mgmt.databoxedge.models.DeviceType + :vartype device_type: str or ~azure.mgmt.databoxedge.v2019_08_01.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. @@ -647,7 +648,8 @@ class DataBoxEdgeDevice(ARMBaseModel): :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 ~azure.mgmt.databoxedge.models.RoleTypes] + :vartype configured_role_types: list[str or + ~azure.mgmt.databoxedge.v2019_08_01.models.RoleTypes] :ivar node_count: The number of nodes in the cluster. :vartype node_count: int """ @@ -770,7 +772,7 @@ class DataBoxEdgeDeviceList(msrest.serialization.Model): 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[~azure.mgmt.databoxedge.models.DataBoxEdgeDevice] + :vartype value: list[~azure.mgmt.databoxedge.v2019_08_01.models.DataBoxEdgeDevice] :ivar next_link: Link to the next set of results. :vartype next_link: str """ @@ -831,7 +833,7 @@ class Trigger(ARMBaseModel): :vartype type: str :param kind: Required. Trigger Kind.Constant filled by server. Possible values include: "FileEvent", "PeriodicTimerEvent". - :type kind: str or ~azure.mgmt.databoxedge.models.TriggerEventType + :type kind: str or ~azure.mgmt.databoxedge.v2019_08_01.models.TriggerEventType """ _validation = { @@ -875,11 +877,11 @@ class FileEventTrigger(Trigger): :vartype type: str :param kind: Required. Trigger Kind.Constant filled by server. Possible values include: "FileEvent", "PeriodicTimerEvent". - :type kind: str or ~azure.mgmt.databoxedge.models.TriggerEventType + :type kind: str or ~azure.mgmt.databoxedge.v2019_08_01.models.TriggerEventType :param source_info: Required. File event source details. - :type source_info: ~azure.mgmt.databoxedge.models.FileSourceInfo + :type source_info: ~azure.mgmt.databoxedge.v2019_08_01.models.FileSourceInfo :param sink_info: Required. Role sink info. - :type sink_info: ~azure.mgmt.databoxedge.models.RoleSinkInfo + :type sink_info: ~azure.mgmt.databoxedge.v2019_08_01.models.RoleSinkInfo :param custom_context_tag: A custom context tag typically used to correlate the trigger against its usage. For example, if a periodic timer trigger is intended for certain specific IoT modules in the device, the tag can be the name or the image URL of the module. @@ -953,7 +955,7 @@ class IoTDeviceInfo(msrest.serialization.Model): :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: ~azure.mgmt.databoxedge.models.Authentication + :type authentication: ~azure.mgmt.databoxedge.v2019_08_01.models.Authentication """ _validation = { @@ -997,7 +999,7 @@ class Role(ARMBaseModel): :vartype type: str :param kind: Required. Role type.Constant filled by server. Possible values include: "IOT", "ASA", "Functions", "Cognitive". - :type kind: str or ~azure.mgmt.databoxedge.models.RoleTypes + :type kind: str or ~azure.mgmt.databoxedge.v2019_08_01.models.RoleTypes """ _validation = { @@ -1041,19 +1043,19 @@ class IoTRole(Role): :vartype type: str :param kind: Required. Role type.Constant filled by server. Possible values include: "IOT", "ASA", "Functions", "Cognitive". - :type kind: str or ~azure.mgmt.databoxedge.models.RoleTypes + :type kind: str or ~azure.mgmt.databoxedge.v2019_08_01.models.RoleTypes :param host_platform: Host OS supported by the IoT role. Possible values include: "Windows", "Linux". - :type host_platform: str or ~azure.mgmt.databoxedge.models.PlatformType + :type host_platform: str or ~azure.mgmt.databoxedge.v2019_08_01.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: ~azure.mgmt.databoxedge.models.IoTDeviceInfo + :type io_t_device_details: ~azure.mgmt.databoxedge.v2019_08_01.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: ~azure.mgmt.databoxedge.models.IoTDeviceInfo + :type io_t_edge_device_details: ~azure.mgmt.databoxedge.v2019_08_01.models.IoTDeviceInfo :param share_mappings: Mount points of shares in role(s). - :type share_mappings: list[~azure.mgmt.databoxedge.models.MountPointMap] + :type share_mappings: list[~azure.mgmt.databoxedge.v2019_08_01.models.MountPointMap] :param role_status: Role status. Possible values include: "Enabled", "Disabled". - :type role_status: str or ~azure.mgmt.databoxedge.models.RoleStatus + :type role_status: str or ~azure.mgmt.databoxedge.v2019_08_01.models.RoleStatus """ _validation = { @@ -1171,7 +1173,7 @@ class Job(msrest.serialization.Model): :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 ~azure.mgmt.databoxedge.models.JobStatus + :vartype status: str or ~azure.mgmt.databoxedge.v2019_08_01.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. @@ -1179,19 +1181,19 @@ class Job(msrest.serialization.Model): :ivar percent_complete: The percentage of the job that is complete. :vartype percent_complete: int :ivar error: The error details. - :vartype error: ~azure.mgmt.databoxedge.models.JobErrorDetails + :vartype error: ~azure.mgmt.databoxedge.v2019_08_01.models.JobErrorDetails :ivar job_type: The type of the job. Possible values include: "Invalid", "ScanForUpdates", "DownloadUpdates", "InstallUpdates", "RefreshShare", "RefreshContainer". - :vartype job_type: str or ~azure.mgmt.databoxedge.models.JobType + :vartype job_type: str or ~azure.mgmt.databoxedge.v2019_08_01.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 ~azure.mgmt.databoxedge.models.UpdateOperationStage + :vartype current_stage: str or ~azure.mgmt.databoxedge.v2019_08_01.models.UpdateOperationStage :ivar download_progress: The download progress. - :vartype download_progress: ~azure.mgmt.databoxedge.models.UpdateDownloadProgress + :vartype download_progress: ~azure.mgmt.databoxedge.v2019_08_01.models.UpdateDownloadProgress :ivar install_progress: The install progress. - :vartype install_progress: ~azure.mgmt.databoxedge.models.UpdateInstallProgress + :vartype install_progress: ~azure.mgmt.databoxedge.v2019_08_01.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 @@ -1270,7 +1272,7 @@ class JobErrorDetails(msrest.serialization.Model): 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[~azure.mgmt.databoxedge.models.JobErrorItem] + :vartype error_details: list[~azure.mgmt.databoxedge.v2019_08_01.models.JobErrorItem] :ivar code: The code intended for programmatic access. :vartype code: str :ivar message: The message that describes the error in detail. @@ -1372,23 +1374,24 @@ class MetricSpecificationV1(msrest.serialization.Model): :type display_description: str :param unit: Metric units. Possible values include: "NotSpecified", "Percent", "Count", "Seconds", "Milliseconds", "Bytes", "BytesPerSecond", "CountPerSecond". - :type unit: str or ~azure.mgmt.databoxedge.models.MetricUnit + :type unit: str or ~azure.mgmt.databoxedge.v2019_08_01.models.MetricUnit :param aggregation_type: Metric aggregation type. Possible values include: "NotSpecified", "None", "Average", "Minimum", "Maximum", "Total", "Count". - :type aggregation_type: str or ~azure.mgmt.databoxedge.models.MetricAggregationType + :type aggregation_type: str or ~azure.mgmt.databoxedge.v2019_08_01.models.MetricAggregationType :param dimensions: Metric dimensions, other than default dimension which is resource. - :type dimensions: list[~azure.mgmt.databoxedge.models.MetricDimensionV1] + :type dimensions: list[~azure.mgmt.databoxedge.v2019_08_01.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 ~azure.mgmt.databoxedge.models.MetricCategory + :type category: str or ~azure.mgmt.databoxedge.v2019_08_01.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 ~azure.mgmt.databoxedge.models.TimeGrain] + :type supported_time_grain_types: list[str or + ~azure.mgmt.databoxedge.v2019_08_01.models.TimeGrain] :param supported_aggregation_types: Support metric aggregation type. :type supported_aggregation_types: list[str or - ~azure.mgmt.databoxedge.models.MetricAggregationType] + ~azure.mgmt.databoxedge.v2019_08_01.models.MetricAggregationType] """ _attribute_map = { @@ -1437,7 +1440,7 @@ class MountPointMap(msrest.serialization.Model): :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 ~azure.mgmt.databoxedge.models.RoleTypes + :vartype role_type: str or ~azure.mgmt.databoxedge.v2019_08_01.models.RoleTypes """ _validation = { @@ -1473,7 +1476,7 @@ class NetworkAdapter(msrest.serialization.Model): :ivar adapter_id: Instance ID of network adapter. :vartype adapter_id: str :ivar adapter_position: Hardware position of network adapter. - :vartype adapter_position: ~azure.mgmt.databoxedge.models.NetworkAdapterPosition + :vartype adapter_position: ~azure.mgmt.databoxedge.v2019_08_01.models.NetworkAdapterPosition :ivar index: Logical index of the adapter. :vartype index: int :ivar node_id: Node ID of the network adapter. @@ -1488,17 +1491,17 @@ class NetworkAdapter(msrest.serialization.Model): :vartype link_speed: long :ivar status: Value indicating whether this adapter is valid. Possible values include: "Inactive", "Active". - :vartype status: str or ~azure.mgmt.databoxedge.models.NetworkAdapterStatus + :vartype status: str or ~azure.mgmt.databoxedge.v2019_08_01.models.NetworkAdapterStatus :param rdma_status: Value indicating whether this adapter is RDMA capable. Possible values include: "Incapable", "Capable". - :type rdma_status: str or ~azure.mgmt.databoxedge.models.NetworkAdapterRDMAStatus + :type rdma_status: str or ~azure.mgmt.databoxedge.v2019_08_01.models.NetworkAdapterRDMAStatus :param dhcp_status: Value indicating whether this adapter has DHCP enabled. Possible values include: "Disabled", "Enabled". - :type dhcp_status: str or ~azure.mgmt.databoxedge.models.NetworkAdapterDHCPStatus + :type dhcp_status: str or ~azure.mgmt.databoxedge.v2019_08_01.models.NetworkAdapterDHCPStatus :ivar ipv4_configuration: The IPv4 configuration of the network adapter. - :vartype ipv4_configuration: ~azure.mgmt.databoxedge.models.Ipv4Config + :vartype ipv4_configuration: ~azure.mgmt.databoxedge.v2019_08_01.models.Ipv4Config :ivar ipv6_configuration: The IPv6 configuration of the network adapter. - :vartype ipv6_configuration: ~azure.mgmt.databoxedge.models.Ipv6Config + :vartype ipv6_configuration: ~azure.mgmt.databoxedge.v2019_08_01.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. @@ -1567,7 +1570,7 @@ class NetworkAdapterPosition(msrest.serialization.Model): 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 ~azure.mgmt.databoxedge.models.NetworkGroup + :vartype network_group: str or ~azure.mgmt.databoxedge.v2019_08_01.models.NetworkGroup :ivar port: The port. :vartype port: int """ @@ -1603,7 +1606,7 @@ class NetworkSettings(ARMBaseModel): :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[~azure.mgmt.databoxedge.models.NetworkAdapter] + :vartype network_adapters: list[~azure.mgmt.databoxedge.v2019_08_01.models.NetworkAdapter] """ _validation = { @@ -1643,7 +1646,7 @@ class Node(ARMBaseModel): :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 ~azure.mgmt.databoxedge.models.NodeStatus + :vartype node_status: str or ~azure.mgmt.databoxedge.v2019_08_01.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. @@ -1705,7 +1708,7 @@ class NodeList(msrest.serialization.Model): Variables are only populated by the server, and will be ignored when sending a request. :ivar value: The list of Nodes. - :vartype value: list[~azure.mgmt.databoxedge.models.Node] + :vartype value: list[~azure.mgmt.databoxedge.v2019_08_01.models.Node] """ _validation = { @@ -1730,11 +1733,11 @@ class Operation(msrest.serialization.Model): :param name: Name of the operation. :type name: str :param display: Properties displayed for the operation. - :type display: ~azure.mgmt.databoxedge.models.OperationDisplay + :type display: ~azure.mgmt.databoxedge.v2019_08_01.models.OperationDisplay :param origin: Origin of the operation. :type origin: str :param service_specification: Service specification. - :type service_specification: ~azure.mgmt.databoxedge.models.ServiceSpecification + :type service_specification: ~azure.mgmt.databoxedge.v2019_08_01.models.ServiceSpecification """ _attribute_map = { @@ -1792,7 +1795,7 @@ class OperationsList(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. :param value: Required. The value. - :type value: list[~azure.mgmt.databoxedge.models.Operation] + :type value: list[~azure.mgmt.databoxedge.v2019_08_01.models.Operation] :param next_link: Link to the next set of results. :type next_link: str """ @@ -1827,21 +1830,21 @@ class Order(ARMBaseModel): :ivar type: The hierarchical type of the object. :vartype type: str :param contact_information: The contact details. - :type contact_information: ~azure.mgmt.databoxedge.models.ContactDetails + :type contact_information: ~azure.mgmt.databoxedge.v2019_08_01.models.ContactDetails :param shipping_address: The shipping address. - :type shipping_address: ~azure.mgmt.databoxedge.models.Address + :type shipping_address: ~azure.mgmt.databoxedge.v2019_08_01.models.Address :param current_status: Current status of the order. - :type current_status: ~azure.mgmt.databoxedge.models.OrderStatus + :type current_status: ~azure.mgmt.databoxedge.v2019_08_01.models.OrderStatus :ivar order_history: List of status changes in the order. - :vartype order_history: list[~azure.mgmt.databoxedge.models.OrderStatus] + :vartype order_history: list[~azure.mgmt.databoxedge.v2019_08_01.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[~azure.mgmt.databoxedge.models.TrackingInfo] + :vartype delivery_tracking_info: list[~azure.mgmt.databoxedge.v2019_08_01.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[~azure.mgmt.databoxedge.models.TrackingInfo] + :vartype return_tracking_info: list[~azure.mgmt.databoxedge.v2019_08_01.models.TrackingInfo] """ _validation = { @@ -1887,7 +1890,7 @@ class OrderList(msrest.serialization.Model): Variables are only populated by the server, and will be ignored when sending a request. :ivar value: The list of orders. - :vartype value: list[~azure.mgmt.databoxedge.models.Order] + :vartype value: list[~azure.mgmt.databoxedge.v2019_08_01.models.Order] :ivar next_link: Link to the next set of results. :vartype next_link: str """ @@ -1922,7 +1925,7 @@ class OrderStatus(msrest.serialization.Model): include: "Untracked", "AwaitingFulfilment", "AwaitingPreparation", "AwaitingShipment", "Shipped", "Arriving", "Delivered", "ReplacementRequested", "LostDevice", "Declined", "ReturnInitiated", "AwaitingReturnShipment", "ShippedBack", "CollectedAtMicrosoft". - :type status: str or ~azure.mgmt.databoxedge.models.OrderState + :type status: str or ~azure.mgmt.databoxedge.v2019_08_01.models.OrderState :ivar update_date_time: Time of status update. :vartype update_date_time: ~datetime.datetime :param comments: Comments related to this status change. @@ -1971,11 +1974,11 @@ class PeriodicTimerEventTrigger(Trigger): :vartype type: str :param kind: Required. Trigger Kind.Constant filled by server. Possible values include: "FileEvent", "PeriodicTimerEvent". - :type kind: str or ~azure.mgmt.databoxedge.models.TriggerEventType + :type kind: str or ~azure.mgmt.databoxedge.v2019_08_01.models.TriggerEventType :param source_info: Required. Periodic timer details. - :type source_info: ~azure.mgmt.databoxedge.models.PeriodicTimerSourceInfo + :type source_info: ~azure.mgmt.databoxedge.v2019_08_01.models.PeriodicTimerSourceInfo :param sink_info: Required. Role Sink information. - :type sink_info: ~azure.mgmt.databoxedge.models.RoleSinkInfo + :type sink_info: ~azure.mgmt.databoxedge.v2019_08_01.models.RoleSinkInfo :param custom_context_tag: A custom context tag typically used to correlate the trigger against its usage. For example, if a periodic timer trigger is intended for certain specific IoT modules in the device, the tag can be the name or the image URL of the module. @@ -2097,11 +2100,11 @@ class ResourceTypeSku(msrest.serialization.Model): :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 ~azure.mgmt.databoxedge.models.SkuName + :vartype name: str or ~azure.mgmt.databoxedge.v2019_08_01.models.SkuName :ivar kind: The Sku kind. :vartype kind: str :ivar tier: The Sku tier. Possible values include: "Standard". - :vartype tier: str or ~azure.mgmt.databoxedge.models.SkuTier + :vartype tier: str or ~azure.mgmt.databoxedge.v2019_08_01.models.SkuTier :ivar family: The Sku family. :vartype family: str :ivar locations: Availability of the SKU for the region. @@ -2109,11 +2112,11 @@ class ResourceTypeSku(msrest.serialization.Model): :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[~azure.mgmt.databoxedge.models.SkuLocationInfo] + :vartype location_info: list[~azure.mgmt.databoxedge.v2019_08_01.models.SkuLocationInfo] :ivar costs: The pricing info of the Sku. - :vartype costs: list[~azure.mgmt.databoxedge.models.SkuCost] + :vartype costs: list[~azure.mgmt.databoxedge.v2019_08_01.models.SkuCost] :ivar restrictions: Restrictions of the SKU availability. - :vartype restrictions: list[~azure.mgmt.databoxedge.models.SkuRestriction] + :vartype restrictions: list[~azure.mgmt.databoxedge.v2019_08_01.models.SkuRestriction] """ _validation = { @@ -2165,7 +2168,7 @@ class RoleList(msrest.serialization.Model): Variables are only populated by the server, and will be ignored when sending a request. :ivar value: The Value. - :vartype value: list[~azure.mgmt.databoxedge.models.Role] + :vartype value: list[~azure.mgmt.databoxedge.v2019_08_01.models.Role] :ivar next_link: Link to the next set of results. :vartype next_link: str """ @@ -2231,7 +2234,8 @@ class SecuritySettings(ARMBaseModel): (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: ~azure.mgmt.databoxedge.models.AsymmetricEncryptedSecret + :type device_admin_password: + ~azure.mgmt.databoxedge.v2019_08_01.models.AsymmetricEncryptedSecret """ _validation = { @@ -2260,7 +2264,8 @@ class ServiceSpecification(msrest.serialization.Model): """Service specification. :param metric_specifications: Metric specification as defined by shoebox. - :type metric_specifications: list[~azure.mgmt.databoxedge.models.MetricSpecificationV1] + :type metric_specifications: + list[~azure.mgmt.databoxedge.v2019_08_01.models.MetricSpecificationV1] """ _attribute_map = { @@ -2292,27 +2297,27 @@ class Share(ARMBaseModel): :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 ~azure.mgmt.databoxedge.models.ShareStatus + :type share_status: str or ~azure.mgmt.databoxedge.v2019_08_01.models.ShareStatus :param monitoring_status: Required. Current monitoring status of the share. Possible values include: "Enabled", "Disabled". - :type monitoring_status: str or ~azure.mgmt.databoxedge.models.MonitoringStatus + :type monitoring_status: str or ~azure.mgmt.databoxedge.v2019_08_01.models.MonitoringStatus :param azure_container_info: Azure container mapping for the share. - :type azure_container_info: ~azure.mgmt.databoxedge.models.AzureContainerInfo + :type azure_container_info: ~azure.mgmt.databoxedge.v2019_08_01.models.AzureContainerInfo :param access_protocol: Required. Access protocol to be used by the share. Possible values include: "SMB", "NFS". - :type access_protocol: str or ~azure.mgmt.databoxedge.models.ShareAccessProtocol + :type access_protocol: str or ~azure.mgmt.databoxedge.v2019_08_01.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[~azure.mgmt.databoxedge.models.UserAccessRight] + :type user_access_rights: list[~azure.mgmt.databoxedge.v2019_08_01.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[~azure.mgmt.databoxedge.models.ClientAccessRight] + :type client_access_rights: list[~azure.mgmt.databoxedge.v2019_08_01.models.ClientAccessRight] :param refresh_details: Details of the refresh job on this share. - :type refresh_details: ~azure.mgmt.databoxedge.models.RefreshDetails + :type refresh_details: ~azure.mgmt.databoxedge.v2019_08_01.models.RefreshDetails :ivar share_mappings: Share mount point to the role. - :vartype share_mappings: list[~azure.mgmt.databoxedge.models.MountPointMap] + :vartype share_mappings: list[~azure.mgmt.databoxedge.v2019_08_01.models.MountPointMap] :param data_policy: Data policy of the share. Possible values include: "Cloud", "Local". - :type data_policy: str or ~azure.mgmt.databoxedge.models.DataPolicy + :type data_policy: str or ~azure.mgmt.databoxedge.v2019_08_01.models.DataPolicy """ _validation = { @@ -2367,7 +2372,7 @@ class ShareAccessRight(msrest.serialization.Model): :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 ~azure.mgmt.databoxedge.models.ShareAccessType + :type access_type: str or ~azure.mgmt.databoxedge.v2019_08_01.models.ShareAccessType """ _validation = { @@ -2395,7 +2400,7 @@ class ShareList(msrest.serialization.Model): Variables are only populated by the server, and will be ignored when sending a request. :ivar value: The list of shares. - :vartype value: list[~azure.mgmt.databoxedge.models.Share] + :vartype value: list[~azure.mgmt.databoxedge.v2019_08_01.models.Share] :ivar next_link: Link to the next set of results. :vartype next_link: str """ @@ -2425,9 +2430,9 @@ class Sku(msrest.serialization.Model): :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 ~azure.mgmt.databoxedge.models.SkuName + :type name: str or ~azure.mgmt.databoxedge.v2019_08_01.models.SkuName :param tier: The SKU tier. This is based on the SKU name. Possible values include: "Standard". - :type tier: str or ~azure.mgmt.databoxedge.models.SkuTier + :type tier: str or ~azure.mgmt.databoxedge.v2019_08_01.models.SkuTier """ _attribute_map = { @@ -2485,7 +2490,7 @@ class SkuInformationList(msrest.serialization.Model): Variables are only populated by the server, and will be ignored when sending a request. :ivar value: List of ResourceType Sku. - :vartype value: list[~azure.mgmt.databoxedge.models.ResourceTypeSku] + :vartype value: list[~azure.mgmt.databoxedge.v2019_08_01.models.ResourceTypeSku] :ivar next_link: Links to the next set of results. :vartype next_link: str """ @@ -2555,9 +2560,10 @@ class SkuRestriction(msrest.serialization.Model): :vartype values: list[str] :ivar reason_code: The SKU restriction reason. Possible values include: "NotAvailableForSubscription", "QuotaId". - :vartype reason_code: str or ~azure.mgmt.databoxedge.models.SkuRestrictionReasonCode + :vartype reason_code: str or + ~azure.mgmt.databoxedge.v2019_08_01.models.SkuRestrictionReasonCode :ivar restriction_info: Restriction of the SKU for the location/zone. - :vartype restriction_info: ~azure.mgmt.databoxedge.models.SkuRestrictionInfo + :vartype restriction_info: ~azure.mgmt.databoxedge.v2019_08_01.models.SkuRestrictionInfo """ _validation = { @@ -2630,10 +2636,11 @@ class StorageAccount(ARMBaseModel): :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 ~azure.mgmt.databoxedge.models.StorageAccountStatus + :type storage_account_status: str or + ~azure.mgmt.databoxedge.v2019_08_01.models.StorageAccountStatus :param data_policy: Data policy of the storage Account. Possible values include: "Cloud", "Local". - :type data_policy: str or ~azure.mgmt.databoxedge.models.DataPolicy + :type data_policy: str or ~azure.mgmt.databoxedge.v2019_08_01.models.DataPolicy :param storage_account_credential_id: Storage Account Credential Id. :type storage_account_credential_id: str :ivar blob_endpoint: BlobEndpoint of Storage Account. @@ -2694,18 +2701,18 @@ class StorageAccountCredential(ARMBaseModel): :param user_name: Username for the storage account. :type user_name: str :param account_key: Encrypted storage key. - :type account_key: ~azure.mgmt.databoxedge.models.AsymmetricEncryptedSecret + :type account_key: ~azure.mgmt.databoxedge.v2019_08_01.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 ~azure.mgmt.databoxedge.models.SSLStatus + :type ssl_status: str or ~azure.mgmt.databoxedge.v2019_08_01.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 ~azure.mgmt.databoxedge.models.AccountType + :type account_type: str or ~azure.mgmt.databoxedge.v2019_08_01.models.AccountType :param storage_account_id: Id of the storage account. :type storage_account_id: str """ @@ -2754,7 +2761,7 @@ class StorageAccountCredentialList(msrest.serialization.Model): Variables are only populated by the server, and will be ignored when sending a request. :ivar value: The value. - :vartype value: list[~azure.mgmt.databoxedge.models.StorageAccountCredential] + :vartype value: list[~azure.mgmt.databoxedge.v2019_08_01.models.StorageAccountCredential] :ivar next_link: Link to the next set of results. :vartype next_link: str """ @@ -2784,7 +2791,7 @@ class StorageAccountList(msrest.serialization.Model): Variables are only populated by the server, and will be ignored when sending a request. :ivar value: The list of storageAccounts. - :vartype value: list[~azure.mgmt.databoxedge.models.StorageAccount] + :vartype value: list[~azure.mgmt.databoxedge.v2019_08_01.models.StorageAccount] :ivar next_link: Link to the next set of results. :vartype next_link: str """ @@ -2812,7 +2819,7 @@ class SymmetricKey(msrest.serialization.Model): """Symmetric key for authentication. :param connection_string: Connection string based on the symmetric key. - :type connection_string: ~azure.mgmt.databoxedge.models.AsymmetricEncryptedSecret + :type connection_string: ~azure.mgmt.databoxedge.v2019_08_01.models.AsymmetricEncryptedSecret """ _attribute_map = { @@ -2864,7 +2871,7 @@ class TriggerList(msrest.serialization.Model): Variables are only populated by the server, and will be ignored when sending a request. :ivar value: The list of triggers. - :vartype value: list[~azure.mgmt.databoxedge.models.Trigger] + :vartype value: list[~azure.mgmt.databoxedge.v2019_08_01.models.Trigger] :ivar next_link: Link to the next set of results. :vartype next_link: str """ @@ -2895,7 +2902,7 @@ class UpdateDownloadProgress(msrest.serialization.Model): :ivar download_phase: The download phase. Possible values include: "Unknown", "Initializing", "Downloading", "Verifying". - :vartype download_phase: str or ~azure.mgmt.databoxedge.models.DownloadPhase + :vartype download_phase: str or ~azure.mgmt.databoxedge.v2019_08_01.models.DownloadPhase :ivar percent_complete: Percentage of completion. :vartype percent_complete: int :ivar total_bytes_to_download: Total bytes to download. @@ -3009,10 +3016,12 @@ class UpdateSummary(ARMBaseModel): :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 ~azure.mgmt.databoxedge.models.InstallRebootBehavior + :vartype reboot_behavior: str or + ~azure.mgmt.databoxedge.v2019_08_01.models.InstallRebootBehavior :ivar ongoing_update_operation: The current update operation. Possible values include: "None", "Scan", "Download", "Install". - :vartype ongoing_update_operation: str or ~azure.mgmt.databoxedge.models.UpdateOperation + :vartype ongoing_update_operation: str or + ~azure.mgmt.databoxedge.v2019_08_01.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. @@ -3102,7 +3111,7 @@ class UploadCertificateRequest(msrest.serialization.Model): :param authentication_type: The authentication type. Possible values include: "Invalid", "AzureActiveDirectory". - :type authentication_type: str or ~azure.mgmt.databoxedge.models.AuthenticationType + :type authentication_type: str or ~azure.mgmt.databoxedge.v2019_08_01.models.AuthenticationType :param certificate: Required. The base64 encoded certificate raw data. :type certificate: str """ @@ -3132,7 +3141,7 @@ class UploadCertificateResponse(msrest.serialization.Model): :param auth_type: Specifies authentication type. Possible values include: "Invalid", "AzureActiveDirectory". - :type auth_type: str or ~azure.mgmt.databoxedge.models.AuthenticationType + :type auth_type: str or ~azure.mgmt.databoxedge.v2019_08_01.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. @@ -3200,13 +3209,13 @@ class User(ARMBaseModel): :ivar type: The hierarchical type of the object. :vartype type: str :param encrypted_password: The password details. - :type encrypted_password: ~azure.mgmt.databoxedge.models.AsymmetricEncryptedSecret + :type encrypted_password: ~azure.mgmt.databoxedge.v2019_08_01.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[~azure.mgmt.databoxedge.models.ShareAccessRight] + :type share_access_rights: list[~azure.mgmt.databoxedge.v2019_08_01.models.ShareAccessRight] :param user_type: Required. Type of the user. Possible values include: "Share", "LocalManagement", "ARM". - :type user_type: str or ~azure.mgmt.databoxedge.models.UserType + :type user_type: str or ~azure.mgmt.databoxedge.v2019_08_01.models.UserType """ _validation = { @@ -3244,7 +3253,7 @@ class UserAccessRight(msrest.serialization.Model): :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 ~azure.mgmt.databoxedge.models.ShareAccessType + :type access_type: str or ~azure.mgmt.databoxedge.v2019_08_01.models.ShareAccessType """ _validation = { @@ -3272,7 +3281,7 @@ class UserList(msrest.serialization.Model): Variables are only populated by the server, and will be ignored when sending a request. :ivar value: The list of users. - :vartype value: list[~azure.mgmt.databoxedge.models.User] + :vartype value: list[~azure.mgmt.databoxedge.v2019_08_01.models.User] :ivar next_link: Link to the next set of results. :vartype next_link: str """ diff --git a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_08_01/models/_models_py3.py b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_08_01/models/_models_py3.py index 3a29eb055540..8127bc9f7fdb 100644 --- a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_08_01/models/_models_py3.py +++ b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_08_01/models/_models_py3.py @@ -131,9 +131,9 @@ class Alert(ARMBaseModel): :vartype recommendation: str :ivar severity: Severity of the alert. Possible values include: "Informational", "Warning", "Critical". - :vartype severity: str or ~azure.mgmt.databoxedge.models.AlertSeverity + :vartype severity: str or ~azure.mgmt.databoxedge.v2019_08_01.models.AlertSeverity :ivar error_details: Error details of the alert. - :vartype error_details: ~azure.mgmt.databoxedge.models.AlertErrorDetails + :vartype error_details: ~azure.mgmt.databoxedge.v2019_08_01.models.AlertErrorDetails :ivar detailed_information: Alert details. :vartype detailed_information: dict[str, str] """ @@ -219,7 +219,7 @@ class AlertList(msrest.serialization.Model): Variables are only populated by the server, and will be ignored when sending a request. :ivar value: The value. - :vartype value: list[~azure.mgmt.databoxedge.models.Alert] + :vartype value: list[~azure.mgmt.databoxedge.v2019_08_01.models.Alert] :ivar next_link: Link to the next set of results. :vartype next_link: str """ @@ -255,7 +255,8 @@ class AsymmetricEncryptedSecret(msrest.serialization.Model): :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 ~azure.mgmt.databoxedge.models.EncryptionAlgorithm + :type encryption_algorithm: str or + ~azure.mgmt.databoxedge.v2019_08_01.models.EncryptionAlgorithm """ _validation = { @@ -287,7 +288,7 @@ class Authentication(msrest.serialization.Model): """Authentication mechanism for IoT devices. :param symmetric_key: Symmetric key for authentication. - :type symmetric_key: ~azure.mgmt.databoxedge.models.SymmetricKey + :type symmetric_key: ~azure.mgmt.databoxedge.v2019_08_01.models.SymmetricKey """ _attribute_map = { @@ -317,7 +318,7 @@ class AzureContainerInfo(msrest.serialization.Model): :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 ~azure.mgmt.databoxedge.models.AzureContainerDataFormat + :type data_format: str or ~azure.mgmt.databoxedge.v2019_08_01.models.AzureContainerDataFormat """ _validation = { @@ -366,7 +367,7 @@ class BandwidthSchedule(ARMBaseModel): :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 ~azure.mgmt.databoxedge.models.DayOfWeek] + :type days: list[str or ~azure.mgmt.databoxedge.v2019_08_01.models.DayOfWeek] """ _validation = { @@ -411,7 +412,7 @@ class BandwidthSchedulesList(msrest.serialization.Model): 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[~azure.mgmt.databoxedge.models.BandwidthSchedule] + :vartype value: list[~azure.mgmt.databoxedge.v2019_08_01.models.BandwidthSchedule] :ivar next_link: Link to the next set of results. :vartype next_link: str """ @@ -444,7 +445,7 @@ class ClientAccessRight(msrest.serialization.Model): :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 ~azure.mgmt.databoxedge.models.ClientPermissionType + :type access_permission: str or ~azure.mgmt.databoxedge.v2019_08_01.models.ClientPermissionType """ _validation = { @@ -479,7 +480,7 @@ class CloudErrorBody(msrest.serialization.Model): interface. :type message: str :param details: A list of additional details about the error. - :type details: list[~azure.mgmt.databoxedge.models.CloudErrorBody] + :type details: list[~azure.mgmt.databoxedge.v2019_08_01.models.CloudErrorBody] """ _attribute_map = { @@ -562,12 +563,12 @@ class Container(ARMBaseModel): :vartype type: str :ivar container_status: Current status of the container. Possible values include: "OK", "Offline", "Unknown", "Updating", "NeedsAttention". - :vartype container_status: str or ~azure.mgmt.databoxedge.models.ContainerStatus + :vartype container_status: str or ~azure.mgmt.databoxedge.v2019_08_01.models.ContainerStatus :param data_format: Required. DataFormat for Container. Possible values include: "BlockBlob", "PageBlob", "AzureFile". - :type data_format: str or ~azure.mgmt.databoxedge.models.AzureContainerDataFormat + :type data_format: str or ~azure.mgmt.databoxedge.v2019_08_01.models.AzureContainerDataFormat :ivar refresh_details: Details of the refresh job on this container. - :vartype refresh_details: ~azure.mgmt.databoxedge.models.RefreshDetails + :vartype refresh_details: ~azure.mgmt.databoxedge.v2019_08_01.models.RefreshDetails :ivar created_date_time: The UTC time when container got created. :vartype created_date_time: ~datetime.datetime """ @@ -611,7 +612,7 @@ class ContainerList(msrest.serialization.Model): Variables are only populated by the server, and will be ignored when sending a request. :ivar value: The list of containers. - :vartype value: list[~azure.mgmt.databoxedge.models.Container] + :vartype value: list[~azure.mgmt.databoxedge.v2019_08_01.models.Container] :ivar next_link: Link to the next set of results. :vartype next_link: str """ @@ -657,14 +658,14 @@ class DataBoxEdgeDevice(ARMBaseModel): to view and group this device (across resource groups). :type tags: dict[str, str] :param sku: The SKU type. - :type sku: ~azure.mgmt.databoxedge.models.Sku + :type sku: ~azure.mgmt.databoxedge.v2019_08_01.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 - ~azure.mgmt.databoxedge.models.DataBoxEdgeDeviceStatus + ~azure.mgmt.databoxedge.v2019_08_01.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. @@ -673,7 +674,7 @@ class DataBoxEdgeDevice(ARMBaseModel): :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 ~azure.mgmt.databoxedge.models.DeviceType + :vartype device_type: str or ~azure.mgmt.databoxedge.v2019_08_01.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. @@ -689,7 +690,8 @@ class DataBoxEdgeDevice(ARMBaseModel): :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 ~azure.mgmt.databoxedge.models.RoleTypes] + :vartype configured_role_types: list[str or + ~azure.mgmt.databoxedge.v2019_08_01.models.RoleTypes] :ivar node_count: The number of nodes in the cluster. :vartype node_count: int """ @@ -824,7 +826,7 @@ class DataBoxEdgeDeviceList(msrest.serialization.Model): 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[~azure.mgmt.databoxedge.models.DataBoxEdgeDevice] + :vartype value: list[~azure.mgmt.databoxedge.v2019_08_01.models.DataBoxEdgeDevice] :ivar next_link: Link to the next set of results. :vartype next_link: str """ @@ -887,7 +889,7 @@ class Trigger(ARMBaseModel): :vartype type: str :param kind: Required. Trigger Kind.Constant filled by server. Possible values include: "FileEvent", "PeriodicTimerEvent". - :type kind: str or ~azure.mgmt.databoxedge.models.TriggerEventType + :type kind: str or ~azure.mgmt.databoxedge.v2019_08_01.models.TriggerEventType """ _validation = { @@ -931,11 +933,11 @@ class FileEventTrigger(Trigger): :vartype type: str :param kind: Required. Trigger Kind.Constant filled by server. Possible values include: "FileEvent", "PeriodicTimerEvent". - :type kind: str or ~azure.mgmt.databoxedge.models.TriggerEventType + :type kind: str or ~azure.mgmt.databoxedge.v2019_08_01.models.TriggerEventType :param source_info: Required. File event source details. - :type source_info: ~azure.mgmt.databoxedge.models.FileSourceInfo + :type source_info: ~azure.mgmt.databoxedge.v2019_08_01.models.FileSourceInfo :param sink_info: Required. Role sink info. - :type sink_info: ~azure.mgmt.databoxedge.models.RoleSinkInfo + :type sink_info: ~azure.mgmt.databoxedge.v2019_08_01.models.RoleSinkInfo :param custom_context_tag: A custom context tag typically used to correlate the trigger against its usage. For example, if a periodic timer trigger is intended for certain specific IoT modules in the device, the tag can be the name or the image URL of the module. @@ -1015,7 +1017,7 @@ class IoTDeviceInfo(msrest.serialization.Model): :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: ~azure.mgmt.databoxedge.models.Authentication + :type authentication: ~azure.mgmt.databoxedge.v2019_08_01.models.Authentication """ _validation = { @@ -1064,7 +1066,7 @@ class Role(ARMBaseModel): :vartype type: str :param kind: Required. Role type.Constant filled by server. Possible values include: "IOT", "ASA", "Functions", "Cognitive". - :type kind: str or ~azure.mgmt.databoxedge.models.RoleTypes + :type kind: str or ~azure.mgmt.databoxedge.v2019_08_01.models.RoleTypes """ _validation = { @@ -1108,19 +1110,19 @@ class IoTRole(Role): :vartype type: str :param kind: Required. Role type.Constant filled by server. Possible values include: "IOT", "ASA", "Functions", "Cognitive". - :type kind: str or ~azure.mgmt.databoxedge.models.RoleTypes + :type kind: str or ~azure.mgmt.databoxedge.v2019_08_01.models.RoleTypes :param host_platform: Host OS supported by the IoT role. Possible values include: "Windows", "Linux". - :type host_platform: str or ~azure.mgmt.databoxedge.models.PlatformType + :type host_platform: str or ~azure.mgmt.databoxedge.v2019_08_01.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: ~azure.mgmt.databoxedge.models.IoTDeviceInfo + :type io_t_device_details: ~azure.mgmt.databoxedge.v2019_08_01.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: ~azure.mgmt.databoxedge.models.IoTDeviceInfo + :type io_t_edge_device_details: ~azure.mgmt.databoxedge.v2019_08_01.models.IoTDeviceInfo :param share_mappings: Mount points of shares in role(s). - :type share_mappings: list[~azure.mgmt.databoxedge.models.MountPointMap] + :type share_mappings: list[~azure.mgmt.databoxedge.v2019_08_01.models.MountPointMap] :param role_status: Role status. Possible values include: "Enabled", "Disabled". - :type role_status: str or ~azure.mgmt.databoxedge.models.RoleStatus + :type role_status: str or ~azure.mgmt.databoxedge.v2019_08_01.models.RoleStatus """ _validation = { @@ -1244,7 +1246,7 @@ class Job(msrest.serialization.Model): :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 ~azure.mgmt.databoxedge.models.JobStatus + :vartype status: str or ~azure.mgmt.databoxedge.v2019_08_01.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. @@ -1252,19 +1254,19 @@ class Job(msrest.serialization.Model): :ivar percent_complete: The percentage of the job that is complete. :vartype percent_complete: int :ivar error: The error details. - :vartype error: ~azure.mgmt.databoxedge.models.JobErrorDetails + :vartype error: ~azure.mgmt.databoxedge.v2019_08_01.models.JobErrorDetails :ivar job_type: The type of the job. Possible values include: "Invalid", "ScanForUpdates", "DownloadUpdates", "InstallUpdates", "RefreshShare", "RefreshContainer". - :vartype job_type: str or ~azure.mgmt.databoxedge.models.JobType + :vartype job_type: str or ~azure.mgmt.databoxedge.v2019_08_01.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 ~azure.mgmt.databoxedge.models.UpdateOperationStage + :vartype current_stage: str or ~azure.mgmt.databoxedge.v2019_08_01.models.UpdateOperationStage :ivar download_progress: The download progress. - :vartype download_progress: ~azure.mgmt.databoxedge.models.UpdateDownloadProgress + :vartype download_progress: ~azure.mgmt.databoxedge.v2019_08_01.models.UpdateDownloadProgress :ivar install_progress: The install progress. - :vartype install_progress: ~azure.mgmt.databoxedge.models.UpdateInstallProgress + :vartype install_progress: ~azure.mgmt.databoxedge.v2019_08_01.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 @@ -1345,7 +1347,7 @@ class JobErrorDetails(msrest.serialization.Model): 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[~azure.mgmt.databoxedge.models.JobErrorItem] + :vartype error_details: list[~azure.mgmt.databoxedge.v2019_08_01.models.JobErrorItem] :ivar code: The code intended for programmatic access. :vartype code: str :ivar message: The message that describes the error in detail. @@ -1451,23 +1453,24 @@ class MetricSpecificationV1(msrest.serialization.Model): :type display_description: str :param unit: Metric units. Possible values include: "NotSpecified", "Percent", "Count", "Seconds", "Milliseconds", "Bytes", "BytesPerSecond", "CountPerSecond". - :type unit: str or ~azure.mgmt.databoxedge.models.MetricUnit + :type unit: str or ~azure.mgmt.databoxedge.v2019_08_01.models.MetricUnit :param aggregation_type: Metric aggregation type. Possible values include: "NotSpecified", "None", "Average", "Minimum", "Maximum", "Total", "Count". - :type aggregation_type: str or ~azure.mgmt.databoxedge.models.MetricAggregationType + :type aggregation_type: str or ~azure.mgmt.databoxedge.v2019_08_01.models.MetricAggregationType :param dimensions: Metric dimensions, other than default dimension which is resource. - :type dimensions: list[~azure.mgmt.databoxedge.models.MetricDimensionV1] + :type dimensions: list[~azure.mgmt.databoxedge.v2019_08_01.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 ~azure.mgmt.databoxedge.models.MetricCategory + :type category: str or ~azure.mgmt.databoxedge.v2019_08_01.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 ~azure.mgmt.databoxedge.models.TimeGrain] + :type supported_time_grain_types: list[str or + ~azure.mgmt.databoxedge.v2019_08_01.models.TimeGrain] :param supported_aggregation_types: Support metric aggregation type. :type supported_aggregation_types: list[str or - ~azure.mgmt.databoxedge.models.MetricAggregationType] + ~azure.mgmt.databoxedge.v2019_08_01.models.MetricAggregationType] """ _attribute_map = { @@ -1528,7 +1531,7 @@ class MountPointMap(msrest.serialization.Model): :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 ~azure.mgmt.databoxedge.models.RoleTypes + :vartype role_type: str or ~azure.mgmt.databoxedge.v2019_08_01.models.RoleTypes """ _validation = { @@ -1566,7 +1569,7 @@ class NetworkAdapter(msrest.serialization.Model): :ivar adapter_id: Instance ID of network adapter. :vartype adapter_id: str :ivar adapter_position: Hardware position of network adapter. - :vartype adapter_position: ~azure.mgmt.databoxedge.models.NetworkAdapterPosition + :vartype adapter_position: ~azure.mgmt.databoxedge.v2019_08_01.models.NetworkAdapterPosition :ivar index: Logical index of the adapter. :vartype index: int :ivar node_id: Node ID of the network adapter. @@ -1581,17 +1584,17 @@ class NetworkAdapter(msrest.serialization.Model): :vartype link_speed: long :ivar status: Value indicating whether this adapter is valid. Possible values include: "Inactive", "Active". - :vartype status: str or ~azure.mgmt.databoxedge.models.NetworkAdapterStatus + :vartype status: str or ~azure.mgmt.databoxedge.v2019_08_01.models.NetworkAdapterStatus :param rdma_status: Value indicating whether this adapter is RDMA capable. Possible values include: "Incapable", "Capable". - :type rdma_status: str or ~azure.mgmt.databoxedge.models.NetworkAdapterRDMAStatus + :type rdma_status: str or ~azure.mgmt.databoxedge.v2019_08_01.models.NetworkAdapterRDMAStatus :param dhcp_status: Value indicating whether this adapter has DHCP enabled. Possible values include: "Disabled", "Enabled". - :type dhcp_status: str or ~azure.mgmt.databoxedge.models.NetworkAdapterDHCPStatus + :type dhcp_status: str or ~azure.mgmt.databoxedge.v2019_08_01.models.NetworkAdapterDHCPStatus :ivar ipv4_configuration: The IPv4 configuration of the network adapter. - :vartype ipv4_configuration: ~azure.mgmt.databoxedge.models.Ipv4Config + :vartype ipv4_configuration: ~azure.mgmt.databoxedge.v2019_08_01.models.Ipv4Config :ivar ipv6_configuration: The IPv6 configuration of the network adapter. - :vartype ipv6_configuration: ~azure.mgmt.databoxedge.models.Ipv6Config + :vartype ipv6_configuration: ~azure.mgmt.databoxedge.v2019_08_01.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. @@ -1663,7 +1666,7 @@ class NetworkAdapterPosition(msrest.serialization.Model): 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 ~azure.mgmt.databoxedge.models.NetworkGroup + :vartype network_group: str or ~azure.mgmt.databoxedge.v2019_08_01.models.NetworkGroup :ivar port: The port. :vartype port: int """ @@ -1699,7 +1702,7 @@ class NetworkSettings(ARMBaseModel): :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[~azure.mgmt.databoxedge.models.NetworkAdapter] + :vartype network_adapters: list[~azure.mgmt.databoxedge.v2019_08_01.models.NetworkAdapter] """ _validation = { @@ -1739,7 +1742,7 @@ class Node(ARMBaseModel): :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 ~azure.mgmt.databoxedge.models.NodeStatus + :vartype node_status: str or ~azure.mgmt.databoxedge.v2019_08_01.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. @@ -1801,7 +1804,7 @@ class NodeList(msrest.serialization.Model): Variables are only populated by the server, and will be ignored when sending a request. :ivar value: The list of Nodes. - :vartype value: list[~azure.mgmt.databoxedge.models.Node] + :vartype value: list[~azure.mgmt.databoxedge.v2019_08_01.models.Node] """ _validation = { @@ -1826,11 +1829,11 @@ class Operation(msrest.serialization.Model): :param name: Name of the operation. :type name: str :param display: Properties displayed for the operation. - :type display: ~azure.mgmt.databoxedge.models.OperationDisplay + :type display: ~azure.mgmt.databoxedge.v2019_08_01.models.OperationDisplay :param origin: Origin of the operation. :type origin: str :param service_specification: Service specification. - :type service_specification: ~azure.mgmt.databoxedge.models.ServiceSpecification + :type service_specification: ~azure.mgmt.databoxedge.v2019_08_01.models.ServiceSpecification """ _attribute_map = { @@ -1898,7 +1901,7 @@ class OperationsList(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. :param value: Required. The value. - :type value: list[~azure.mgmt.databoxedge.models.Operation] + :type value: list[~azure.mgmt.databoxedge.v2019_08_01.models.Operation] :param next_link: Link to the next set of results. :type next_link: str """ @@ -1936,21 +1939,21 @@ class Order(ARMBaseModel): :ivar type: The hierarchical type of the object. :vartype type: str :param contact_information: The contact details. - :type contact_information: ~azure.mgmt.databoxedge.models.ContactDetails + :type contact_information: ~azure.mgmt.databoxedge.v2019_08_01.models.ContactDetails :param shipping_address: The shipping address. - :type shipping_address: ~azure.mgmt.databoxedge.models.Address + :type shipping_address: ~azure.mgmt.databoxedge.v2019_08_01.models.Address :param current_status: Current status of the order. - :type current_status: ~azure.mgmt.databoxedge.models.OrderStatus + :type current_status: ~azure.mgmt.databoxedge.v2019_08_01.models.OrderStatus :ivar order_history: List of status changes in the order. - :vartype order_history: list[~azure.mgmt.databoxedge.models.OrderStatus] + :vartype order_history: list[~azure.mgmt.databoxedge.v2019_08_01.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[~azure.mgmt.databoxedge.models.TrackingInfo] + :vartype delivery_tracking_info: list[~azure.mgmt.databoxedge.v2019_08_01.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[~azure.mgmt.databoxedge.models.TrackingInfo] + :vartype return_tracking_info: list[~azure.mgmt.databoxedge.v2019_08_01.models.TrackingInfo] """ _validation = { @@ -2000,7 +2003,7 @@ class OrderList(msrest.serialization.Model): Variables are only populated by the server, and will be ignored when sending a request. :ivar value: The list of orders. - :vartype value: list[~azure.mgmt.databoxedge.models.Order] + :vartype value: list[~azure.mgmt.databoxedge.v2019_08_01.models.Order] :ivar next_link: Link to the next set of results. :vartype next_link: str """ @@ -2035,7 +2038,7 @@ class OrderStatus(msrest.serialization.Model): include: "Untracked", "AwaitingFulfilment", "AwaitingPreparation", "AwaitingShipment", "Shipped", "Arriving", "Delivered", "ReplacementRequested", "LostDevice", "Declined", "ReturnInitiated", "AwaitingReturnShipment", "ShippedBack", "CollectedAtMicrosoft". - :type status: str or ~azure.mgmt.databoxedge.models.OrderState + :type status: str or ~azure.mgmt.databoxedge.v2019_08_01.models.OrderState :ivar update_date_time: Time of status update. :vartype update_date_time: ~datetime.datetime :param comments: Comments related to this status change. @@ -2087,11 +2090,11 @@ class PeriodicTimerEventTrigger(Trigger): :vartype type: str :param kind: Required. Trigger Kind.Constant filled by server. Possible values include: "FileEvent", "PeriodicTimerEvent". - :type kind: str or ~azure.mgmt.databoxedge.models.TriggerEventType + :type kind: str or ~azure.mgmt.databoxedge.v2019_08_01.models.TriggerEventType :param source_info: Required. Periodic timer details. - :type source_info: ~azure.mgmt.databoxedge.models.PeriodicTimerSourceInfo + :type source_info: ~azure.mgmt.databoxedge.v2019_08_01.models.PeriodicTimerSourceInfo :param sink_info: Required. Role Sink information. - :type sink_info: ~azure.mgmt.databoxedge.models.RoleSinkInfo + :type sink_info: ~azure.mgmt.databoxedge.v2019_08_01.models.RoleSinkInfo :param custom_context_tag: A custom context tag typically used to correlate the trigger against its usage. For example, if a periodic timer trigger is intended for certain specific IoT modules in the device, the tag can be the name or the image URL of the module. @@ -2226,11 +2229,11 @@ class ResourceTypeSku(msrest.serialization.Model): :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 ~azure.mgmt.databoxedge.models.SkuName + :vartype name: str or ~azure.mgmt.databoxedge.v2019_08_01.models.SkuName :ivar kind: The Sku kind. :vartype kind: str :ivar tier: The Sku tier. Possible values include: "Standard". - :vartype tier: str or ~azure.mgmt.databoxedge.models.SkuTier + :vartype tier: str or ~azure.mgmt.databoxedge.v2019_08_01.models.SkuTier :ivar family: The Sku family. :vartype family: str :ivar locations: Availability of the SKU for the region. @@ -2238,11 +2241,11 @@ class ResourceTypeSku(msrest.serialization.Model): :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[~azure.mgmt.databoxedge.models.SkuLocationInfo] + :vartype location_info: list[~azure.mgmt.databoxedge.v2019_08_01.models.SkuLocationInfo] :ivar costs: The pricing info of the Sku. - :vartype costs: list[~azure.mgmt.databoxedge.models.SkuCost] + :vartype costs: list[~azure.mgmt.databoxedge.v2019_08_01.models.SkuCost] :ivar restrictions: Restrictions of the SKU availability. - :vartype restrictions: list[~azure.mgmt.databoxedge.models.SkuRestriction] + :vartype restrictions: list[~azure.mgmt.databoxedge.v2019_08_01.models.SkuRestriction] """ _validation = { @@ -2294,7 +2297,7 @@ class RoleList(msrest.serialization.Model): Variables are only populated by the server, and will be ignored when sending a request. :ivar value: The Value. - :vartype value: list[~azure.mgmt.databoxedge.models.Role] + :vartype value: list[~azure.mgmt.databoxedge.v2019_08_01.models.Role] :ivar next_link: Link to the next set of results. :vartype next_link: str """ @@ -2362,7 +2365,8 @@ class SecuritySettings(ARMBaseModel): (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: ~azure.mgmt.databoxedge.models.AsymmetricEncryptedSecret + :type device_admin_password: + ~azure.mgmt.databoxedge.v2019_08_01.models.AsymmetricEncryptedSecret """ _validation = { @@ -2393,7 +2397,8 @@ class ServiceSpecification(msrest.serialization.Model): """Service specification. :param metric_specifications: Metric specification as defined by shoebox. - :type metric_specifications: list[~azure.mgmt.databoxedge.models.MetricSpecificationV1] + :type metric_specifications: + list[~azure.mgmt.databoxedge.v2019_08_01.models.MetricSpecificationV1] """ _attribute_map = { @@ -2427,27 +2432,27 @@ class Share(ARMBaseModel): :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 ~azure.mgmt.databoxedge.models.ShareStatus + :type share_status: str or ~azure.mgmt.databoxedge.v2019_08_01.models.ShareStatus :param monitoring_status: Required. Current monitoring status of the share. Possible values include: "Enabled", "Disabled". - :type monitoring_status: str or ~azure.mgmt.databoxedge.models.MonitoringStatus + :type monitoring_status: str or ~azure.mgmt.databoxedge.v2019_08_01.models.MonitoringStatus :param azure_container_info: Azure container mapping for the share. - :type azure_container_info: ~azure.mgmt.databoxedge.models.AzureContainerInfo + :type azure_container_info: ~azure.mgmt.databoxedge.v2019_08_01.models.AzureContainerInfo :param access_protocol: Required. Access protocol to be used by the share. Possible values include: "SMB", "NFS". - :type access_protocol: str or ~azure.mgmt.databoxedge.models.ShareAccessProtocol + :type access_protocol: str or ~azure.mgmt.databoxedge.v2019_08_01.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[~azure.mgmt.databoxedge.models.UserAccessRight] + :type user_access_rights: list[~azure.mgmt.databoxedge.v2019_08_01.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[~azure.mgmt.databoxedge.models.ClientAccessRight] + :type client_access_rights: list[~azure.mgmt.databoxedge.v2019_08_01.models.ClientAccessRight] :param refresh_details: Details of the refresh job on this share. - :type refresh_details: ~azure.mgmt.databoxedge.models.RefreshDetails + :type refresh_details: ~azure.mgmt.databoxedge.v2019_08_01.models.RefreshDetails :ivar share_mappings: Share mount point to the role. - :vartype share_mappings: list[~azure.mgmt.databoxedge.models.MountPointMap] + :vartype share_mappings: list[~azure.mgmt.databoxedge.v2019_08_01.models.MountPointMap] :param data_policy: Data policy of the share. Possible values include: "Cloud", "Local". - :type data_policy: str or ~azure.mgmt.databoxedge.models.DataPolicy + :type data_policy: str or ~azure.mgmt.databoxedge.v2019_08_01.models.DataPolicy """ _validation = { @@ -2512,7 +2517,7 @@ class ShareAccessRight(msrest.serialization.Model): :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 ~azure.mgmt.databoxedge.models.ShareAccessType + :type access_type: str or ~azure.mgmt.databoxedge.v2019_08_01.models.ShareAccessType """ _validation = { @@ -2543,7 +2548,7 @@ class ShareList(msrest.serialization.Model): Variables are only populated by the server, and will be ignored when sending a request. :ivar value: The list of shares. - :vartype value: list[~azure.mgmt.databoxedge.models.Share] + :vartype value: list[~azure.mgmt.databoxedge.v2019_08_01.models.Share] :ivar next_link: Link to the next set of results. :vartype next_link: str """ @@ -2573,9 +2578,9 @@ class Sku(msrest.serialization.Model): :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 ~azure.mgmt.databoxedge.models.SkuName + :type name: str or ~azure.mgmt.databoxedge.v2019_08_01.models.SkuName :param tier: The SKU tier. This is based on the SKU name. Possible values include: "Standard". - :type tier: str or ~azure.mgmt.databoxedge.models.SkuTier + :type tier: str or ~azure.mgmt.databoxedge.v2019_08_01.models.SkuTier """ _attribute_map = { @@ -2636,7 +2641,7 @@ class SkuInformationList(msrest.serialization.Model): Variables are only populated by the server, and will be ignored when sending a request. :ivar value: List of ResourceType Sku. - :vartype value: list[~azure.mgmt.databoxedge.models.ResourceTypeSku] + :vartype value: list[~azure.mgmt.databoxedge.v2019_08_01.models.ResourceTypeSku] :ivar next_link: Links to the next set of results. :vartype next_link: str """ @@ -2706,9 +2711,10 @@ class SkuRestriction(msrest.serialization.Model): :vartype values: list[str] :ivar reason_code: The SKU restriction reason. Possible values include: "NotAvailableForSubscription", "QuotaId". - :vartype reason_code: str or ~azure.mgmt.databoxedge.models.SkuRestrictionReasonCode + :vartype reason_code: str or + ~azure.mgmt.databoxedge.v2019_08_01.models.SkuRestrictionReasonCode :ivar restriction_info: Restriction of the SKU for the location/zone. - :vartype restriction_info: ~azure.mgmt.databoxedge.models.SkuRestrictionInfo + :vartype restriction_info: ~azure.mgmt.databoxedge.v2019_08_01.models.SkuRestrictionInfo """ _validation = { @@ -2781,10 +2787,11 @@ class StorageAccount(ARMBaseModel): :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 ~azure.mgmt.databoxedge.models.StorageAccountStatus + :type storage_account_status: str or + ~azure.mgmt.databoxedge.v2019_08_01.models.StorageAccountStatus :param data_policy: Data policy of the storage Account. Possible values include: "Cloud", "Local". - :type data_policy: str or ~azure.mgmt.databoxedge.models.DataPolicy + :type data_policy: str or ~azure.mgmt.databoxedge.v2019_08_01.models.DataPolicy :param storage_account_credential_id: Storage Account Credential Id. :type storage_account_credential_id: str :ivar blob_endpoint: BlobEndpoint of Storage Account. @@ -2850,18 +2857,18 @@ class StorageAccountCredential(ARMBaseModel): :param user_name: Username for the storage account. :type user_name: str :param account_key: Encrypted storage key. - :type account_key: ~azure.mgmt.databoxedge.models.AsymmetricEncryptedSecret + :type account_key: ~azure.mgmt.databoxedge.v2019_08_01.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 ~azure.mgmt.databoxedge.models.SSLStatus + :type ssl_status: str or ~azure.mgmt.databoxedge.v2019_08_01.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 ~azure.mgmt.databoxedge.models.AccountType + :type account_type: str or ~azure.mgmt.databoxedge.v2019_08_01.models.AccountType :param storage_account_id: Id of the storage account. :type storage_account_id: str """ @@ -2919,7 +2926,7 @@ class StorageAccountCredentialList(msrest.serialization.Model): Variables are only populated by the server, and will be ignored when sending a request. :ivar value: The value. - :vartype value: list[~azure.mgmt.databoxedge.models.StorageAccountCredential] + :vartype value: list[~azure.mgmt.databoxedge.v2019_08_01.models.StorageAccountCredential] :ivar next_link: Link to the next set of results. :vartype next_link: str """ @@ -2949,7 +2956,7 @@ class StorageAccountList(msrest.serialization.Model): Variables are only populated by the server, and will be ignored when sending a request. :ivar value: The list of storageAccounts. - :vartype value: list[~azure.mgmt.databoxedge.models.StorageAccount] + :vartype value: list[~azure.mgmt.databoxedge.v2019_08_01.models.StorageAccount] :ivar next_link: Link to the next set of results. :vartype next_link: str """ @@ -2977,7 +2984,7 @@ class SymmetricKey(msrest.serialization.Model): """Symmetric key for authentication. :param connection_string: Connection string based on the symmetric key. - :type connection_string: ~azure.mgmt.databoxedge.models.AsymmetricEncryptedSecret + :type connection_string: ~azure.mgmt.databoxedge.v2019_08_01.models.AsymmetricEncryptedSecret """ _attribute_map = { @@ -3036,7 +3043,7 @@ class TriggerList(msrest.serialization.Model): Variables are only populated by the server, and will be ignored when sending a request. :ivar value: The list of triggers. - :vartype value: list[~azure.mgmt.databoxedge.models.Trigger] + :vartype value: list[~azure.mgmt.databoxedge.v2019_08_01.models.Trigger] :ivar next_link: Link to the next set of results. :vartype next_link: str """ @@ -3067,7 +3074,7 @@ class UpdateDownloadProgress(msrest.serialization.Model): :ivar download_phase: The download phase. Possible values include: "Unknown", "Initializing", "Downloading", "Verifying". - :vartype download_phase: str or ~azure.mgmt.databoxedge.models.DownloadPhase + :vartype download_phase: str or ~azure.mgmt.databoxedge.v2019_08_01.models.DownloadPhase :ivar percent_complete: Percentage of completion. :vartype percent_complete: int :ivar total_bytes_to_download: Total bytes to download. @@ -3181,10 +3188,12 @@ class UpdateSummary(ARMBaseModel): :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 ~azure.mgmt.databoxedge.models.InstallRebootBehavior + :vartype reboot_behavior: str or + ~azure.mgmt.databoxedge.v2019_08_01.models.InstallRebootBehavior :ivar ongoing_update_operation: The current update operation. Possible values include: "None", "Scan", "Download", "Install". - :vartype ongoing_update_operation: str or ~azure.mgmt.databoxedge.models.UpdateOperation + :vartype ongoing_update_operation: str or + ~azure.mgmt.databoxedge.v2019_08_01.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. @@ -3279,7 +3288,7 @@ class UploadCertificateRequest(msrest.serialization.Model): :param authentication_type: The authentication type. Possible values include: "Invalid", "AzureActiveDirectory". - :type authentication_type: str or ~azure.mgmt.databoxedge.models.AuthenticationType + :type authentication_type: str or ~azure.mgmt.databoxedge.v2019_08_01.models.AuthenticationType :param certificate: Required. The base64 encoded certificate raw data. :type certificate: str """ @@ -3312,7 +3321,7 @@ class UploadCertificateResponse(msrest.serialization.Model): :param auth_type: Specifies authentication type. Possible values include: "Invalid", "AzureActiveDirectory". - :type auth_type: str or ~azure.mgmt.databoxedge.models.AuthenticationType + :type auth_type: str or ~azure.mgmt.databoxedge.v2019_08_01.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. @@ -3382,13 +3391,13 @@ class User(ARMBaseModel): :ivar type: The hierarchical type of the object. :vartype type: str :param encrypted_password: The password details. - :type encrypted_password: ~azure.mgmt.databoxedge.models.AsymmetricEncryptedSecret + :type encrypted_password: ~azure.mgmt.databoxedge.v2019_08_01.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[~azure.mgmt.databoxedge.models.ShareAccessRight] + :type share_access_rights: list[~azure.mgmt.databoxedge.v2019_08_01.models.ShareAccessRight] :param user_type: Required. Type of the user. Possible values include: "Share", "LocalManagement", "ARM". - :type user_type: str or ~azure.mgmt.databoxedge.models.UserType + :type user_type: str or ~azure.mgmt.databoxedge.v2019_08_01.models.UserType """ _validation = { @@ -3430,7 +3439,7 @@ class UserAccessRight(msrest.serialization.Model): :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 ~azure.mgmt.databoxedge.models.ShareAccessType + :type access_type: str or ~azure.mgmt.databoxedge.v2019_08_01.models.ShareAccessType """ _validation = { @@ -3461,7 +3470,7 @@ class UserList(msrest.serialization.Model): Variables are only populated by the server, and will be ignored when sending a request. :ivar value: The list of users. - :vartype value: list[~azure.mgmt.databoxedge.models.User] + :vartype value: list[~azure.mgmt.databoxedge.v2019_08_01.models.User] :ivar next_link: Link to the next set of results. :vartype next_link: str """ diff --git a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_08_01/operations/_alerts_operations.py b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_08_01/operations/_alerts_operations.py index bef4315fac70..c43d0a79ad7a 100644 --- a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_08_01/operations/_alerts_operations.py +++ b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_08_01/operations/_alerts_operations.py @@ -30,7 +30,7 @@ class AlertsOperations(object): instantiates it for you and attaches it as an attribute. :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.databoxedge.models + :type models: ~azure.mgmt.databoxedge.v2019_08_01.models :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. @@ -60,7 +60,7 @@ def list_by_data_box_edge_device( :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[~azure.mgmt.databoxedge.models.AlertList] + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.databoxedge.v2019_08_01.models.AlertList] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.AlertList"] @@ -140,7 +140,7 @@ def get( :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: ~azure.mgmt.databoxedge.models.Alert + :rtype: ~azure.mgmt.databoxedge.v2019_08_01.models.Alert :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.Alert"] diff --git a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_08_01/operations/_bandwidth_schedules_operations.py b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_08_01/operations/_bandwidth_schedules_operations.py index c3cbbb0cc104..c865d71791de 100644 --- a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_08_01/operations/_bandwidth_schedules_operations.py +++ b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_08_01/operations/_bandwidth_schedules_operations.py @@ -32,7 +32,7 @@ class BandwidthSchedulesOperations(object): instantiates it for you and attaches it as an attribute. :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.databoxedge.models + :type models: ~azure.mgmt.databoxedge.v2019_08_01.models :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. @@ -62,7 +62,7 @@ def list_by_data_box_edge_device( :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[~azure.mgmt.databoxedge.models.BandwidthSchedulesList] + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.databoxedge.v2019_08_01.models.BandwidthSchedulesList] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.BandwidthSchedulesList"] @@ -140,7 +140,7 @@ def get( :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: ~azure.mgmt.databoxedge.models.BandwidthSchedule + :rtype: ~azure.mgmt.databoxedge.v2019_08_01.models.BandwidthSchedule :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.BandwidthSchedule"] @@ -261,15 +261,15 @@ def begin_create_or_update( :param resource_group_name: The resource group name. :type resource_group_name: str :param parameters: The bandwidth schedule to be added or updated. - :type parameters: ~azure.mgmt.databoxedge.models.BandwidthSchedule + :type parameters: ~azure.mgmt.databoxedge.v2019_08_01.models.BandwidthSchedule :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: True for ARMPolling, False for no polling, or a - polling object for personal polling strategy + :keyword polling: Pass in True if you'd like the ARMPolling polling method, + False for no polling, or your own initialized polling object for a 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[~azure.mgmt.databoxedge.models.BandwidthSchedule] + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.databoxedge.v2019_08_01.models.BandwidthSchedule] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] @@ -385,8 +385,8 @@ def begin_delete( :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 + :keyword polling: Pass in True if you'd like the ARMPolling polling method, + False for no polling, or your own initialized polling object for a 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) diff --git a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_08_01/operations/_containers_operations.py b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_08_01/operations/_containers_operations.py index f3f02fa0c88a..a02b4fcefa85 100644 --- a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_08_01/operations/_containers_operations.py +++ b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_08_01/operations/_containers_operations.py @@ -32,7 +32,7 @@ class ContainersOperations(object): instantiates it for you and attaches it as an attribute. :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.databoxedge.models + :type models: ~azure.mgmt.databoxedge.v2019_08_01.models :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. @@ -67,7 +67,7 @@ def list_by_storage_account( :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[~azure.mgmt.databoxedge.models.ContainerList] + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.databoxedge.v2019_08_01.models.ContainerList] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.ContainerList"] @@ -151,7 +151,7 @@ def get( :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: ~azure.mgmt.databoxedge.models.Container + :rtype: ~azure.mgmt.databoxedge.v2019_08_01.models.Container :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.Container"] @@ -280,15 +280,15 @@ def begin_create_or_update( :param resource_group_name: The resource group name. :type resource_group_name: str :param container: The container properties. - :type container: ~azure.mgmt.databoxedge.models.Container + :type container: ~azure.mgmt.databoxedge.v2019_08_01.models.Container :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: True for ARMPolling, False for no polling, or a - polling object for personal polling strategy + :keyword polling: Pass in True if you'd like the ARMPolling polling method, + False for no polling, or your own initialized polling object for a 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[~azure.mgmt.databoxedge.models.Container] + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.databoxedge.v2019_08_01.models.Container] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] @@ -411,8 +411,8 @@ def begin_delete( :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 + :keyword polling: Pass in True if you'd like the ARMPolling polling method, + False for no polling, or your own initialized polling object for a 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) @@ -537,8 +537,8 @@ def begin_refresh( :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 + :keyword polling: Pass in True if you'd like the ARMPolling polling method, + False for no polling, or your own initialized polling object for a 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) diff --git a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_08_01/operations/_devices_operations.py b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_08_01/operations/_devices_operations.py index f4cbe3cc2bc7..1dcf6c0a0e5d 100644 --- a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_08_01/operations/_devices_operations.py +++ b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_08_01/operations/_devices_operations.py @@ -32,7 +32,7 @@ class DevicesOperations(object): instantiates it for you and attaches it as an attribute. :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.databoxedge.models + :type models: ~azure.mgmt.databoxedge.v2019_08_01.models :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. @@ -60,7 +60,7 @@ def list_by_subscription( :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[~azure.mgmt.databoxedge.models.DataBoxEdgeDeviceList] + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.databoxedge.v2019_08_01.models.DataBoxEdgeDeviceList] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.DataBoxEdgeDeviceList"] @@ -136,7 +136,7 @@ def list_by_resource_group( :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[~azure.mgmt.databoxedge.models.DataBoxEdgeDeviceList] + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.databoxedge.v2019_08_01.models.DataBoxEdgeDeviceList] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.DataBoxEdgeDeviceList"] @@ -212,7 +212,7 @@ def get( :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: ~azure.mgmt.databoxedge.models.DataBoxEdgeDevice + :rtype: ~azure.mgmt.databoxedge.v2019_08_01.models.DataBoxEdgeDevice :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.DataBoxEdgeDevice"] @@ -325,15 +325,15 @@ def begin_create_or_update( :param resource_group_name: The resource group name. :type resource_group_name: str :param data_box_edge_device: The resource object. - :type data_box_edge_device: ~azure.mgmt.databoxedge.models.DataBoxEdgeDevice + :type data_box_edge_device: ~azure.mgmt.databoxedge.v2019_08_01.models.DataBoxEdgeDevice :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 + :keyword polling: Pass in True if you'd like the ARMPolling polling method, + False for no polling, or your own initialized polling object for a 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[~azure.mgmt.databoxedge.models.DataBoxEdgeDevice] + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.databoxedge.v2019_08_01.models.DataBoxEdgeDevice] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] @@ -442,8 +442,8 @@ def begin_delete( :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 + :keyword polling: Pass in True if you'd like the ARMPolling polling method, + False for no polling, or your own initialized polling object for a 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) @@ -507,10 +507,10 @@ def update( :param resource_group_name: The resource group name. :type resource_group_name: str :param parameters: The resource parameters. - :type parameters: ~azure.mgmt.databoxedge.models.DataBoxEdgeDevicePatch + :type parameters: ~azure.mgmt.databoxedge.v2019_08_01.models.DataBoxEdgeDevicePatch :keyword callable cls: A custom type or function that will be passed the direct response :return: DataBoxEdgeDevice, or the result of cls(response) - :rtype: ~azure.mgmt.databoxedge.models.DataBoxEdgeDevice + :rtype: ~azure.mgmt.databoxedge.v2019_08_01.models.DataBoxEdgeDevice :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.DataBoxEdgeDevice"] @@ -621,8 +621,8 @@ def begin_download_updates( :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 + :keyword polling: Pass in True if you'd like the ARMPolling polling method, + False for no polling, or your own initialized polling object for a 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) @@ -686,7 +686,7 @@ def get_extended_information( :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: ~azure.mgmt.databoxedge.models.DataBoxEdgeDeviceExtendedInfo + :rtype: ~azure.mgmt.databoxedge.v2019_08_01.models.DataBoxEdgeDeviceExtendedInfo :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.DataBoxEdgeDeviceExtendedInfo"] @@ -792,8 +792,8 @@ def begin_install_updates( :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 + :keyword polling: Pass in True if you'd like the ARMPolling polling method, + False for no polling, or your own initialized polling object for a 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) @@ -857,7 +857,7 @@ def get_network_settings( :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: ~azure.mgmt.databoxedge.models.NetworkSettings + :rtype: ~azure.mgmt.databoxedge.v2019_08_01.models.NetworkSettings :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkSettings"] @@ -963,8 +963,8 @@ def begin_scan_for_updates( :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 + :keyword polling: Pass in True if you'd like the ARMPolling polling method, + False for no polling, or your own initialized polling object for a 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) @@ -1079,11 +1079,11 @@ def begin_create_or_update_security_settings( :param resource_group_name: The resource group name. :type resource_group_name: str :param security_settings: The security settings. - :type security_settings: ~azure.mgmt.databoxedge.models.SecuritySettings + :type security_settings: ~azure.mgmt.databoxedge.v2019_08_01.models.SecuritySettings :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: True for ARMPolling, False for no polling, or a - polling object for personal polling strategy + :keyword polling: Pass in True if you'd like the ARMPolling polling method, + False for no polling, or your own initialized polling object for a 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) @@ -1151,7 +1151,7 @@ def get_update_summary( :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: ~azure.mgmt.databoxedge.models.UpdateSummary + :rtype: ~azure.mgmt.databoxedge.v2019_08_01.models.UpdateSummary :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.UpdateSummary"] @@ -1210,10 +1210,10 @@ def upload_certificate( :param resource_group_name: The resource group name. :type resource_group_name: str :param parameters: The upload certificate request. - :type parameters: ~azure.mgmt.databoxedge.models.UploadCertificateRequest + :type parameters: ~azure.mgmt.databoxedge.v2019_08_01.models.UploadCertificateRequest :keyword callable cls: A custom type or function that will be passed the direct response :return: UploadCertificateResponse, or the result of cls(response) - :rtype: ~azure.mgmt.databoxedge.models.UploadCertificateResponse + :rtype: ~azure.mgmt.databoxedge.v2019_08_01.models.UploadCertificateResponse :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.UploadCertificateResponse"] diff --git a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_08_01/operations/_jobs_operations.py b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_08_01/operations/_jobs_operations.py index d42f9c1266fe..ae64fe0e955b 100644 --- a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_08_01/operations/_jobs_operations.py +++ b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_08_01/operations/_jobs_operations.py @@ -29,7 +29,7 @@ class JobsOperations(object): instantiates it for you and attaches it as an attribute. :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.databoxedge.models + :type models: ~azure.mgmt.databoxedge.v2019_08_01.models :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. @@ -64,7 +64,7 @@ def get( :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: ~azure.mgmt.databoxedge.models.Job + :rtype: ~azure.mgmt.databoxedge.v2019_08_01.models.Job :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.Job"] diff --git a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_08_01/operations/_nodes_operations.py b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_08_01/operations/_nodes_operations.py index d89857fa460d..c5a09a62691f 100644 --- a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_08_01/operations/_nodes_operations.py +++ b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_08_01/operations/_nodes_operations.py @@ -30,7 +30,7 @@ class NodesOperations(object): instantiates it for you and attaches it as an attribute. :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.databoxedge.models + :type models: ~azure.mgmt.databoxedge.v2019_08_01.models :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. @@ -60,7 +60,7 @@ def list_by_data_box_edge_device( :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[~azure.mgmt.databoxedge.models.NodeList] + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.databoxedge.v2019_08_01.models.NodeList] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.NodeList"] diff --git a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_08_01/operations/_operations.py b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_08_01/operations/_operations.py index 09fdd3ce6d38..60e166c69f05 100644 --- a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_08_01/operations/_operations.py +++ b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_08_01/operations/_operations.py @@ -30,7 +30,7 @@ class Operations(object): instantiates it for you and attaches it as an attribute. :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.databoxedge.models + :type models: ~azure.mgmt.databoxedge.v2019_08_01.models :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. @@ -56,7 +56,7 @@ def list( :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[~azure.mgmt.databoxedge.models.OperationsList] + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.databoxedge.v2019_08_01.models.OperationsList] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationsList"] diff --git a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_08_01/operations/_operations_status_operations.py b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_08_01/operations/_operations_status_operations.py index c4ec340fac5c..a30d82757482 100644 --- a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_08_01/operations/_operations_status_operations.py +++ b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_08_01/operations/_operations_status_operations.py @@ -29,7 +29,7 @@ class OperationsStatusOperations(object): instantiates it for you and attaches it as an attribute. :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.databoxedge.models + :type models: ~azure.mgmt.databoxedge.v2019_08_01.models :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. @@ -64,7 +64,7 @@ def get( :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: ~azure.mgmt.databoxedge.models.Job + :rtype: ~azure.mgmt.databoxedge.v2019_08_01.models.Job :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.Job"] diff --git a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_08_01/operations/_orders_operations.py b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_08_01/operations/_orders_operations.py index bef89573d2b6..52461cd4e254 100644 --- a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_08_01/operations/_orders_operations.py +++ b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_08_01/operations/_orders_operations.py @@ -32,7 +32,7 @@ class OrdersOperations(object): instantiates it for you and attaches it as an attribute. :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.databoxedge.models + :type models: ~azure.mgmt.databoxedge.v2019_08_01.models :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. @@ -64,7 +64,7 @@ def list_by_data_box_edge_device( :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[~azure.mgmt.databoxedge.models.OrderList] + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.databoxedge.v2019_08_01.models.OrderList] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.OrderList"] @@ -141,7 +141,7 @@ def get( :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: ~azure.mgmt.databoxedge.models.Order + :rtype: ~azure.mgmt.databoxedge.v2019_08_01.models.Order :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.Order"] @@ -258,15 +258,15 @@ def begin_create_or_update( :param resource_group_name: The resource group name. :type resource_group_name: str :param order: The order to be created or updated. - :type order: ~azure.mgmt.databoxedge.models.Order + :type order: ~azure.mgmt.databoxedge.v2019_08_01.models.Order :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: True for ARMPolling, False for no polling, or a - polling object for personal polling strategy + :keyword polling: Pass in True if you'd like the ARMPolling polling method, + False for no polling, or your own initialized polling object for a 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[~azure.mgmt.databoxedge.models.Order] + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.databoxedge.v2019_08_01.models.Order] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] @@ -377,8 +377,8 @@ def begin_delete( :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 + :keyword polling: Pass in True if you'd like the ARMPolling polling method, + False for no polling, or your own initialized polling object for a 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) diff --git a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_08_01/operations/_roles_operations.py b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_08_01/operations/_roles_operations.py index 2726593a55c3..23cab2b31e98 100644 --- a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_08_01/operations/_roles_operations.py +++ b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_08_01/operations/_roles_operations.py @@ -32,7 +32,7 @@ class RolesOperations(object): instantiates it for you and attaches it as an attribute. :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.databoxedge.models + :type models: ~azure.mgmt.databoxedge.v2019_08_01.models :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. @@ -62,7 +62,7 @@ def list_by_data_box_edge_device( :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[~azure.mgmt.databoxedge.models.RoleList] + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.databoxedge.v2019_08_01.models.RoleList] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.RoleList"] @@ -140,7 +140,7 @@ def get( :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: ~azure.mgmt.databoxedge.models.Role + :rtype: ~azure.mgmt.databoxedge.v2019_08_01.models.Role :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.Role"] @@ -261,15 +261,15 @@ def begin_create_or_update( :param resource_group_name: The resource group name. :type resource_group_name: str :param role: The role properties. - :type role: ~azure.mgmt.databoxedge.models.Role + :type role: ~azure.mgmt.databoxedge.v2019_08_01.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 + :keyword polling: Pass in True if you'd like the ARMPolling polling method, + False for no polling, or your own initialized polling object for a 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[~azure.mgmt.databoxedge.models.Role] + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.databoxedge.v2019_08_01.models.Role] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] @@ -385,8 +385,8 @@ def begin_delete( :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 + :keyword polling: Pass in True if you'd like the ARMPolling polling method, + False for no polling, or your own initialized polling object for a 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) diff --git a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_08_01/operations/_shares_operations.py b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_08_01/operations/_shares_operations.py index 093546fe38c4..d654bbcb61f5 100644 --- a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_08_01/operations/_shares_operations.py +++ b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_08_01/operations/_shares_operations.py @@ -32,7 +32,7 @@ class SharesOperations(object): instantiates it for you and attaches it as an attribute. :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.databoxedge.models + :type models: ~azure.mgmt.databoxedge.v2019_08_01.models :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. @@ -64,7 +64,7 @@ def list_by_data_box_edge_device( :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[~azure.mgmt.databoxedge.models.ShareList] + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.databoxedge.v2019_08_01.models.ShareList] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.ShareList"] @@ -144,7 +144,7 @@ def get( :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: ~azure.mgmt.databoxedge.models.Share + :rtype: ~azure.mgmt.databoxedge.v2019_08_01.models.Share :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.Share"] @@ -267,15 +267,15 @@ def begin_create_or_update( :param resource_group_name: The resource group name. :type resource_group_name: str :param share: The share properties. - :type share: ~azure.mgmt.databoxedge.models.Share + :type share: ~azure.mgmt.databoxedge.v2019_08_01.models.Share :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: True for ARMPolling, False for no polling, or a - polling object for personal polling strategy + :keyword polling: Pass in True if you'd like the ARMPolling polling method, + False for no polling, or your own initialized polling object for a 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[~azure.mgmt.databoxedge.models.Share] + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.databoxedge.v2019_08_01.models.Share] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] @@ -391,8 +391,8 @@ def begin_delete( :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 + :keyword polling: Pass in True if you'd like the ARMPolling polling method, + False for no polling, or your own initialized polling object for a 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) @@ -510,8 +510,8 @@ def begin_refresh( :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 + :keyword polling: Pass in True if you'd like the ARMPolling polling method, + False for no polling, or your own initialized polling object for a 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) diff --git a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_08_01/operations/_skus_operations.py b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_08_01/operations/_skus_operations.py index 5fe7aef71fd9..1676918728c2 100644 --- a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_08_01/operations/_skus_operations.py +++ b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_08_01/operations/_skus_operations.py @@ -30,7 +30,7 @@ class SkusOperations(object): instantiates it for you and attaches it as an attribute. :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.databoxedge.models + :type models: ~azure.mgmt.databoxedge.v2019_08_01.models :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. @@ -59,7 +59,7 @@ def list( :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[~azure.mgmt.databoxedge.models.SkuInformationList] + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.databoxedge.v2019_08_01.models.SkuInformationList] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.SkuInformationList"] diff --git a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_08_01/operations/_storage_account_credentials_operations.py b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_08_01/operations/_storage_account_credentials_operations.py index 90f9c80e6233..137137688679 100644 --- a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_08_01/operations/_storage_account_credentials_operations.py +++ b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_08_01/operations/_storage_account_credentials_operations.py @@ -32,7 +32,7 @@ class StorageAccountCredentialsOperations(object): instantiates it for you and attaches it as an attribute. :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.databoxedge.models + :type models: ~azure.mgmt.databoxedge.v2019_08_01.models :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. @@ -64,7 +64,7 @@ def list_by_data_box_edge_device( :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[~azure.mgmt.databoxedge.models.StorageAccountCredentialList] + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.databoxedge.v2019_08_01.models.StorageAccountCredentialList] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.StorageAccountCredentialList"] @@ -142,7 +142,7 @@ def get( :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: ~azure.mgmt.databoxedge.models.StorageAccountCredential + :rtype: ~azure.mgmt.databoxedge.v2019_08_01.models.StorageAccountCredential :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.StorageAccountCredential"] @@ -263,15 +263,15 @@ def begin_create_or_update( :param resource_group_name: The resource group name. :type resource_group_name: str :param storage_account_credential: The storage account credential. - :type storage_account_credential: ~azure.mgmt.databoxedge.models.StorageAccountCredential + :type storage_account_credential: ~azure.mgmt.databoxedge.v2019_08_01.models.StorageAccountCredential :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: True for ARMPolling, False for no polling, or a - polling object for personal polling strategy + :keyword polling: Pass in True if you'd like the ARMPolling polling method, + False for no polling, or your own initialized polling object for a 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[~azure.mgmt.databoxedge.models.StorageAccountCredential] + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.databoxedge.v2019_08_01.models.StorageAccountCredential] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] @@ -387,8 +387,8 @@ def begin_delete( :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 + :keyword polling: Pass in True if you'd like the ARMPolling polling method, + False for no polling, or your own initialized polling object for a 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) diff --git a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_08_01/operations/_storage_accounts_operations.py b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_08_01/operations/_storage_accounts_operations.py index ce028adccc37..2cfe010aaaf3 100644 --- a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_08_01/operations/_storage_accounts_operations.py +++ b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_08_01/operations/_storage_accounts_operations.py @@ -32,7 +32,7 @@ class StorageAccountsOperations(object): instantiates it for you and attaches it as an attribute. :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.databoxedge.models + :type models: ~azure.mgmt.databoxedge.v2019_08_01.models :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. @@ -64,7 +64,7 @@ def list_by_data_box_edge_device( :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[~azure.mgmt.databoxedge.models.StorageAccountList] + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.databoxedge.v2019_08_01.models.StorageAccountList] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.StorageAccountList"] @@ -144,7 +144,7 @@ def get( :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: ~azure.mgmt.databoxedge.models.StorageAccount + :rtype: ~azure.mgmt.databoxedge.v2019_08_01.models.StorageAccount :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.StorageAccount"] @@ -267,15 +267,15 @@ def begin_create_or_update( :param resource_group_name: The resource group name. :type resource_group_name: str :param storage_account: The StorageAccount properties. - :type storage_account: ~azure.mgmt.databoxedge.models.StorageAccount + :type storage_account: ~azure.mgmt.databoxedge.v2019_08_01.models.StorageAccount :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: True for ARMPolling, False for no polling, or a - polling object for personal polling strategy + :keyword polling: Pass in True if you'd like the ARMPolling polling method, + False for no polling, or your own initialized polling object for a 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[~azure.mgmt.databoxedge.models.StorageAccount] + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.databoxedge.v2019_08_01.models.StorageAccount] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] @@ -391,8 +391,8 @@ def begin_delete( :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 + :keyword polling: Pass in True if you'd like the ARMPolling polling method, + False for no polling, or your own initialized polling object for a 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) diff --git a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_08_01/operations/_triggers_operations.py b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_08_01/operations/_triggers_operations.py index d7c8a87f3b7e..4c849f643f23 100644 --- a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_08_01/operations/_triggers_operations.py +++ b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_08_01/operations/_triggers_operations.py @@ -32,7 +32,7 @@ class TriggersOperations(object): instantiates it for you and attaches it as an attribute. :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.databoxedge.models + :type models: ~azure.mgmt.databoxedge.v2019_08_01.models :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. @@ -66,7 +66,7 @@ def list_by_data_box_edge_device( :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[~azure.mgmt.databoxedge.models.TriggerList] + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.databoxedge.v2019_08_01.models.TriggerList] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.TriggerList"] @@ -146,7 +146,7 @@ def get( :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: ~azure.mgmt.databoxedge.models.Trigger + :rtype: ~azure.mgmt.databoxedge.v2019_08_01.models.Trigger :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.Trigger"] @@ -267,15 +267,15 @@ def begin_create_or_update( :param resource_group_name: The resource group name. :type resource_group_name: str :param trigger: The trigger. - :type trigger: ~azure.mgmt.databoxedge.models.Trigger + :type trigger: ~azure.mgmt.databoxedge.v2019_08_01.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 + :keyword polling: Pass in True if you'd like the ARMPolling polling method, + False for no polling, or your own initialized polling object for a 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[~azure.mgmt.databoxedge.models.Trigger] + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.databoxedge.v2019_08_01.models.Trigger] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] @@ -391,8 +391,8 @@ def begin_delete( :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 + :keyword polling: Pass in True if you'd like the ARMPolling polling method, + False for no polling, or your own initialized polling object for a 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) diff --git a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_08_01/operations/_users_operations.py b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_08_01/operations/_users_operations.py index 236b9ad65340..2a8deed319aa 100644 --- a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_08_01/operations/_users_operations.py +++ b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_08_01/operations/_users_operations.py @@ -32,7 +32,7 @@ class UsersOperations(object): instantiates it for you and attaches it as an attribute. :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.databoxedge.models + :type models: ~azure.mgmt.databoxedge.v2019_08_01.models :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. @@ -65,7 +65,7 @@ def list_by_data_box_edge_device( :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[~azure.mgmt.databoxedge.models.UserList] + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.databoxedge.v2019_08_01.models.UserList] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.UserList"] @@ -145,7 +145,7 @@ def get( :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: ~azure.mgmt.databoxedge.models.User + :rtype: ~azure.mgmt.databoxedge.v2019_08_01.models.User :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.User"] @@ -267,15 +267,15 @@ def begin_create_or_update( :param resource_group_name: The resource group name. :type resource_group_name: str :param user: The user details. - :type user: ~azure.mgmt.databoxedge.models.User + :type user: ~azure.mgmt.databoxedge.v2019_08_01.models.User :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: True for ARMPolling, False for no polling, or a - polling object for personal polling strategy + :keyword polling: Pass in True if you'd like the ARMPolling polling method, + False for no polling, or your own initialized polling object for a 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[~azure.mgmt.databoxedge.models.User] + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.databoxedge.v2019_08_01.models.User] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] @@ -391,8 +391,8 @@ def begin_delete( :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 + :keyword polling: Pass in True if you'd like the ARMPolling polling method, + False for no polling, or your own initialized polling object for a 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) diff --git a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_05_01_preview/_data_box_edge_management_client.py b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_05_01_preview/_data_box_edge_management_client.py index ed174cc8de26..8cbea50f1d6a 100644 --- a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_05_01_preview/_data_box_edge_management_client.py +++ b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_05_01_preview/_data_box_edge_management_client.py @@ -16,6 +16,7 @@ from typing import Any, Optional from azure.core.credentials import TokenCredential + from azure.core.pipeline.transport import HttpRequest, HttpResponse from ._configuration import DataBoxEdgeManagementClientConfiguration from .operations import Operations @@ -42,39 +43,39 @@ class DataBoxEdgeManagementClient(object): """The DataBoxEdge Client. :ivar operations: Operations operations - :vartype operations: azure.mgmt.databoxedge.operations.Operations + :vartype operations: azure.mgmt.databoxedge.v2020_05_01_preview.operations.Operations :ivar available_skus: AvailableSkusOperations operations - :vartype available_skus: azure.mgmt.databoxedge.operations.AvailableSkusOperations + :vartype available_skus: azure.mgmt.databoxedge.v2020_05_01_preview.operations.AvailableSkusOperations :ivar devices: DevicesOperations operations - :vartype devices: azure.mgmt.databoxedge.operations.DevicesOperations + :vartype devices: azure.mgmt.databoxedge.v2020_05_01_preview.operations.DevicesOperations :ivar alerts: AlertsOperations operations - :vartype alerts: azure.mgmt.databoxedge.operations.AlertsOperations + :vartype alerts: azure.mgmt.databoxedge.v2020_05_01_preview.operations.AlertsOperations :ivar bandwidth_schedules: BandwidthSchedulesOperations operations - :vartype bandwidth_schedules: azure.mgmt.databoxedge.operations.BandwidthSchedulesOperations + :vartype bandwidth_schedules: azure.mgmt.databoxedge.v2020_05_01_preview.operations.BandwidthSchedulesOperations :ivar jobs: JobsOperations operations - :vartype jobs: azure.mgmt.databoxedge.operations.JobsOperations + :vartype jobs: azure.mgmt.databoxedge.v2020_05_01_preview.operations.JobsOperations :ivar nodes: NodesOperations operations - :vartype nodes: azure.mgmt.databoxedge.operations.NodesOperations + :vartype nodes: azure.mgmt.databoxedge.v2020_05_01_preview.operations.NodesOperations :ivar operations_status: OperationsStatusOperations operations - :vartype operations_status: azure.mgmt.databoxedge.operations.OperationsStatusOperations + :vartype operations_status: azure.mgmt.databoxedge.v2020_05_01_preview.operations.OperationsStatusOperations :ivar orders: OrdersOperations operations - :vartype orders: azure.mgmt.databoxedge.operations.OrdersOperations + :vartype orders: azure.mgmt.databoxedge.v2020_05_01_preview.operations.OrdersOperations :ivar roles: RolesOperations operations - :vartype roles: azure.mgmt.databoxedge.operations.RolesOperations + :vartype roles: azure.mgmt.databoxedge.v2020_05_01_preview.operations.RolesOperations :ivar shares: SharesOperations operations - :vartype shares: azure.mgmt.databoxedge.operations.SharesOperations + :vartype shares: azure.mgmt.databoxedge.v2020_05_01_preview.operations.SharesOperations :ivar storage_account_credentials: StorageAccountCredentialsOperations operations - :vartype storage_account_credentials: azure.mgmt.databoxedge.operations.StorageAccountCredentialsOperations + :vartype storage_account_credentials: azure.mgmt.databoxedge.v2020_05_01_preview.operations.StorageAccountCredentialsOperations :ivar storage_accounts: StorageAccountsOperations operations - :vartype storage_accounts: azure.mgmt.databoxedge.operations.StorageAccountsOperations + :vartype storage_accounts: azure.mgmt.databoxedge.v2020_05_01_preview.operations.StorageAccountsOperations :ivar containers: ContainersOperations operations - :vartype containers: azure.mgmt.databoxedge.operations.ContainersOperations + :vartype containers: azure.mgmt.databoxedge.v2020_05_01_preview.operations.ContainersOperations :ivar triggers: TriggersOperations operations - :vartype triggers: azure.mgmt.databoxedge.operations.TriggersOperations + :vartype triggers: azure.mgmt.databoxedge.v2020_05_01_preview.operations.TriggersOperations :ivar users: UsersOperations operations - :vartype users: azure.mgmt.databoxedge.operations.UsersOperations + :vartype users: azure.mgmt.databoxedge.v2020_05_01_preview.operations.UsersOperations :ivar skus: SkusOperations operations - :vartype skus: azure.mgmt.databoxedge.operations.SkusOperations + :vartype skus: azure.mgmt.databoxedge.v2020_05_01_preview.operations.SkusOperations :param credential: Credential needed for the client to connect to Azure. :type credential: ~azure.core.credentials.TokenCredential :param subscription_id: The subscription ID. @@ -136,6 +137,24 @@ def __init__( self.skus = SkusOperations( self._client, self._config, self._serialize, self._deserialize) + def _send_request(self, http_request, **kwargs): + # type: (HttpRequest, Any) -> HttpResponse + """Runs the network request through the client's chained policies. + + :param http_request: The network request you want to make. Required. + :type http_request: ~azure.core.pipeline.transport.HttpRequest + :keyword bool stream: Whether the response payload will be streamed. Defaults to True. + :return: The response of your network call. Does not do error handling on your response. + :rtype: ~azure.core.pipeline.transport.HttpResponse + """ + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + http_request.url = self._client.format_url(http_request.url, **path_format_arguments) + stream = kwargs.pop("stream", True) + pipeline_response = self._client._pipeline.run(http_request, stream=stream, **kwargs) + return pipeline_response.http_response + def close(self): # type: () -> None self._client.close() diff --git a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_05_01_preview/_metadata.json b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_05_01_preview/_metadata.json index 78a58cd7e0df..f54cc3d6befb 100644 --- a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_05_01_preview/_metadata.json +++ b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_05_01_preview/_metadata.json @@ -9,7 +9,9 @@ "custom_base_url": null, "azure_arm": true, "has_lro_operations": true, - "client_side_validation": false + "client_side_validation": false, + "sync_imports": "{\"typing\": {\"azurecore\": {\"azure.core.credentials\": [\"TokenCredential\"]}}, \"regular\": {\"azurecore\": {\"azure.profiles\": [\"KnownProfiles\", \"ProfileDefinition\"], \"azure.profiles.multiapiclient\": [\"MultiApiClientMixin\"], \"msrest\": [\"Deserializer\", \"Serializer\"], \"azure.mgmt.core\": [\"ARMPipelineClient\"]}, \"local\": {\"._configuration\": [\"DataBoxEdgeManagementClientConfiguration\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}, \"azurecore\": {\"azure.core.pipeline.transport\": [\"HttpRequest\", \"HttpResponse\"]}}}", + "async_imports": "{\"typing\": {\"azurecore\": {\"azure.core.credentials_async\": [\"AsyncTokenCredential\"]}}, \"regular\": {\"azurecore\": {\"azure.profiles\": [\"KnownProfiles\", \"ProfileDefinition\"], \"azure.profiles.multiapiclient\": [\"MultiApiClientMixin\"], \"msrest\": [\"Deserializer\", \"Serializer\"], \"azure.mgmt.core\": [\"AsyncARMPipelineClient\"]}, \"local\": {\"._configuration\": [\"DataBoxEdgeManagementClientConfiguration\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}, \"azurecore\": {\"azure.core.pipeline.transport\": [\"AsyncHttpResponse\", \"HttpRequest\"]}}}" }, "global_parameters": { "sync": { @@ -28,13 +30,13 @@ }, "async": { "credential": { - "signature": "credential, # type: \"AsyncTokenCredential\"", + "signature": "credential: \"AsyncTokenCredential\",", "description": "Credential needed for the client to connect to Azure.", "docstring_type": "~azure.core.credentials_async.AsyncTokenCredential", "required": true }, "subscription_id": { - "signature": "subscription_id, # type: str", + "signature": "subscription_id: str,", "description": "The subscription ID.", "docstring_type": "str", "required": true @@ -42,14 +44,58 @@ }, "constant": { }, - "call": "credential, subscription_id" + "call": "credential, subscription_id", + "service_client_specific": { + "sync": { + "api_version": { + "signature": "api_version=None, # type: Optional[str]", + "description": "API version to use if no profile is provided, or if missing in profile.", + "docstring_type": "str", + "required": false + }, + "base_url": { + "signature": "base_url=None, # type: Optional[str]", + "description": "Service URL", + "docstring_type": "str", + "required": false + }, + "profile": { + "signature": "profile=KnownProfiles.default, # type: KnownProfiles", + "description": "A profile definition, from KnownProfiles to dict.", + "docstring_type": "azure.profiles.KnownProfiles", + "required": false + } + }, + "async": { + "api_version": { + "signature": "api_version: Optional[str] = None,", + "description": "API version to use if no profile is provided, or if missing in profile.", + "docstring_type": "str", + "required": false + }, + "base_url": { + "signature": "base_url: Optional[str] = None,", + "description": "Service URL", + "docstring_type": "str", + "required": false + }, + "profile": { + "signature": "profile: KnownProfiles = KnownProfiles.default,", + "description": "A profile definition, from KnownProfiles to dict.", + "docstring_type": "azure.profiles.KnownProfiles", + "required": false + } + } + } }, "config": { "credential": true, "credential_scopes": ["https://management.azure.com/.default"], "credential_default_policy_type": "BearerTokenCredentialPolicy", "credential_default_policy_type_has_async_version": true, - "credential_key_header_name": null + "credential_key_header_name": null, + "sync_imports": "{\"regular\": {\"azurecore\": {\"azure.core.configuration\": [\"Configuration\"], \"azure.core.pipeline\": [\"policies\"], \"azure.mgmt.core.policies\": [\"ARMHttpLoggingPolicy\"]}, \"local\": {\"._version\": [\"VERSION\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\"]}}, \"typing\": {\"azurecore\": {\"azure.core.credentials\": [\"TokenCredential\"]}}}", + "async_imports": "{\"regular\": {\"azurecore\": {\"azure.core.configuration\": [\"Configuration\"], \"azure.core.pipeline\": [\"policies\"], \"azure.mgmt.core.policies\": [\"ARMHttpLoggingPolicy\"]}, \"local\": {\".._version\": [\"VERSION\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\"]}}, \"typing\": {\"azurecore\": {\"azure.core.credentials_async\": [\"AsyncTokenCredential\"]}}}" }, "operation_groups": { "operations": "Operations", @@ -69,9 +115,5 @@ "triggers": "TriggersOperations", "users": "UsersOperations", "skus": "SkusOperations" - }, - "operation_mixins": { - }, - "sync_imports": "None", - "async_imports": "None" + } } \ No newline at end of file diff --git a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_05_01_preview/aio/_data_box_edge_management_client.py b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_05_01_preview/aio/_data_box_edge_management_client.py index a0a9282d9536..a7fbbc2ca877 100644 --- a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_05_01_preview/aio/_data_box_edge_management_client.py +++ b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_05_01_preview/aio/_data_box_edge_management_client.py @@ -8,6 +8,7 @@ from typing import Any, Optional, TYPE_CHECKING +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core import AsyncARMPipelineClient from msrest import Deserializer, Serializer @@ -40,39 +41,39 @@ class DataBoxEdgeManagementClient(object): """The DataBoxEdge Client. :ivar operations: Operations operations - :vartype operations: azure.mgmt.databoxedge.aio.operations.Operations + :vartype operations: azure.mgmt.databoxedge.v2020_05_01_preview.aio.operations.Operations :ivar available_skus: AvailableSkusOperations operations - :vartype available_skus: azure.mgmt.databoxedge.aio.operations.AvailableSkusOperations + :vartype available_skus: azure.mgmt.databoxedge.v2020_05_01_preview.aio.operations.AvailableSkusOperations :ivar devices: DevicesOperations operations - :vartype devices: azure.mgmt.databoxedge.aio.operations.DevicesOperations + :vartype devices: azure.mgmt.databoxedge.v2020_05_01_preview.aio.operations.DevicesOperations :ivar alerts: AlertsOperations operations - :vartype alerts: azure.mgmt.databoxedge.aio.operations.AlertsOperations + :vartype alerts: azure.mgmt.databoxedge.v2020_05_01_preview.aio.operations.AlertsOperations :ivar bandwidth_schedules: BandwidthSchedulesOperations operations - :vartype bandwidth_schedules: azure.mgmt.databoxedge.aio.operations.BandwidthSchedulesOperations + :vartype bandwidth_schedules: azure.mgmt.databoxedge.v2020_05_01_preview.aio.operations.BandwidthSchedulesOperations :ivar jobs: JobsOperations operations - :vartype jobs: azure.mgmt.databoxedge.aio.operations.JobsOperations + :vartype jobs: azure.mgmt.databoxedge.v2020_05_01_preview.aio.operations.JobsOperations :ivar nodes: NodesOperations operations - :vartype nodes: azure.mgmt.databoxedge.aio.operations.NodesOperations + :vartype nodes: azure.mgmt.databoxedge.v2020_05_01_preview.aio.operations.NodesOperations :ivar operations_status: OperationsStatusOperations operations - :vartype operations_status: azure.mgmt.databoxedge.aio.operations.OperationsStatusOperations + :vartype operations_status: azure.mgmt.databoxedge.v2020_05_01_preview.aio.operations.OperationsStatusOperations :ivar orders: OrdersOperations operations - :vartype orders: azure.mgmt.databoxedge.aio.operations.OrdersOperations + :vartype orders: azure.mgmt.databoxedge.v2020_05_01_preview.aio.operations.OrdersOperations :ivar roles: RolesOperations operations - :vartype roles: azure.mgmt.databoxedge.aio.operations.RolesOperations + :vartype roles: azure.mgmt.databoxedge.v2020_05_01_preview.aio.operations.RolesOperations :ivar shares: SharesOperations operations - :vartype shares: azure.mgmt.databoxedge.aio.operations.SharesOperations + :vartype shares: azure.mgmt.databoxedge.v2020_05_01_preview.aio.operations.SharesOperations :ivar storage_account_credentials: StorageAccountCredentialsOperations operations - :vartype storage_account_credentials: azure.mgmt.databoxedge.aio.operations.StorageAccountCredentialsOperations + :vartype storage_account_credentials: azure.mgmt.databoxedge.v2020_05_01_preview.aio.operations.StorageAccountCredentialsOperations :ivar storage_accounts: StorageAccountsOperations operations - :vartype storage_accounts: azure.mgmt.databoxedge.aio.operations.StorageAccountsOperations + :vartype storage_accounts: azure.mgmt.databoxedge.v2020_05_01_preview.aio.operations.StorageAccountsOperations :ivar containers: ContainersOperations operations - :vartype containers: azure.mgmt.databoxedge.aio.operations.ContainersOperations + :vartype containers: azure.mgmt.databoxedge.v2020_05_01_preview.aio.operations.ContainersOperations :ivar triggers: TriggersOperations operations - :vartype triggers: azure.mgmt.databoxedge.aio.operations.TriggersOperations + :vartype triggers: azure.mgmt.databoxedge.v2020_05_01_preview.aio.operations.TriggersOperations :ivar users: UsersOperations operations - :vartype users: azure.mgmt.databoxedge.aio.operations.UsersOperations + :vartype users: azure.mgmt.databoxedge.v2020_05_01_preview.aio.operations.UsersOperations :ivar skus: SkusOperations operations - :vartype skus: azure.mgmt.databoxedge.aio.operations.SkusOperations + :vartype skus: azure.mgmt.databoxedge.v2020_05_01_preview.aio.operations.SkusOperations :param credential: Credential needed for the client to connect to Azure. :type credential: ~azure.core.credentials_async.AsyncTokenCredential :param subscription_id: The subscription ID. @@ -133,6 +134,23 @@ def __init__( self.skus = SkusOperations( self._client, self._config, self._serialize, self._deserialize) + async def _send_request(self, http_request: HttpRequest, **kwargs: Any) -> AsyncHttpResponse: + """Runs the network request through the client's chained policies. + + :param http_request: The network request you want to make. Required. + :type http_request: ~azure.core.pipeline.transport.HttpRequest + :keyword bool stream: Whether the response payload will be streamed. Defaults to True. + :return: The response of your network call. Does not do error handling on your response. + :rtype: ~azure.core.pipeline.transport.AsyncHttpResponse + """ + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + http_request.url = self._client.format_url(http_request.url, **path_format_arguments) + stream = kwargs.pop("stream", True) + pipeline_response = await self._client._pipeline.run(http_request, stream=stream, **kwargs) + return pipeline_response.http_response + async def close(self) -> None: await self._client.close() diff --git a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_05_01_preview/aio/operations/_alerts_operations.py b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_05_01_preview/aio/operations/_alerts_operations.py index 9ce6289b20b8..9cc9132e3f68 100644 --- a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_05_01_preview/aio/operations/_alerts_operations.py +++ b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_05_01_preview/aio/operations/_alerts_operations.py @@ -26,7 +26,7 @@ class AlertsOperations: instantiates it for you and attaches it as an attribute. :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.databoxedge.models + :type models: ~azure.mgmt.databoxedge.v2020_05_01_preview.models :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. @@ -55,7 +55,7 @@ def list_by_data_box_edge_device( :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[~azure.mgmt.databoxedge.models.AlertList] + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.databoxedge.v2020_05_01_preview.models.AlertList] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.AlertList"] @@ -134,7 +134,7 @@ async def get( :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: ~azure.mgmt.databoxedge.models.Alert + :rtype: ~azure.mgmt.databoxedge.v2020_05_01_preview.models.Alert :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.Alert"] diff --git a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_05_01_preview/aio/operations/_available_skus_operations.py b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_05_01_preview/aio/operations/_available_skus_operations.py index 908f90800999..3c1e56b6a241 100644 --- a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_05_01_preview/aio/operations/_available_skus_operations.py +++ b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_05_01_preview/aio/operations/_available_skus_operations.py @@ -26,7 +26,7 @@ class AvailableSkusOperations: instantiates it for you and attaches it as an attribute. :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.databoxedge.models + :type models: ~azure.mgmt.databoxedge.v2020_05_01_preview.models :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. @@ -51,7 +51,7 @@ def list( :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either DataBoxEdgeSkuList or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.databoxedge.models.DataBoxEdgeSkuList] + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.databoxedge.v2020_05_01_preview.models.DataBoxEdgeSkuList] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.DataBoxEdgeSkuList"] diff --git a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_05_01_preview/aio/operations/_bandwidth_schedules_operations.py b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_05_01_preview/aio/operations/_bandwidth_schedules_operations.py index 679879260508..462909541584 100644 --- a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_05_01_preview/aio/operations/_bandwidth_schedules_operations.py +++ b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_05_01_preview/aio/operations/_bandwidth_schedules_operations.py @@ -28,7 +28,7 @@ class BandwidthSchedulesOperations: instantiates it for you and attaches it as an attribute. :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.databoxedge.models + :type models: ~azure.mgmt.databoxedge.v2020_05_01_preview.models :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. @@ -57,7 +57,7 @@ def list_by_data_box_edge_device( :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[~azure.mgmt.databoxedge.models.BandwidthSchedulesList] + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.databoxedge.v2020_05_01_preview.models.BandwidthSchedulesList] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.BandwidthSchedulesList"] @@ -134,7 +134,7 @@ async def get( :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: ~azure.mgmt.databoxedge.models.BandwidthSchedule + :rtype: ~azure.mgmt.databoxedge.v2020_05_01_preview.models.BandwidthSchedule :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.BandwidthSchedule"] @@ -253,15 +253,15 @@ async def begin_create_or_update( :param resource_group_name: The resource group name. :type resource_group_name: str :param parameters: The bandwidth schedule to be added or updated. - :type parameters: ~azure.mgmt.databoxedge.models.BandwidthSchedule + :type parameters: ~azure.mgmt.databoxedge.v2020_05_01_preview.models.BandwidthSchedule :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: True for ARMPolling, False for no polling, or a - polling object for personal polling strategy + :keyword polling: Pass in True if you'd like the AsyncARMPolling polling method, + False for no polling, or your own initialized polling object for a 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[~azure.mgmt.databoxedge.models.BandwidthSchedule] + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.databoxedge.v2020_05_01_preview.models.BandwidthSchedule] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -375,8 +375,8 @@ async def begin_delete( :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 + :keyword polling: Pass in True if you'd like the AsyncARMPolling polling method, + False for no polling, or your own initialized polling object for a 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) diff --git a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_05_01_preview/aio/operations/_containers_operations.py b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_05_01_preview/aio/operations/_containers_operations.py index e0c38d925871..5db7070e2ddc 100644 --- a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_05_01_preview/aio/operations/_containers_operations.py +++ b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_05_01_preview/aio/operations/_containers_operations.py @@ -28,7 +28,7 @@ class ContainersOperations: instantiates it for you and attaches it as an attribute. :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.databoxedge.models + :type models: ~azure.mgmt.databoxedge.v2020_05_01_preview.models :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. @@ -62,7 +62,7 @@ def list_by_storage_account( :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[~azure.mgmt.databoxedge.models.ContainerList] + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.databoxedge.v2020_05_01_preview.models.ContainerList] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.ContainerList"] @@ -145,7 +145,7 @@ async def get( :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: ~azure.mgmt.databoxedge.models.Container + :rtype: ~azure.mgmt.databoxedge.v2020_05_01_preview.models.Container :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.Container"] @@ -272,15 +272,15 @@ async def begin_create_or_update( :param resource_group_name: The resource group name. :type resource_group_name: str :param container: The container properties. - :type container: ~azure.mgmt.databoxedge.models.Container + :type container: ~azure.mgmt.databoxedge.v2020_05_01_preview.models.Container :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: True for ARMPolling, False for no polling, or a - polling object for personal polling strategy + :keyword polling: Pass in True if you'd like the AsyncARMPolling polling method, + False for no polling, or your own initialized polling object for a 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[~azure.mgmt.databoxedge.models.Container] + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.databoxedge.v2020_05_01_preview.models.Container] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -401,8 +401,8 @@ async def begin_delete( :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 + :keyword polling: Pass in True if you'd like the AsyncARMPolling polling method, + False for no polling, or your own initialized polling object for a 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) @@ -525,8 +525,8 @@ async def begin_refresh( :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 + :keyword polling: Pass in True if you'd like the AsyncARMPolling polling method, + False for no polling, or your own initialized polling object for a 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) diff --git a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_05_01_preview/aio/operations/_devices_operations.py b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_05_01_preview/aio/operations/_devices_operations.py index b0c616048983..0d9c4106ed4f 100644 --- a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_05_01_preview/aio/operations/_devices_operations.py +++ b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_05_01_preview/aio/operations/_devices_operations.py @@ -28,7 +28,7 @@ class DevicesOperations: instantiates it for you and attaches it as an attribute. :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.databoxedge.models + :type models: ~azure.mgmt.databoxedge.v2020_05_01_preview.models :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. @@ -55,7 +55,7 @@ def list_by_subscription( :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[~azure.mgmt.databoxedge.models.DataBoxEdgeDeviceList] + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.databoxedge.v2020_05_01_preview.models.DataBoxEdgeDeviceList] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.DataBoxEdgeDeviceList"] @@ -130,7 +130,7 @@ def list_by_resource_group( :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[~azure.mgmt.databoxedge.models.DataBoxEdgeDeviceList] + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.databoxedge.v2020_05_01_preview.models.DataBoxEdgeDeviceList] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.DataBoxEdgeDeviceList"] @@ -205,7 +205,7 @@ async def get( :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: ~azure.mgmt.databoxedge.models.DataBoxEdgeDevice + :rtype: ~azure.mgmt.databoxedge.v2020_05_01_preview.models.DataBoxEdgeDevice :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.DataBoxEdgeDevice"] @@ -316,15 +316,15 @@ async def begin_create_or_update( :param resource_group_name: The resource group name. :type resource_group_name: str :param data_box_edge_device: The resource object. - :type data_box_edge_device: ~azure.mgmt.databoxedge.models.DataBoxEdgeDevice + :type data_box_edge_device: ~azure.mgmt.databoxedge.v2020_05_01_preview.models.DataBoxEdgeDevice :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 + :keyword polling: Pass in True if you'd like the AsyncARMPolling polling method, + False for no polling, or your own initialized polling object for a 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[~azure.mgmt.databoxedge.models.DataBoxEdgeDevice] + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.databoxedge.v2020_05_01_preview.models.DataBoxEdgeDevice] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -431,8 +431,8 @@ async def begin_delete( :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 + :keyword polling: Pass in True if you'd like the AsyncARMPolling polling method, + False for no polling, or your own initialized polling object for a 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) @@ -495,10 +495,10 @@ async def update( :param resource_group_name: The resource group name. :type resource_group_name: str :param parameters: The resource parameters. - :type parameters: ~azure.mgmt.databoxedge.models.DataBoxEdgeDevicePatch + :type parameters: ~azure.mgmt.databoxedge.v2020_05_01_preview.models.DataBoxEdgeDevicePatch :keyword callable cls: A custom type or function that will be passed the direct response :return: DataBoxEdgeDevice, or the result of cls(response) - :rtype: ~azure.mgmt.databoxedge.models.DataBoxEdgeDevice + :rtype: ~azure.mgmt.databoxedge.v2020_05_01_preview.models.DataBoxEdgeDevice :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.DataBoxEdgeDevice"] @@ -607,8 +607,8 @@ async def begin_download_updates( :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 + :keyword polling: Pass in True if you'd like the AsyncARMPolling polling method, + False for no polling, or your own initialized polling object for a 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) @@ -671,7 +671,7 @@ async def get_extended_information( :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: ~azure.mgmt.databoxedge.models.DataBoxEdgeDeviceExtendedInfo + :rtype: ~azure.mgmt.databoxedge.v2020_05_01_preview.models.DataBoxEdgeDeviceExtendedInfo :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.DataBoxEdgeDeviceExtendedInfo"] @@ -775,8 +775,8 @@ async def begin_install_updates( :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 + :keyword polling: Pass in True if you'd like the AsyncARMPolling polling method, + False for no polling, or your own initialized polling object for a 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) @@ -839,7 +839,7 @@ async def get_network_settings( :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: ~azure.mgmt.databoxedge.models.NetworkSettings + :rtype: ~azure.mgmt.databoxedge.v2020_05_01_preview.models.NetworkSettings :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkSettings"] @@ -943,8 +943,8 @@ async def begin_scan_for_updates( :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 + :keyword polling: Pass in True if you'd like the AsyncARMPolling polling method, + False for no polling, or your own initialized polling object for a 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) @@ -1057,11 +1057,11 @@ async def begin_create_or_update_security_settings( :param resource_group_name: The resource group name. :type resource_group_name: str :param security_settings: The security settings. - :type security_settings: ~azure.mgmt.databoxedge.models.SecuritySettings + :type security_settings: ~azure.mgmt.databoxedge.v2020_05_01_preview.models.SecuritySettings :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: True for ARMPolling, False for no polling, or a - polling object for personal polling strategy + :keyword polling: Pass in True if you'd like the AsyncARMPolling polling method, + False for no polling, or your own initialized polling object for a 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) @@ -1128,7 +1128,7 @@ async def get_update_summary( :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: ~azure.mgmt.databoxedge.models.UpdateSummary + :rtype: ~azure.mgmt.databoxedge.v2020_05_01_preview.models.UpdateSummary :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.UpdateSummary"] @@ -1186,10 +1186,10 @@ async def upload_certificate( :param resource_group_name: The resource group name. :type resource_group_name: str :param parameters: The upload certificate request. - :type parameters: ~azure.mgmt.databoxedge.models.UploadCertificateRequest + :type parameters: ~azure.mgmt.databoxedge.v2020_05_01_preview.models.UploadCertificateRequest :keyword callable cls: A custom type or function that will be passed the direct response :return: UploadCertificateResponse, or the result of cls(response) - :rtype: ~azure.mgmt.databoxedge.models.UploadCertificateResponse + :rtype: ~azure.mgmt.databoxedge.v2020_05_01_preview.models.UploadCertificateResponse :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.UploadCertificateResponse"] diff --git a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_05_01_preview/aio/operations/_jobs_operations.py b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_05_01_preview/aio/operations/_jobs_operations.py index 1ddab926656c..3a746f7e258a 100644 --- a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_05_01_preview/aio/operations/_jobs_operations.py +++ b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_05_01_preview/aio/operations/_jobs_operations.py @@ -25,7 +25,7 @@ class JobsOperations: instantiates it for you and attaches it as an attribute. :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.databoxedge.models + :type models: ~azure.mgmt.databoxedge.v2020_05_01_preview.models :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. @@ -59,7 +59,7 @@ async def get( :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: ~azure.mgmt.databoxedge.models.Job + :rtype: ~azure.mgmt.databoxedge.v2020_05_01_preview.models.Job :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.Job"] diff --git a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_05_01_preview/aio/operations/_nodes_operations.py b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_05_01_preview/aio/operations/_nodes_operations.py index e361c28b3481..7a91dc86646b 100644 --- a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_05_01_preview/aio/operations/_nodes_operations.py +++ b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_05_01_preview/aio/operations/_nodes_operations.py @@ -26,7 +26,7 @@ class NodesOperations: instantiates it for you and attaches it as an attribute. :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.databoxedge.models + :type models: ~azure.mgmt.databoxedge.v2020_05_01_preview.models :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. @@ -55,7 +55,7 @@ def list_by_data_box_edge_device( :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[~azure.mgmt.databoxedge.models.NodeList] + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.databoxedge.v2020_05_01_preview.models.NodeList] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.NodeList"] diff --git a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_05_01_preview/aio/operations/_operations.py b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_05_01_preview/aio/operations/_operations.py index 9cdd8c25b357..93b421dea3fc 100644 --- a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_05_01_preview/aio/operations/_operations.py +++ b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_05_01_preview/aio/operations/_operations.py @@ -26,7 +26,7 @@ class Operations: instantiates it for you and attaches it as an attribute. :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.databoxedge.models + :type models: ~azure.mgmt.databoxedge.v2020_05_01_preview.models :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. @@ -51,7 +51,7 @@ def list( :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[~azure.mgmt.databoxedge.models.OperationsList] + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.databoxedge.v2020_05_01_preview.models.OperationsList] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationsList"] diff --git a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_05_01_preview/aio/operations/_operations_status_operations.py b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_05_01_preview/aio/operations/_operations_status_operations.py index d7f50b83b926..9057292e9c95 100644 --- a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_05_01_preview/aio/operations/_operations_status_operations.py +++ b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_05_01_preview/aio/operations/_operations_status_operations.py @@ -25,7 +25,7 @@ class OperationsStatusOperations: instantiates it for you and attaches it as an attribute. :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.databoxedge.models + :type models: ~azure.mgmt.databoxedge.v2020_05_01_preview.models :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. @@ -59,7 +59,7 @@ async def get( :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: ~azure.mgmt.databoxedge.models.Job + :rtype: ~azure.mgmt.databoxedge.v2020_05_01_preview.models.Job :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.Job"] diff --git a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_05_01_preview/aio/operations/_orders_operations.py b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_05_01_preview/aio/operations/_orders_operations.py index faf13df4fad4..565453e7585c 100644 --- a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_05_01_preview/aio/operations/_orders_operations.py +++ b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_05_01_preview/aio/operations/_orders_operations.py @@ -28,7 +28,7 @@ class OrdersOperations: instantiates it for you and attaches it as an attribute. :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.databoxedge.models + :type models: ~azure.mgmt.databoxedge.v2020_05_01_preview.models :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. @@ -59,7 +59,7 @@ def list_by_data_box_edge_device( :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[~azure.mgmt.databoxedge.models.OrderList] + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.databoxedge.v2020_05_01_preview.models.OrderList] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.OrderList"] @@ -135,7 +135,7 @@ async def get( :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: ~azure.mgmt.databoxedge.models.Order + :rtype: ~azure.mgmt.databoxedge.v2020_05_01_preview.models.Order :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.Order"] @@ -250,15 +250,15 @@ async def begin_create_or_update( :param resource_group_name: The resource group name. :type resource_group_name: str :param order: The order to be created or updated. - :type order: ~azure.mgmt.databoxedge.models.Order + :type order: ~azure.mgmt.databoxedge.v2020_05_01_preview.models.Order :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: True for ARMPolling, False for no polling, or a - polling object for personal polling strategy + :keyword polling: Pass in True if you'd like the AsyncARMPolling polling method, + False for no polling, or your own initialized polling object for a 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[~azure.mgmt.databoxedge.models.Order] + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.databoxedge.v2020_05_01_preview.models.Order] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -367,8 +367,8 @@ async def begin_delete( :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 + :keyword polling: Pass in True if you'd like the AsyncARMPolling polling method, + False for no polling, or your own initialized polling object for a 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) diff --git a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_05_01_preview/aio/operations/_roles_operations.py b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_05_01_preview/aio/operations/_roles_operations.py index a608e58c77a1..adc1ae3c4fb4 100644 --- a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_05_01_preview/aio/operations/_roles_operations.py +++ b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_05_01_preview/aio/operations/_roles_operations.py @@ -28,7 +28,7 @@ class RolesOperations: instantiates it for you and attaches it as an attribute. :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.databoxedge.models + :type models: ~azure.mgmt.databoxedge.v2020_05_01_preview.models :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. @@ -57,7 +57,7 @@ def list_by_data_box_edge_device( :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[~azure.mgmt.databoxedge.models.RoleList] + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.databoxedge.v2020_05_01_preview.models.RoleList] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.RoleList"] @@ -134,7 +134,7 @@ async def get( :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: ~azure.mgmt.databoxedge.models.Role + :rtype: ~azure.mgmt.databoxedge.v2020_05_01_preview.models.Role :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.Role"] @@ -253,15 +253,15 @@ async def begin_create_or_update( :param resource_group_name: The resource group name. :type resource_group_name: str :param role: The role properties. - :type role: ~azure.mgmt.databoxedge.models.Role + :type role: ~azure.mgmt.databoxedge.v2020_05_01_preview.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 + :keyword polling: Pass in True if you'd like the AsyncARMPolling polling method, + False for no polling, or your own initialized polling object for a 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[~azure.mgmt.databoxedge.models.Role] + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.databoxedge.v2020_05_01_preview.models.Role] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -375,8 +375,8 @@ async def begin_delete( :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 + :keyword polling: Pass in True if you'd like the AsyncARMPolling polling method, + False for no polling, or your own initialized polling object for a 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) diff --git a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_05_01_preview/aio/operations/_shares_operations.py b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_05_01_preview/aio/operations/_shares_operations.py index bcc51b2cb05c..1771708a1408 100644 --- a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_05_01_preview/aio/operations/_shares_operations.py +++ b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_05_01_preview/aio/operations/_shares_operations.py @@ -28,7 +28,7 @@ class SharesOperations: instantiates it for you and attaches it as an attribute. :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.databoxedge.models + :type models: ~azure.mgmt.databoxedge.v2020_05_01_preview.models :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. @@ -59,7 +59,7 @@ def list_by_data_box_edge_device( :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[~azure.mgmt.databoxedge.models.ShareList] + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.databoxedge.v2020_05_01_preview.models.ShareList] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.ShareList"] @@ -138,7 +138,7 @@ async def get( :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: ~azure.mgmt.databoxedge.models.Share + :rtype: ~azure.mgmt.databoxedge.v2020_05_01_preview.models.Share :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.Share"] @@ -259,15 +259,15 @@ async def begin_create_or_update( :param resource_group_name: The resource group name. :type resource_group_name: str :param share: The share properties. - :type share: ~azure.mgmt.databoxedge.models.Share + :type share: ~azure.mgmt.databoxedge.v2020_05_01_preview.models.Share :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: True for ARMPolling, False for no polling, or a - polling object for personal polling strategy + :keyword polling: Pass in True if you'd like the AsyncARMPolling polling method, + False for no polling, or your own initialized polling object for a 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[~azure.mgmt.databoxedge.models.Share] + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.databoxedge.v2020_05_01_preview.models.Share] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -381,8 +381,8 @@ async def begin_delete( :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 + :keyword polling: Pass in True if you'd like the AsyncARMPolling polling method, + False for no polling, or your own initialized polling object for a 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) @@ -498,8 +498,8 @@ async def begin_refresh( :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 + :keyword polling: Pass in True if you'd like the AsyncARMPolling polling method, + False for no polling, or your own initialized polling object for a 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) diff --git a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_05_01_preview/aio/operations/_skus_operations.py b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_05_01_preview/aio/operations/_skus_operations.py index 74f5281bc08c..228a2c7841be 100644 --- a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_05_01_preview/aio/operations/_skus_operations.py +++ b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_05_01_preview/aio/operations/_skus_operations.py @@ -26,7 +26,7 @@ class SkusOperations: instantiates it for you and attaches it as an attribute. :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.databoxedge.models + :type models: ~azure.mgmt.databoxedge.v2020_05_01_preview.models :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. @@ -54,7 +54,7 @@ def list( :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[~azure.mgmt.databoxedge.models.SkuInformationList] + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.databoxedge.v2020_05_01_preview.models.SkuInformationList] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.SkuInformationList"] diff --git a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_05_01_preview/aio/operations/_storage_account_credentials_operations.py b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_05_01_preview/aio/operations/_storage_account_credentials_operations.py index 510dcec232bf..02f5294dfcc7 100644 --- a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_05_01_preview/aio/operations/_storage_account_credentials_operations.py +++ b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_05_01_preview/aio/operations/_storage_account_credentials_operations.py @@ -28,7 +28,7 @@ class StorageAccountCredentialsOperations: instantiates it for you and attaches it as an attribute. :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.databoxedge.models + :type models: ~azure.mgmt.databoxedge.v2020_05_01_preview.models :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. @@ -59,7 +59,7 @@ def list_by_data_box_edge_device( :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[~azure.mgmt.databoxedge.models.StorageAccountCredentialList] + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.databoxedge.v2020_05_01_preview.models.StorageAccountCredentialList] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.StorageAccountCredentialList"] @@ -136,7 +136,7 @@ async def get( :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: ~azure.mgmt.databoxedge.models.StorageAccountCredential + :rtype: ~azure.mgmt.databoxedge.v2020_05_01_preview.models.StorageAccountCredential :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.StorageAccountCredential"] @@ -255,15 +255,15 @@ async def begin_create_or_update( :param resource_group_name: The resource group name. :type resource_group_name: str :param storage_account_credential: The storage account credential. - :type storage_account_credential: ~azure.mgmt.databoxedge.models.StorageAccountCredential + :type storage_account_credential: ~azure.mgmt.databoxedge.v2020_05_01_preview.models.StorageAccountCredential :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: True for ARMPolling, False for no polling, or a - polling object for personal polling strategy + :keyword polling: Pass in True if you'd like the AsyncARMPolling polling method, + False for no polling, or your own initialized polling object for a 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[~azure.mgmt.databoxedge.models.StorageAccountCredential] + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.databoxedge.v2020_05_01_preview.models.StorageAccountCredential] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -377,8 +377,8 @@ async def begin_delete( :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 + :keyword polling: Pass in True if you'd like the AsyncARMPolling polling method, + False for no polling, or your own initialized polling object for a 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) diff --git a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_05_01_preview/aio/operations/_storage_accounts_operations.py b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_05_01_preview/aio/operations/_storage_accounts_operations.py index 4a0f89b67ebc..86a4c0757ba9 100644 --- a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_05_01_preview/aio/operations/_storage_accounts_operations.py +++ b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_05_01_preview/aio/operations/_storage_accounts_operations.py @@ -28,7 +28,7 @@ class StorageAccountsOperations: instantiates it for you and attaches it as an attribute. :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.databoxedge.models + :type models: ~azure.mgmt.databoxedge.v2020_05_01_preview.models :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. @@ -59,7 +59,7 @@ def list_by_data_box_edge_device( :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[~azure.mgmt.databoxedge.models.StorageAccountList] + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.databoxedge.v2020_05_01_preview.models.StorageAccountList] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.StorageAccountList"] @@ -138,7 +138,7 @@ async def get( :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: ~azure.mgmt.databoxedge.models.StorageAccount + :rtype: ~azure.mgmt.databoxedge.v2020_05_01_preview.models.StorageAccount :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.StorageAccount"] @@ -259,15 +259,15 @@ async def begin_create_or_update( :param resource_group_name: The resource group name. :type resource_group_name: str :param storage_account: The StorageAccount properties. - :type storage_account: ~azure.mgmt.databoxedge.models.StorageAccount + :type storage_account: ~azure.mgmt.databoxedge.v2020_05_01_preview.models.StorageAccount :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: True for ARMPolling, False for no polling, or a - polling object for personal polling strategy + :keyword polling: Pass in True if you'd like the AsyncARMPolling polling method, + False for no polling, or your own initialized polling object for a 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[~azure.mgmt.databoxedge.models.StorageAccount] + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.databoxedge.v2020_05_01_preview.models.StorageAccount] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -381,8 +381,8 @@ async def begin_delete( :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 + :keyword polling: Pass in True if you'd like the AsyncARMPolling polling method, + False for no polling, or your own initialized polling object for a 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) diff --git a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_05_01_preview/aio/operations/_triggers_operations.py b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_05_01_preview/aio/operations/_triggers_operations.py index fc7df42fe906..def269de6448 100644 --- a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_05_01_preview/aio/operations/_triggers_operations.py +++ b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_05_01_preview/aio/operations/_triggers_operations.py @@ -28,7 +28,7 @@ class TriggersOperations: instantiates it for you and attaches it as an attribute. :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.databoxedge.models + :type models: ~azure.mgmt.databoxedge.v2020_05_01_preview.models :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. @@ -61,7 +61,7 @@ def list_by_data_box_edge_device( :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[~azure.mgmt.databoxedge.models.TriggerList] + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.databoxedge.v2020_05_01_preview.models.TriggerList] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.TriggerList"] @@ -140,7 +140,7 @@ async def get( :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: ~azure.mgmt.databoxedge.models.Trigger + :rtype: ~azure.mgmt.databoxedge.v2020_05_01_preview.models.Trigger :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.Trigger"] @@ -259,15 +259,15 @@ async def begin_create_or_update( :param resource_group_name: The resource group name. :type resource_group_name: str :param trigger: The trigger. - :type trigger: ~azure.mgmt.databoxedge.models.Trigger + :type trigger: ~azure.mgmt.databoxedge.v2020_05_01_preview.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 + :keyword polling: Pass in True if you'd like the AsyncARMPolling polling method, + False for no polling, or your own initialized polling object for a 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[~azure.mgmt.databoxedge.models.Trigger] + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.databoxedge.v2020_05_01_preview.models.Trigger] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -381,8 +381,8 @@ async def begin_delete( :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 + :keyword polling: Pass in True if you'd like the AsyncARMPolling polling method, + False for no polling, or your own initialized polling object for a 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) diff --git a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_05_01_preview/aio/operations/_users_operations.py b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_05_01_preview/aio/operations/_users_operations.py index 105c4d12808a..b839c9783245 100644 --- a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_05_01_preview/aio/operations/_users_operations.py +++ b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_05_01_preview/aio/operations/_users_operations.py @@ -28,7 +28,7 @@ class UsersOperations: instantiates it for you and attaches it as an attribute. :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.databoxedge.models + :type models: ~azure.mgmt.databoxedge.v2020_05_01_preview.models :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. @@ -60,7 +60,7 @@ def list_by_data_box_edge_device( :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[~azure.mgmt.databoxedge.models.UserList] + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.databoxedge.v2020_05_01_preview.models.UserList] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.UserList"] @@ -139,7 +139,7 @@ async def get( :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: ~azure.mgmt.databoxedge.models.User + :rtype: ~azure.mgmt.databoxedge.v2020_05_01_preview.models.User :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.User"] @@ -259,15 +259,15 @@ async def begin_create_or_update( :param resource_group_name: The resource group name. :type resource_group_name: str :param user: The user details. - :type user: ~azure.mgmt.databoxedge.models.User + :type user: ~azure.mgmt.databoxedge.v2020_05_01_preview.models.User :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: True for ARMPolling, False for no polling, or a - polling object for personal polling strategy + :keyword polling: Pass in True if you'd like the AsyncARMPolling polling method, + False for no polling, or your own initialized polling object for a 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[~azure.mgmt.databoxedge.models.User] + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.databoxedge.v2020_05_01_preview.models.User] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -381,8 +381,8 @@ async def begin_delete( :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 + :keyword polling: Pass in True if you'd like the AsyncARMPolling polling method, + False for no polling, or your own initialized polling object for a 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) diff --git a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_05_01_preview/models/_models.py b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_05_01_preview/models/_models.py index 8653db38cb52..030d1bdf21d8 100644 --- a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_05_01_preview/models/_models.py +++ b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_05_01_preview/models/_models.py @@ -118,9 +118,9 @@ class Alert(ARMBaseModel): :vartype recommendation: str :ivar severity: Severity of the alert. Possible values include: "Informational", "Warning", "Critical". - :vartype severity: str or ~azure.mgmt.databoxedge.models.AlertSeverity + :vartype severity: str or ~azure.mgmt.databoxedge.v2020_05_01_preview.models.AlertSeverity :ivar error_details: Error details of the alert. - :vartype error_details: ~azure.mgmt.databoxedge.models.AlertErrorDetails + :vartype error_details: ~azure.mgmt.databoxedge.v2020_05_01_preview.models.AlertErrorDetails :ivar detailed_information: Alert details. :vartype detailed_information: dict[str, str] """ @@ -206,7 +206,7 @@ class AlertList(msrest.serialization.Model): Variables are only populated by the server, and will be ignored when sending a request. :ivar value: The value. - :vartype value: list[~azure.mgmt.databoxedge.models.Alert] + :vartype value: list[~azure.mgmt.databoxedge.v2020_05_01_preview.models.Alert] :ivar next_link: Link to the next set of results. :vartype next_link: str """ @@ -242,7 +242,8 @@ class AsymmetricEncryptedSecret(msrest.serialization.Model): :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 ~azure.mgmt.databoxedge.models.EncryptionAlgorithm + :type encryption_algorithm: str or + ~azure.mgmt.databoxedge.v2020_05_01_preview.models.EncryptionAlgorithm """ _validation = { @@ -270,7 +271,7 @@ class Authentication(msrest.serialization.Model): """Authentication mechanism for IoT devices. :param symmetric_key: Symmetric key for authentication. - :type symmetric_key: ~azure.mgmt.databoxedge.models.SymmetricKey + :type symmetric_key: ~azure.mgmt.databoxedge.v2020_05_01_preview.models.SymmetricKey """ _attribute_map = { @@ -298,7 +299,8 @@ class AzureContainerInfo(msrest.serialization.Model): :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 ~azure.mgmt.databoxedge.models.AzureContainerDataFormat + :type data_format: str or + ~azure.mgmt.databoxedge.v2020_05_01_preview.models.AzureContainerDataFormat """ _validation = { @@ -343,7 +345,7 @@ class BandwidthSchedule(ARMBaseModel): :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 ~azure.mgmt.databoxedge.models.DayOfWeek] + :type days: list[str or ~azure.mgmt.databoxedge.v2020_05_01_preview.models.DayOfWeek] """ _validation = { @@ -383,7 +385,7 @@ class BandwidthSchedulesList(msrest.serialization.Model): 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[~azure.mgmt.databoxedge.models.BandwidthSchedule] + :vartype value: list[~azure.mgmt.databoxedge.v2020_05_01_preview.models.BandwidthSchedule] :ivar next_link: Link to the next set of results. :vartype next_link: str """ @@ -416,7 +418,8 @@ class ClientAccessRight(msrest.serialization.Model): :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 ~azure.mgmt.databoxedge.models.ClientPermissionType + :type access_permission: str or + ~azure.mgmt.databoxedge.v2020_05_01_preview.models.ClientPermissionType """ _validation = { @@ -448,7 +451,7 @@ class CloudErrorBody(msrest.serialization.Model): interface. :type message: str :param details: A list of additional details about the error. - :type details: list[~azure.mgmt.databoxedge.models.CloudErrorBody] + :type details: list[~azure.mgmt.databoxedge.v2020_05_01_preview.models.CloudErrorBody] """ _attribute_map = { @@ -522,12 +525,14 @@ class Container(ARMBaseModel): :vartype type: str :ivar container_status: Current status of the container. Possible values include: "OK", "Offline", "Unknown", "Updating", "NeedsAttention". - :vartype container_status: str or ~azure.mgmt.databoxedge.models.ContainerStatus + :vartype container_status: str or + ~azure.mgmt.databoxedge.v2020_05_01_preview.models.ContainerStatus :param data_format: Required. DataFormat for Container. Possible values include: "BlockBlob", "PageBlob", "AzureFile". - :type data_format: str or ~azure.mgmt.databoxedge.models.AzureContainerDataFormat + :type data_format: str or + ~azure.mgmt.databoxedge.v2020_05_01_preview.models.AzureContainerDataFormat :ivar refresh_details: Details of the refresh job on this container. - :vartype refresh_details: ~azure.mgmt.databoxedge.models.RefreshDetails + :vartype refresh_details: ~azure.mgmt.databoxedge.v2020_05_01_preview.models.RefreshDetails :ivar created_date_time: The UTC time when container got created. :vartype created_date_time: ~datetime.datetime """ @@ -569,7 +574,7 @@ class ContainerList(msrest.serialization.Model): Variables are only populated by the server, and will be ignored when sending a request. :ivar value: The list of containers. - :vartype value: list[~azure.mgmt.databoxedge.models.Container] + :vartype value: list[~azure.mgmt.databoxedge.v2020_05_01_preview.models.Container] :ivar next_link: Link to the next set of results. :vartype next_link: str """ @@ -615,14 +620,14 @@ class DataBoxEdgeDevice(ARMBaseModel): to view and group this device (across resource groups). :type tags: dict[str, str] :param sku: The SKU type. - :type sku: ~azure.mgmt.databoxedge.models.Sku + :type sku: ~azure.mgmt.databoxedge.v2020_05_01_preview.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 - ~azure.mgmt.databoxedge.models.DataBoxEdgeDeviceStatus + ~azure.mgmt.databoxedge.v2020_05_01_preview.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. @@ -631,7 +636,7 @@ class DataBoxEdgeDevice(ARMBaseModel): :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 ~azure.mgmt.databoxedge.models.DeviceType + :vartype device_type: str or ~azure.mgmt.databoxedge.v2020_05_01_preview.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. @@ -647,7 +652,8 @@ class DataBoxEdgeDevice(ARMBaseModel): :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 ~azure.mgmt.databoxedge.models.RoleTypes] + :vartype configured_role_types: list[str or + ~azure.mgmt.databoxedge.v2020_05_01_preview.models.RoleTypes] :ivar node_count: The number of nodes in the cluster. :vartype node_count: int """ @@ -770,7 +776,7 @@ class DataBoxEdgeDeviceList(msrest.serialization.Model): 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[~azure.mgmt.databoxedge.models.DataBoxEdgeDevice] + :vartype value: list[~azure.mgmt.databoxedge.v2020_05_01_preview.models.DataBoxEdgeDevice] :ivar next_link: Link to the next set of results. :vartype next_link: str """ @@ -823,11 +829,11 @@ class DataBoxEdgeSku(msrest.serialization.Model): :ivar name: The Sku name. Possible values include: "Gateway", "Edge", "TEA_1Node", "TEA_1Node_UPS", "TEA_1Node_Heater", "TEA_1Node_UPS_Heater", "TEA_4Node_Heater", "TEA_4Node_UPS_Heater", "TMA", "TDC", "TCA_Large", "TCA_Small", "GPU". - :vartype name: str or ~azure.mgmt.databoxedge.models.SkuName + :vartype name: str or ~azure.mgmt.databoxedge.v2020_05_01_preview.models.SkuName :ivar kind: The Sku kind. :vartype kind: str :ivar tier: The Sku tier. Possible values include: "Standard". - :vartype tier: str or ~azure.mgmt.databoxedge.models.SkuTier + :vartype tier: str or ~azure.mgmt.databoxedge.v2020_05_01_preview.models.SkuTier :ivar size: The Sku kind. :vartype size: str :ivar family: The Sku family. @@ -837,17 +843,20 @@ class DataBoxEdgeSku(msrest.serialization.Model): :ivar api_versions: The API versions in which Sku is available. :vartype api_versions: list[str] :ivar location_info: Availability of the Sku for the location/zone/site. - :vartype location_info: list[~azure.mgmt.databoxedge.models.SkuLocationInfo] + :vartype location_info: + list[~azure.mgmt.databoxedge.v2020_05_01_preview.models.SkuLocationInfo] :ivar costs: The pricing info of the Sku. - :vartype costs: list[~azure.mgmt.databoxedge.models.SkuCost] + :vartype costs: list[~azure.mgmt.databoxedge.v2020_05_01_preview.models.SkuCost] :ivar restrictions: Restriction info of the SKU. - :vartype restrictions: list[~azure.mgmt.databoxedge.models.SkuRestriction] + :vartype restrictions: list[~azure.mgmt.databoxedge.v2020_05_01_preview.models.SkuRestriction] :ivar signup_option: Can the SKU be signed up.. Possible values include: "None", "Available". - :vartype signup_option: str or ~azure.mgmt.databoxedge.models.SkuSignupOption + :vartype signup_option: str or + ~azure.mgmt.databoxedge.v2020_05_01_preview.models.SkuSignupOption :ivar version: Sku version. Possible values include: "Stable", "Preview". - :vartype version: str or ~azure.mgmt.databoxedge.models.SkuVersion + :vartype version: str or ~azure.mgmt.databoxedge.v2020_05_01_preview.models.SkuVersion :ivar availability: Is SKU available. Possible values include: "Available", "Unavailable". - :vartype availability: str or ~azure.mgmt.databoxedge.models.SkuAvailability + :vartype availability: str or + ~azure.mgmt.databoxedge.v2020_05_01_preview.models.SkuAvailability """ _validation = { @@ -911,7 +920,7 @@ class DataBoxEdgeSkuList(msrest.serialization.Model): Variables are only populated by the server, and will be ignored when sending a request. :ivar value: List of ResourceType Sku. - :vartype value: list[~azure.mgmt.databoxedge.models.DataBoxEdgeSku] + :vartype value: list[~azure.mgmt.databoxedge.v2020_05_01_preview.models.DataBoxEdgeSku] :ivar next_link: Links to the next set of results. :vartype next_link: str """ @@ -953,7 +962,7 @@ class Trigger(ARMBaseModel): :vartype type: str :param kind: Required. Trigger Kind.Constant filled by server. Possible values include: "FileEvent", "PeriodicTimerEvent". - :type kind: str or ~azure.mgmt.databoxedge.models.TriggerEventType + :type kind: str or ~azure.mgmt.databoxedge.v2020_05_01_preview.models.TriggerEventType """ _validation = { @@ -997,11 +1006,11 @@ class FileEventTrigger(Trigger): :vartype type: str :param kind: Required. Trigger Kind.Constant filled by server. Possible values include: "FileEvent", "PeriodicTimerEvent". - :type kind: str or ~azure.mgmt.databoxedge.models.TriggerEventType + :type kind: str or ~azure.mgmt.databoxedge.v2020_05_01_preview.models.TriggerEventType :param source_info: Required. File event source details. - :type source_info: ~azure.mgmt.databoxedge.models.FileSourceInfo + :type source_info: ~azure.mgmt.databoxedge.v2020_05_01_preview.models.FileSourceInfo :param sink_info: Required. Role sink info. - :type sink_info: ~azure.mgmt.databoxedge.models.RoleSinkInfo + :type sink_info: ~azure.mgmt.databoxedge.v2020_05_01_preview.models.RoleSinkInfo :param custom_context_tag: A custom context tag typically used to correlate the trigger against its usage. For example, if a periodic timer trigger is intended for certain specific IoT modules in the device, the tag can be the name or the image URL of the module. @@ -1073,7 +1082,7 @@ class ImageRepositoryCredential(msrest.serialization.Model): :param user_name: Required. Repository user name. :type user_name: str :param password: Repository user password. - :type password: ~azure.mgmt.databoxedge.models.AsymmetricEncryptedSecret + :type password: ~azure.mgmt.databoxedge.v2020_05_01_preview.models.AsymmetricEncryptedSecret """ _validation = { @@ -1109,7 +1118,7 @@ class IoTDeviceInfo(msrest.serialization.Model): :param io_t_host_hub_id: Id for the IoT hub associated to the device. :type io_t_host_hub_id: str :param authentication: Encrypted IoT device/IoT edge device connection string. - :type authentication: ~azure.mgmt.databoxedge.models.Authentication + :type authentication: ~azure.mgmt.databoxedge.v2020_05_01_preview.models.Authentication """ _validation = { @@ -1145,7 +1154,8 @@ class IoTEdgeAgentInfo(msrest.serialization.Model): :param tag: Required. Image Tag. :type tag: str :param image_repository: Image repository details. - :type image_repository: ~azure.mgmt.databoxedge.models.ImageRepositoryCredential + :type image_repository: + ~azure.mgmt.databoxedge.v2020_05_01_preview.models.ImageRepositoryCredential """ _validation = { @@ -1187,7 +1197,7 @@ class Role(ARMBaseModel): :vartype type: str :param kind: Required. Role type.Constant filled by server. Possible values include: "IOT", "ASA", "Functions", "Cognitive". - :type kind: str or ~azure.mgmt.databoxedge.models.RoleTypes + :type kind: str or ~azure.mgmt.databoxedge.v2020_05_01_preview.models.RoleTypes """ _validation = { @@ -1231,25 +1241,27 @@ class IoTRole(Role): :vartype type: str :param kind: Required. Role type.Constant filled by server. Possible values include: "IOT", "ASA", "Functions", "Cognitive". - :type kind: str or ~azure.mgmt.databoxedge.models.RoleTypes + :type kind: str or ~azure.mgmt.databoxedge.v2020_05_01_preview.models.RoleTypes :param host_platform: Host OS supported by the IoT role. Possible values include: "Windows", "Linux". - :type host_platform: str or ~azure.mgmt.databoxedge.models.PlatformType + :type host_platform: str or ~azure.mgmt.databoxedge.v2020_05_01_preview.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: ~azure.mgmt.databoxedge.models.IoTDeviceInfo + :type io_t_device_details: ~azure.mgmt.databoxedge.v2020_05_01_preview.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: ~azure.mgmt.databoxedge.models.IoTDeviceInfo + :type io_t_edge_device_details: + ~azure.mgmt.databoxedge.v2020_05_01_preview.models.IoTDeviceInfo :param share_mappings: Mount points of shares in role(s). - :type share_mappings: list[~azure.mgmt.databoxedge.models.MountPointMap] + :type share_mappings: list[~azure.mgmt.databoxedge.v2020_05_01_preview.models.MountPointMap] :param io_t_edge_agent_info: Iot edge agent details to download the agent and bootstrap iot runtime. - :type io_t_edge_agent_info: ~azure.mgmt.databoxedge.models.IoTEdgeAgentInfo + :type io_t_edge_agent_info: ~azure.mgmt.databoxedge.v2020_05_01_preview.models.IoTEdgeAgentInfo :ivar host_platform_type: Platform where the Iot runtime is hosted. Possible values include: "KubernetesCluster", "LinuxVM". - :vartype host_platform_type: str or ~azure.mgmt.databoxedge.models.HostPlatformType + :vartype host_platform_type: str or + ~azure.mgmt.databoxedge.v2020_05_01_preview.models.HostPlatformType :param role_status: Role status. Possible values include: "Enabled", "Disabled". - :type role_status: str or ~azure.mgmt.databoxedge.models.RoleStatus + :type role_status: str or ~azure.mgmt.databoxedge.v2020_05_01_preview.models.RoleStatus """ _validation = { @@ -1372,7 +1384,7 @@ class Job(msrest.serialization.Model): :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 ~azure.mgmt.databoxedge.models.JobStatus + :vartype status: str or ~azure.mgmt.databoxedge.v2020_05_01_preview.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. @@ -1380,19 +1392,22 @@ class Job(msrest.serialization.Model): :ivar percent_complete: The percentage of the job that is complete. :vartype percent_complete: int :ivar error: The error details. - :vartype error: ~azure.mgmt.databoxedge.models.JobErrorDetails + :vartype error: ~azure.mgmt.databoxedge.v2020_05_01_preview.models.JobErrorDetails :ivar job_type: The type of the job. Possible values include: "Invalid", "ScanForUpdates", "DownloadUpdates", "InstallUpdates", "RefreshShare", "RefreshContainer". - :vartype job_type: str or ~azure.mgmt.databoxedge.models.JobType + :vartype job_type: str or ~azure.mgmt.databoxedge.v2020_05_01_preview.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 ~azure.mgmt.databoxedge.models.UpdateOperationStage + :vartype current_stage: str or + ~azure.mgmt.databoxedge.v2020_05_01_preview.models.UpdateOperationStage :ivar download_progress: The download progress. - :vartype download_progress: ~azure.mgmt.databoxedge.models.UpdateDownloadProgress + :vartype download_progress: + ~azure.mgmt.databoxedge.v2020_05_01_preview.models.UpdateDownloadProgress :ivar install_progress: The install progress. - :vartype install_progress: ~azure.mgmt.databoxedge.models.UpdateInstallProgress + :vartype install_progress: + ~azure.mgmt.databoxedge.v2020_05_01_preview.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 @@ -1471,7 +1486,7 @@ class JobErrorDetails(msrest.serialization.Model): 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[~azure.mgmt.databoxedge.models.JobErrorItem] + :vartype error_details: list[~azure.mgmt.databoxedge.v2020_05_01_preview.models.JobErrorItem] :ivar code: The code intended for programmatic access. :vartype code: str :ivar message: The message that describes the error in detail. @@ -1573,23 +1588,25 @@ class MetricSpecificationV1(msrest.serialization.Model): :type display_description: str :param unit: Metric units. Possible values include: "NotSpecified", "Percent", "Count", "Seconds", "Milliseconds", "Bytes", "BytesPerSecond", "CountPerSecond". - :type unit: str or ~azure.mgmt.databoxedge.models.MetricUnit + :type unit: str or ~azure.mgmt.databoxedge.v2020_05_01_preview.models.MetricUnit :param aggregation_type: Metric aggregation type. Possible values include: "NotSpecified", "None", "Average", "Minimum", "Maximum", "Total", "Count". - :type aggregation_type: str or ~azure.mgmt.databoxedge.models.MetricAggregationType + :type aggregation_type: str or + ~azure.mgmt.databoxedge.v2020_05_01_preview.models.MetricAggregationType :param dimensions: Metric dimensions, other than default dimension which is resource. - :type dimensions: list[~azure.mgmt.databoxedge.models.MetricDimensionV1] + :type dimensions: list[~azure.mgmt.databoxedge.v2020_05_01_preview.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 ~azure.mgmt.databoxedge.models.MetricCategory + :type category: str or ~azure.mgmt.databoxedge.v2020_05_01_preview.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 ~azure.mgmt.databoxedge.models.TimeGrain] + :type supported_time_grain_types: list[str or + ~azure.mgmt.databoxedge.v2020_05_01_preview.models.TimeGrain] :param supported_aggregation_types: Support metric aggregation type. :type supported_aggregation_types: list[str or - ~azure.mgmt.databoxedge.models.MetricAggregationType] + ~azure.mgmt.databoxedge.v2020_05_01_preview.models.MetricAggregationType] """ _attribute_map = { @@ -1638,9 +1655,9 @@ class MountPointMap(msrest.serialization.Model): :ivar mount_point: Mount point for the share. :vartype mount_point: str :ivar mount_type: Mounting type. Possible values include: "Volume", "HostPath". - :vartype mount_type: str or ~azure.mgmt.databoxedge.models.MountType + :vartype mount_type: str or ~azure.mgmt.databoxedge.v2020_05_01_preview.models.MountType :ivar role_type: Role type. Possible values include: "IOT", "ASA", "Functions", "Cognitive". - :vartype role_type: str or ~azure.mgmt.databoxedge.models.RoleTypes + :vartype role_type: str or ~azure.mgmt.databoxedge.v2020_05_01_preview.models.RoleTypes """ _validation = { @@ -1679,7 +1696,8 @@ class NetworkAdapter(msrest.serialization.Model): :ivar adapter_id: Instance ID of network adapter. :vartype adapter_id: str :ivar adapter_position: Hardware position of network adapter. - :vartype adapter_position: ~azure.mgmt.databoxedge.models.NetworkAdapterPosition + :vartype adapter_position: + ~azure.mgmt.databoxedge.v2020_05_01_preview.models.NetworkAdapterPosition :ivar index: Logical index of the adapter. :vartype index: int :ivar node_id: Node ID of the network adapter. @@ -1694,17 +1712,19 @@ class NetworkAdapter(msrest.serialization.Model): :vartype link_speed: long :ivar status: Value indicating whether this adapter is valid. Possible values include: "Inactive", "Active". - :vartype status: str or ~azure.mgmt.databoxedge.models.NetworkAdapterStatus + :vartype status: str or ~azure.mgmt.databoxedge.v2020_05_01_preview.models.NetworkAdapterStatus :param rdma_status: Value indicating whether this adapter is RDMA capable. Possible values include: "Incapable", "Capable". - :type rdma_status: str or ~azure.mgmt.databoxedge.models.NetworkAdapterRDMAStatus + :type rdma_status: str or + ~azure.mgmt.databoxedge.v2020_05_01_preview.models.NetworkAdapterRDMAStatus :param dhcp_status: Value indicating whether this adapter has DHCP enabled. Possible values include: "Disabled", "Enabled". - :type dhcp_status: str or ~azure.mgmt.databoxedge.models.NetworkAdapterDHCPStatus + :type dhcp_status: str or + ~azure.mgmt.databoxedge.v2020_05_01_preview.models.NetworkAdapterDHCPStatus :ivar ipv4_configuration: The IPv4 configuration of the network adapter. - :vartype ipv4_configuration: ~azure.mgmt.databoxedge.models.Ipv4Config + :vartype ipv4_configuration: ~azure.mgmt.databoxedge.v2020_05_01_preview.models.Ipv4Config :ivar ipv6_configuration: The IPv6 configuration of the network adapter. - :vartype ipv6_configuration: ~azure.mgmt.databoxedge.models.Ipv6Config + :vartype ipv6_configuration: ~azure.mgmt.databoxedge.v2020_05_01_preview.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. @@ -1773,7 +1793,7 @@ class NetworkAdapterPosition(msrest.serialization.Model): 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 ~azure.mgmt.databoxedge.models.NetworkGroup + :vartype network_group: str or ~azure.mgmt.databoxedge.v2020_05_01_preview.models.NetworkGroup :ivar port: The port. :vartype port: int """ @@ -1809,7 +1829,8 @@ class NetworkSettings(ARMBaseModel): :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[~azure.mgmt.databoxedge.models.NetworkAdapter] + :vartype network_adapters: + list[~azure.mgmt.databoxedge.v2020_05_01_preview.models.NetworkAdapter] """ _validation = { @@ -1849,7 +1870,7 @@ class Node(ARMBaseModel): :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 ~azure.mgmt.databoxedge.models.NodeStatus + :vartype node_status: str or ~azure.mgmt.databoxedge.v2020_05_01_preview.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. @@ -1911,7 +1932,7 @@ class NodeList(msrest.serialization.Model): Variables are only populated by the server, and will be ignored when sending a request. :ivar value: The list of Nodes. - :vartype value: list[~azure.mgmt.databoxedge.models.Node] + :vartype value: list[~azure.mgmt.databoxedge.v2020_05_01_preview.models.Node] """ _validation = { @@ -1936,11 +1957,12 @@ class Operation(msrest.serialization.Model): :param name: Name of the operation. :type name: str :param display: Properties displayed for the operation. - :type display: ~azure.mgmt.databoxedge.models.OperationDisplay + :type display: ~azure.mgmt.databoxedge.v2020_05_01_preview.models.OperationDisplay :param origin: Origin of the operation. :type origin: str :param service_specification: Service specification. - :type service_specification: ~azure.mgmt.databoxedge.models.ServiceSpecification + :type service_specification: + ~azure.mgmt.databoxedge.v2020_05_01_preview.models.ServiceSpecification """ _attribute_map = { @@ -1998,7 +2020,7 @@ class OperationsList(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. :param value: Required. The value. - :type value: list[~azure.mgmt.databoxedge.models.Operation] + :type value: list[~azure.mgmt.databoxedge.v2020_05_01_preview.models.Operation] :param next_link: Link to the next set of results. :type next_link: str """ @@ -2033,21 +2055,23 @@ class Order(ARMBaseModel): :ivar type: The hierarchical type of the object. :vartype type: str :param contact_information: The contact details. - :type contact_information: ~azure.mgmt.databoxedge.models.ContactDetails + :type contact_information: ~azure.mgmt.databoxedge.v2020_05_01_preview.models.ContactDetails :param shipping_address: The shipping address. - :type shipping_address: ~azure.mgmt.databoxedge.models.Address + :type shipping_address: ~azure.mgmt.databoxedge.v2020_05_01_preview.models.Address :param current_status: Current status of the order. - :type current_status: ~azure.mgmt.databoxedge.models.OrderStatus + :type current_status: ~azure.mgmt.databoxedge.v2020_05_01_preview.models.OrderStatus :ivar order_history: List of status changes in the order. - :vartype order_history: list[~azure.mgmt.databoxedge.models.OrderStatus] + :vartype order_history: list[~azure.mgmt.databoxedge.v2020_05_01_preview.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[~azure.mgmt.databoxedge.models.TrackingInfo] + :vartype delivery_tracking_info: + list[~azure.mgmt.databoxedge.v2020_05_01_preview.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[~azure.mgmt.databoxedge.models.TrackingInfo] + :vartype return_tracking_info: + list[~azure.mgmt.databoxedge.v2020_05_01_preview.models.TrackingInfo] """ _validation = { @@ -2093,7 +2117,7 @@ class OrderList(msrest.serialization.Model): Variables are only populated by the server, and will be ignored when sending a request. :ivar value: The list of orders. - :vartype value: list[~azure.mgmt.databoxedge.models.Order] + :vartype value: list[~azure.mgmt.databoxedge.v2020_05_01_preview.models.Order] :ivar next_link: Link to the next set of results. :vartype next_link: str """ @@ -2128,7 +2152,7 @@ class OrderStatus(msrest.serialization.Model): include: "Untracked", "AwaitingFulfilment", "AwaitingPreparation", "AwaitingShipment", "Shipped", "Arriving", "Delivered", "ReplacementRequested", "LostDevice", "Declined", "ReturnInitiated", "AwaitingReturnShipment", "ShippedBack", "CollectedAtMicrosoft". - :type status: str or ~azure.mgmt.databoxedge.models.OrderState + :type status: str or ~azure.mgmt.databoxedge.v2020_05_01_preview.models.OrderState :ivar update_date_time: Time of status update. :vartype update_date_time: ~datetime.datetime :param comments: Comments related to this status change. @@ -2177,11 +2201,11 @@ class PeriodicTimerEventTrigger(Trigger): :vartype type: str :param kind: Required. Trigger Kind.Constant filled by server. Possible values include: "FileEvent", "PeriodicTimerEvent". - :type kind: str or ~azure.mgmt.databoxedge.models.TriggerEventType + :type kind: str or ~azure.mgmt.databoxedge.v2020_05_01_preview.models.TriggerEventType :param source_info: Required. Periodic timer details. - :type source_info: ~azure.mgmt.databoxedge.models.PeriodicTimerSourceInfo + :type source_info: ~azure.mgmt.databoxedge.v2020_05_01_preview.models.PeriodicTimerSourceInfo :param sink_info: Required. Role Sink information. - :type sink_info: ~azure.mgmt.databoxedge.models.RoleSinkInfo + :type sink_info: ~azure.mgmt.databoxedge.v2020_05_01_preview.models.RoleSinkInfo :param custom_context_tag: A custom context tag typically used to correlate the trigger against its usage. For example, if a periodic timer trigger is intended for certain specific IoT modules in the device, the tag can be the name or the image URL of the module. @@ -2303,11 +2327,11 @@ class ResourceTypeSku(msrest.serialization.Model): :ivar name: The Sku name. Possible values include: "Gateway", "Edge", "TEA_1Node", "TEA_1Node_UPS", "TEA_1Node_Heater", "TEA_1Node_UPS_Heater", "TEA_4Node_Heater", "TEA_4Node_UPS_Heater", "TMA", "TDC", "TCA_Large", "TCA_Small", "GPU". - :vartype name: str or ~azure.mgmt.databoxedge.models.SkuName + :vartype name: str or ~azure.mgmt.databoxedge.v2020_05_01_preview.models.SkuName :ivar kind: The Sku kind. :vartype kind: str :ivar tier: The Sku tier. Possible values include: "Standard". - :vartype tier: str or ~azure.mgmt.databoxedge.models.SkuTier + :vartype tier: str or ~azure.mgmt.databoxedge.v2020_05_01_preview.models.SkuTier :ivar family: The Sku family. :vartype family: str :ivar locations: Availability of the SKU for the region. @@ -2315,11 +2339,12 @@ class ResourceTypeSku(msrest.serialization.Model): :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[~azure.mgmt.databoxedge.models.SkuLocationInfo] + :vartype location_info: + list[~azure.mgmt.databoxedge.v2020_05_01_preview.models.SkuLocationInfo] :ivar costs: The pricing info of the Sku. - :vartype costs: list[~azure.mgmt.databoxedge.models.SkuCost] + :vartype costs: list[~azure.mgmt.databoxedge.v2020_05_01_preview.models.SkuCost] :ivar restrictions: Restrictions of the SKU availability. - :vartype restrictions: list[~azure.mgmt.databoxedge.models.SkuRestriction] + :vartype restrictions: list[~azure.mgmt.databoxedge.v2020_05_01_preview.models.SkuRestriction] """ _validation = { @@ -2371,7 +2396,7 @@ class RoleList(msrest.serialization.Model): Variables are only populated by the server, and will be ignored when sending a request. :ivar value: The Value. - :vartype value: list[~azure.mgmt.databoxedge.models.Role] + :vartype value: list[~azure.mgmt.databoxedge.v2020_05_01_preview.models.Role] :ivar next_link: Link to the next set of results. :vartype next_link: str """ @@ -2437,7 +2462,8 @@ class SecuritySettings(ARMBaseModel): (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: ~azure.mgmt.databoxedge.models.AsymmetricEncryptedSecret + :type device_admin_password: + ~azure.mgmt.databoxedge.v2020_05_01_preview.models.AsymmetricEncryptedSecret """ _validation = { @@ -2466,7 +2492,8 @@ class ServiceSpecification(msrest.serialization.Model): """Service specification. :param metric_specifications: Metric specification as defined by shoebox. - :type metric_specifications: list[~azure.mgmt.databoxedge.models.MetricSpecificationV1] + :type metric_specifications: + list[~azure.mgmt.databoxedge.v2020_05_01_preview.models.MetricSpecificationV1] """ _attribute_map = { @@ -2498,27 +2525,32 @@ class Share(ARMBaseModel): :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 ~azure.mgmt.databoxedge.models.ShareStatus + :type share_status: str or ~azure.mgmt.databoxedge.v2020_05_01_preview.models.ShareStatus :param monitoring_status: Required. Current monitoring status of the share. Possible values include: "Enabled", "Disabled". - :type monitoring_status: str or ~azure.mgmt.databoxedge.models.MonitoringStatus + :type monitoring_status: str or + ~azure.mgmt.databoxedge.v2020_05_01_preview.models.MonitoringStatus :param azure_container_info: Azure container mapping for the share. - :type azure_container_info: ~azure.mgmt.databoxedge.models.AzureContainerInfo + :type azure_container_info: + ~azure.mgmt.databoxedge.v2020_05_01_preview.models.AzureContainerInfo :param access_protocol: Required. Access protocol to be used by the share. Possible values include: "SMB", "NFS". - :type access_protocol: str or ~azure.mgmt.databoxedge.models.ShareAccessProtocol + :type access_protocol: str or + ~azure.mgmt.databoxedge.v2020_05_01_preview.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[~azure.mgmt.databoxedge.models.UserAccessRight] + :type user_access_rights: + list[~azure.mgmt.databoxedge.v2020_05_01_preview.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[~azure.mgmt.databoxedge.models.ClientAccessRight] + :type client_access_rights: + list[~azure.mgmt.databoxedge.v2020_05_01_preview.models.ClientAccessRight] :param refresh_details: Details of the refresh job on this share. - :type refresh_details: ~azure.mgmt.databoxedge.models.RefreshDetails + :type refresh_details: ~azure.mgmt.databoxedge.v2020_05_01_preview.models.RefreshDetails :ivar share_mappings: Share mount point to the role. - :vartype share_mappings: list[~azure.mgmt.databoxedge.models.MountPointMap] + :vartype share_mappings: list[~azure.mgmt.databoxedge.v2020_05_01_preview.models.MountPointMap] :param data_policy: Data policy of the share. Possible values include: "Cloud", "Local". - :type data_policy: str or ~azure.mgmt.databoxedge.models.DataPolicy + :type data_policy: str or ~azure.mgmt.databoxedge.v2020_05_01_preview.models.DataPolicy """ _validation = { @@ -2573,7 +2605,7 @@ class ShareAccessRight(msrest.serialization.Model): :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 ~azure.mgmt.databoxedge.models.ShareAccessType + :type access_type: str or ~azure.mgmt.databoxedge.v2020_05_01_preview.models.ShareAccessType """ _validation = { @@ -2601,7 +2633,7 @@ class ShareList(msrest.serialization.Model): Variables are only populated by the server, and will be ignored when sending a request. :ivar value: The list of shares. - :vartype value: list[~azure.mgmt.databoxedge.models.Share] + :vartype value: list[~azure.mgmt.databoxedge.v2020_05_01_preview.models.Share] :ivar next_link: Link to the next set of results. :vartype next_link: str """ @@ -2631,9 +2663,9 @@ class Sku(msrest.serialization.Model): :param name: SKU name. Possible values include: "Gateway", "Edge", "TEA_1Node", "TEA_1Node_UPS", "TEA_1Node_Heater", "TEA_1Node_UPS_Heater", "TEA_4Node_Heater", "TEA_4Node_UPS_Heater", "TMA", "TDC", "TCA_Large", "TCA_Small", "GPU". - :type name: str or ~azure.mgmt.databoxedge.models.SkuName + :type name: str or ~azure.mgmt.databoxedge.v2020_05_01_preview.models.SkuName :param tier: The SKU tier. This is based on the SKU name. Possible values include: "Standard". - :type tier: str or ~azure.mgmt.databoxedge.models.SkuTier + :type tier: str or ~azure.mgmt.databoxedge.v2020_05_01_preview.models.SkuTier """ _attribute_map = { @@ -2735,15 +2767,16 @@ class SkuInformation(msrest.serialization.Model): :ivar locations: The locations where Sku is available. :vartype locations: list[str] :ivar location_info: The locations where Sku is available with zones and sites info. - :vartype location_info: list[~azure.mgmt.databoxedge.models.SkuLocationInfo] + :vartype location_info: + list[~azure.mgmt.databoxedge.v2020_05_01_preview.models.SkuLocationInfo] :ivar required_quota_ids: The required quotaIds for the sku to be available. :vartype required_quota_ids: list[str] :ivar required_features: The required features for the sku to be available. :vartype required_features: list[str] :ivar costs: The cost of the SKU. - :vartype costs: list[~azure.mgmt.databoxedge.models.SkuCost] + :vartype costs: list[~azure.mgmt.databoxedge.v2020_05_01_preview.models.SkuCost] :ivar capabilities: The capabilities of the SKU. - :vartype capabilities: list[~azure.mgmt.databoxedge.models.SKUCapability] + :vartype capabilities: list[~azure.mgmt.databoxedge.v2020_05_01_preview.models.SKUCapability] """ _validation = { @@ -2801,7 +2834,7 @@ class SkuInformationList(msrest.serialization.Model): Variables are only populated by the server, and will be ignored when sending a request. :ivar value: List of ResourceType Sku. - :vartype value: list[~azure.mgmt.databoxedge.models.ResourceTypeSku] + :vartype value: list[~azure.mgmt.databoxedge.v2020_05_01_preview.models.ResourceTypeSku] :ivar next_link: Links to the next set of results. :vartype next_link: str """ @@ -2871,9 +2904,11 @@ class SkuRestriction(msrest.serialization.Model): :vartype values: list[str] :ivar reason_code: The SKU restriction reason. Possible values include: "NotAvailableForSubscription", "QuotaId". - :vartype reason_code: str or ~azure.mgmt.databoxedge.models.SkuRestrictionReasonCode + :vartype reason_code: str or + ~azure.mgmt.databoxedge.v2020_05_01_preview.models.SkuRestrictionReasonCode :ivar restriction_info: Restriction of the SKU for the location/zone. - :vartype restriction_info: ~azure.mgmt.databoxedge.models.SkuRestrictionInfo + :vartype restriction_info: + ~azure.mgmt.databoxedge.v2020_05_01_preview.models.SkuRestrictionInfo """ _validation = { @@ -2946,10 +2981,11 @@ class StorageAccount(ARMBaseModel): :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 ~azure.mgmt.databoxedge.models.StorageAccountStatus + :type storage_account_status: str or + ~azure.mgmt.databoxedge.v2020_05_01_preview.models.StorageAccountStatus :param data_policy: Data policy of the storage Account. Possible values include: "Cloud", "Local". - :type data_policy: str or ~azure.mgmt.databoxedge.models.DataPolicy + :type data_policy: str or ~azure.mgmt.databoxedge.v2020_05_01_preview.models.DataPolicy :param storage_account_credential_id: Storage Account Credential Id. :type storage_account_credential_id: str :ivar blob_endpoint: BlobEndpoint of Storage Account. @@ -3010,18 +3046,18 @@ class StorageAccountCredential(ARMBaseModel): :param user_name: Username for the storage account. :type user_name: str :param account_key: Encrypted storage key. - :type account_key: ~azure.mgmt.databoxedge.models.AsymmetricEncryptedSecret + :type account_key: ~azure.mgmt.databoxedge.v2020_05_01_preview.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 ~azure.mgmt.databoxedge.models.SSLStatus + :type ssl_status: str or ~azure.mgmt.databoxedge.v2020_05_01_preview.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 ~azure.mgmt.databoxedge.models.AccountType + :type account_type: str or ~azure.mgmt.databoxedge.v2020_05_01_preview.models.AccountType :param storage_account_id: Id of the storage account. :type storage_account_id: str """ @@ -3070,7 +3106,8 @@ class StorageAccountCredentialList(msrest.serialization.Model): Variables are only populated by the server, and will be ignored when sending a request. :ivar value: The value. - :vartype value: list[~azure.mgmt.databoxedge.models.StorageAccountCredential] + :vartype value: + list[~azure.mgmt.databoxedge.v2020_05_01_preview.models.StorageAccountCredential] :ivar next_link: Link to the next set of results. :vartype next_link: str """ @@ -3100,7 +3137,7 @@ class StorageAccountList(msrest.serialization.Model): Variables are only populated by the server, and will be ignored when sending a request. :ivar value: The list of storageAccounts. - :vartype value: list[~azure.mgmt.databoxedge.models.StorageAccount] + :vartype value: list[~azure.mgmt.databoxedge.v2020_05_01_preview.models.StorageAccount] :ivar next_link: Link to the next set of results. :vartype next_link: str """ @@ -3128,7 +3165,8 @@ class SymmetricKey(msrest.serialization.Model): """Symmetric key for authentication. :param connection_string: Connection string based on the symmetric key. - :type connection_string: ~azure.mgmt.databoxedge.models.AsymmetricEncryptedSecret + :type connection_string: + ~azure.mgmt.databoxedge.v2020_05_01_preview.models.AsymmetricEncryptedSecret """ _attribute_map = { @@ -3180,7 +3218,7 @@ class TriggerList(msrest.serialization.Model): Variables are only populated by the server, and will be ignored when sending a request. :ivar value: The list of triggers. - :vartype value: list[~azure.mgmt.databoxedge.models.Trigger] + :vartype value: list[~azure.mgmt.databoxedge.v2020_05_01_preview.models.Trigger] :ivar next_link: Link to the next set of results. :vartype next_link: str """ @@ -3211,7 +3249,8 @@ class UpdateDownloadProgress(msrest.serialization.Model): :ivar download_phase: The download phase. Possible values include: "Unknown", "Initializing", "Downloading", "Verifying". - :vartype download_phase: str or ~azure.mgmt.databoxedge.models.DownloadPhase + :vartype download_phase: str or + ~azure.mgmt.databoxedge.v2020_05_01_preview.models.DownloadPhase :ivar percent_complete: Percentage of completion. :vartype percent_complete: int :ivar total_bytes_to_download: Total bytes to download. @@ -3325,10 +3364,12 @@ class UpdateSummary(ARMBaseModel): :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 ~azure.mgmt.databoxedge.models.InstallRebootBehavior + :vartype reboot_behavior: str or + ~azure.mgmt.databoxedge.v2020_05_01_preview.models.InstallRebootBehavior :ivar ongoing_update_operation: The current update operation. Possible values include: "None", "Scan", "Download", "Install". - :vartype ongoing_update_operation: str or ~azure.mgmt.databoxedge.models.UpdateOperation + :vartype ongoing_update_operation: str or + ~azure.mgmt.databoxedge.v2020_05_01_preview.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. @@ -3418,7 +3459,8 @@ class UploadCertificateRequest(msrest.serialization.Model): :param authentication_type: The authentication type. Possible values include: "Invalid", "AzureActiveDirectory". - :type authentication_type: str or ~azure.mgmt.databoxedge.models.AuthenticationType + :type authentication_type: str or + ~azure.mgmt.databoxedge.v2020_05_01_preview.models.AuthenticationType :param certificate: Required. The base64 encoded certificate raw data. :type certificate: str """ @@ -3448,7 +3490,7 @@ class UploadCertificateResponse(msrest.serialization.Model): :param auth_type: Specifies authentication type. Possible values include: "Invalid", "AzureActiveDirectory". - :type auth_type: str or ~azure.mgmt.databoxedge.models.AuthenticationType + :type auth_type: str or ~azure.mgmt.databoxedge.v2020_05_01_preview.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. @@ -3516,13 +3558,15 @@ class User(ARMBaseModel): :ivar type: The hierarchical type of the object. :vartype type: str :param encrypted_password: The password details. - :type encrypted_password: ~azure.mgmt.databoxedge.models.AsymmetricEncryptedSecret + :type encrypted_password: + ~azure.mgmt.databoxedge.v2020_05_01_preview.models.AsymmetricEncryptedSecret :ivar share_access_rights: List of shares that the user has rights on. This field should not be specified during user creation. - :vartype share_access_rights: list[~azure.mgmt.databoxedge.models.ShareAccessRight] + :vartype share_access_rights: + list[~azure.mgmt.databoxedge.v2020_05_01_preview.models.ShareAccessRight] :param user_type: Required. Type of the user. Possible values include: "Share", "LocalManagement", "ARM". - :type user_type: str or ~azure.mgmt.databoxedge.models.UserType + :type user_type: str or ~azure.mgmt.databoxedge.v2020_05_01_preview.models.UserType """ _validation = { @@ -3561,7 +3605,7 @@ class UserAccessRight(msrest.serialization.Model): :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 ~azure.mgmt.databoxedge.models.ShareAccessType + :type access_type: str or ~azure.mgmt.databoxedge.v2020_05_01_preview.models.ShareAccessType """ _validation = { @@ -3589,7 +3633,7 @@ class UserList(msrest.serialization.Model): Variables are only populated by the server, and will be ignored when sending a request. :ivar value: The list of users. - :vartype value: list[~azure.mgmt.databoxedge.models.User] + :vartype value: list[~azure.mgmt.databoxedge.v2020_05_01_preview.models.User] :ivar next_link: Link to the next set of results. :vartype next_link: str """ diff --git a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_05_01_preview/models/_models_py3.py b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_05_01_preview/models/_models_py3.py index 8e675cb70172..e32e2df99e08 100644 --- a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_05_01_preview/models/_models_py3.py +++ b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_05_01_preview/models/_models_py3.py @@ -131,9 +131,9 @@ class Alert(ARMBaseModel): :vartype recommendation: str :ivar severity: Severity of the alert. Possible values include: "Informational", "Warning", "Critical". - :vartype severity: str or ~azure.mgmt.databoxedge.models.AlertSeverity + :vartype severity: str or ~azure.mgmt.databoxedge.v2020_05_01_preview.models.AlertSeverity :ivar error_details: Error details of the alert. - :vartype error_details: ~azure.mgmt.databoxedge.models.AlertErrorDetails + :vartype error_details: ~azure.mgmt.databoxedge.v2020_05_01_preview.models.AlertErrorDetails :ivar detailed_information: Alert details. :vartype detailed_information: dict[str, str] """ @@ -219,7 +219,7 @@ class AlertList(msrest.serialization.Model): Variables are only populated by the server, and will be ignored when sending a request. :ivar value: The value. - :vartype value: list[~azure.mgmt.databoxedge.models.Alert] + :vartype value: list[~azure.mgmt.databoxedge.v2020_05_01_preview.models.Alert] :ivar next_link: Link to the next set of results. :vartype next_link: str """ @@ -255,7 +255,8 @@ class AsymmetricEncryptedSecret(msrest.serialization.Model): :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 ~azure.mgmt.databoxedge.models.EncryptionAlgorithm + :type encryption_algorithm: str or + ~azure.mgmt.databoxedge.v2020_05_01_preview.models.EncryptionAlgorithm """ _validation = { @@ -287,7 +288,7 @@ class Authentication(msrest.serialization.Model): """Authentication mechanism for IoT devices. :param symmetric_key: Symmetric key for authentication. - :type symmetric_key: ~azure.mgmt.databoxedge.models.SymmetricKey + :type symmetric_key: ~azure.mgmt.databoxedge.v2020_05_01_preview.models.SymmetricKey """ _attribute_map = { @@ -317,7 +318,8 @@ class AzureContainerInfo(msrest.serialization.Model): :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 ~azure.mgmt.databoxedge.models.AzureContainerDataFormat + :type data_format: str or + ~azure.mgmt.databoxedge.v2020_05_01_preview.models.AzureContainerDataFormat """ _validation = { @@ -366,7 +368,7 @@ class BandwidthSchedule(ARMBaseModel): :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 ~azure.mgmt.databoxedge.models.DayOfWeek] + :type days: list[str or ~azure.mgmt.databoxedge.v2020_05_01_preview.models.DayOfWeek] """ _validation = { @@ -411,7 +413,7 @@ class BandwidthSchedulesList(msrest.serialization.Model): 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[~azure.mgmt.databoxedge.models.BandwidthSchedule] + :vartype value: list[~azure.mgmt.databoxedge.v2020_05_01_preview.models.BandwidthSchedule] :ivar next_link: Link to the next set of results. :vartype next_link: str """ @@ -444,7 +446,8 @@ class ClientAccessRight(msrest.serialization.Model): :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 ~azure.mgmt.databoxedge.models.ClientPermissionType + :type access_permission: str or + ~azure.mgmt.databoxedge.v2020_05_01_preview.models.ClientPermissionType """ _validation = { @@ -479,7 +482,7 @@ class CloudErrorBody(msrest.serialization.Model): interface. :type message: str :param details: A list of additional details about the error. - :type details: list[~azure.mgmt.databoxedge.models.CloudErrorBody] + :type details: list[~azure.mgmt.databoxedge.v2020_05_01_preview.models.CloudErrorBody] """ _attribute_map = { @@ -562,12 +565,14 @@ class Container(ARMBaseModel): :vartype type: str :ivar container_status: Current status of the container. Possible values include: "OK", "Offline", "Unknown", "Updating", "NeedsAttention". - :vartype container_status: str or ~azure.mgmt.databoxedge.models.ContainerStatus + :vartype container_status: str or + ~azure.mgmt.databoxedge.v2020_05_01_preview.models.ContainerStatus :param data_format: Required. DataFormat for Container. Possible values include: "BlockBlob", "PageBlob", "AzureFile". - :type data_format: str or ~azure.mgmt.databoxedge.models.AzureContainerDataFormat + :type data_format: str or + ~azure.mgmt.databoxedge.v2020_05_01_preview.models.AzureContainerDataFormat :ivar refresh_details: Details of the refresh job on this container. - :vartype refresh_details: ~azure.mgmt.databoxedge.models.RefreshDetails + :vartype refresh_details: ~azure.mgmt.databoxedge.v2020_05_01_preview.models.RefreshDetails :ivar created_date_time: The UTC time when container got created. :vartype created_date_time: ~datetime.datetime """ @@ -611,7 +616,7 @@ class ContainerList(msrest.serialization.Model): Variables are only populated by the server, and will be ignored when sending a request. :ivar value: The list of containers. - :vartype value: list[~azure.mgmt.databoxedge.models.Container] + :vartype value: list[~azure.mgmt.databoxedge.v2020_05_01_preview.models.Container] :ivar next_link: Link to the next set of results. :vartype next_link: str """ @@ -657,14 +662,14 @@ class DataBoxEdgeDevice(ARMBaseModel): to view and group this device (across resource groups). :type tags: dict[str, str] :param sku: The SKU type. - :type sku: ~azure.mgmt.databoxedge.models.Sku + :type sku: ~azure.mgmt.databoxedge.v2020_05_01_preview.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 - ~azure.mgmt.databoxedge.models.DataBoxEdgeDeviceStatus + ~azure.mgmt.databoxedge.v2020_05_01_preview.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. @@ -673,7 +678,7 @@ class DataBoxEdgeDevice(ARMBaseModel): :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 ~azure.mgmt.databoxedge.models.DeviceType + :vartype device_type: str or ~azure.mgmt.databoxedge.v2020_05_01_preview.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. @@ -689,7 +694,8 @@ class DataBoxEdgeDevice(ARMBaseModel): :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 ~azure.mgmt.databoxedge.models.RoleTypes] + :vartype configured_role_types: list[str or + ~azure.mgmt.databoxedge.v2020_05_01_preview.models.RoleTypes] :ivar node_count: The number of nodes in the cluster. :vartype node_count: int """ @@ -824,7 +830,7 @@ class DataBoxEdgeDeviceList(msrest.serialization.Model): 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[~azure.mgmt.databoxedge.models.DataBoxEdgeDevice] + :vartype value: list[~azure.mgmt.databoxedge.v2020_05_01_preview.models.DataBoxEdgeDevice] :ivar next_link: Link to the next set of results. :vartype next_link: str """ @@ -879,11 +885,11 @@ class DataBoxEdgeSku(msrest.serialization.Model): :ivar name: The Sku name. Possible values include: "Gateway", "Edge", "TEA_1Node", "TEA_1Node_UPS", "TEA_1Node_Heater", "TEA_1Node_UPS_Heater", "TEA_4Node_Heater", "TEA_4Node_UPS_Heater", "TMA", "TDC", "TCA_Large", "TCA_Small", "GPU". - :vartype name: str or ~azure.mgmt.databoxedge.models.SkuName + :vartype name: str or ~azure.mgmt.databoxedge.v2020_05_01_preview.models.SkuName :ivar kind: The Sku kind. :vartype kind: str :ivar tier: The Sku tier. Possible values include: "Standard". - :vartype tier: str or ~azure.mgmt.databoxedge.models.SkuTier + :vartype tier: str or ~azure.mgmt.databoxedge.v2020_05_01_preview.models.SkuTier :ivar size: The Sku kind. :vartype size: str :ivar family: The Sku family. @@ -893,17 +899,20 @@ class DataBoxEdgeSku(msrest.serialization.Model): :ivar api_versions: The API versions in which Sku is available. :vartype api_versions: list[str] :ivar location_info: Availability of the Sku for the location/zone/site. - :vartype location_info: list[~azure.mgmt.databoxedge.models.SkuLocationInfo] + :vartype location_info: + list[~azure.mgmt.databoxedge.v2020_05_01_preview.models.SkuLocationInfo] :ivar costs: The pricing info of the Sku. - :vartype costs: list[~azure.mgmt.databoxedge.models.SkuCost] + :vartype costs: list[~azure.mgmt.databoxedge.v2020_05_01_preview.models.SkuCost] :ivar restrictions: Restriction info of the SKU. - :vartype restrictions: list[~azure.mgmt.databoxedge.models.SkuRestriction] + :vartype restrictions: list[~azure.mgmt.databoxedge.v2020_05_01_preview.models.SkuRestriction] :ivar signup_option: Can the SKU be signed up.. Possible values include: "None", "Available". - :vartype signup_option: str or ~azure.mgmt.databoxedge.models.SkuSignupOption + :vartype signup_option: str or + ~azure.mgmt.databoxedge.v2020_05_01_preview.models.SkuSignupOption :ivar version: Sku version. Possible values include: "Stable", "Preview". - :vartype version: str or ~azure.mgmt.databoxedge.models.SkuVersion + :vartype version: str or ~azure.mgmt.databoxedge.v2020_05_01_preview.models.SkuVersion :ivar availability: Is SKU available. Possible values include: "Available", "Unavailable". - :vartype availability: str or ~azure.mgmt.databoxedge.models.SkuAvailability + :vartype availability: str or + ~azure.mgmt.databoxedge.v2020_05_01_preview.models.SkuAvailability """ _validation = { @@ -967,7 +976,7 @@ class DataBoxEdgeSkuList(msrest.serialization.Model): Variables are only populated by the server, and will be ignored when sending a request. :ivar value: List of ResourceType Sku. - :vartype value: list[~azure.mgmt.databoxedge.models.DataBoxEdgeSku] + :vartype value: list[~azure.mgmt.databoxedge.v2020_05_01_preview.models.DataBoxEdgeSku] :ivar next_link: Links to the next set of results. :vartype next_link: str """ @@ -1009,7 +1018,7 @@ class Trigger(ARMBaseModel): :vartype type: str :param kind: Required. Trigger Kind.Constant filled by server. Possible values include: "FileEvent", "PeriodicTimerEvent". - :type kind: str or ~azure.mgmt.databoxedge.models.TriggerEventType + :type kind: str or ~azure.mgmt.databoxedge.v2020_05_01_preview.models.TriggerEventType """ _validation = { @@ -1053,11 +1062,11 @@ class FileEventTrigger(Trigger): :vartype type: str :param kind: Required. Trigger Kind.Constant filled by server. Possible values include: "FileEvent", "PeriodicTimerEvent". - :type kind: str or ~azure.mgmt.databoxedge.models.TriggerEventType + :type kind: str or ~azure.mgmt.databoxedge.v2020_05_01_preview.models.TriggerEventType :param source_info: Required. File event source details. - :type source_info: ~azure.mgmt.databoxedge.models.FileSourceInfo + :type source_info: ~azure.mgmt.databoxedge.v2020_05_01_preview.models.FileSourceInfo :param sink_info: Required. Role sink info. - :type sink_info: ~azure.mgmt.databoxedge.models.RoleSinkInfo + :type sink_info: ~azure.mgmt.databoxedge.v2020_05_01_preview.models.RoleSinkInfo :param custom_context_tag: A custom context tag typically used to correlate the trigger against its usage. For example, if a periodic timer trigger is intended for certain specific IoT modules in the device, the tag can be the name or the image URL of the module. @@ -1135,7 +1144,7 @@ class ImageRepositoryCredential(msrest.serialization.Model): :param user_name: Required. Repository user name. :type user_name: str :param password: Repository user password. - :type password: ~azure.mgmt.databoxedge.models.AsymmetricEncryptedSecret + :type password: ~azure.mgmt.databoxedge.v2020_05_01_preview.models.AsymmetricEncryptedSecret """ _validation = { @@ -1175,7 +1184,7 @@ class IoTDeviceInfo(msrest.serialization.Model): :param io_t_host_hub_id: Id for the IoT hub associated to the device. :type io_t_host_hub_id: str :param authentication: Encrypted IoT device/IoT edge device connection string. - :type authentication: ~azure.mgmt.databoxedge.models.Authentication + :type authentication: ~azure.mgmt.databoxedge.v2020_05_01_preview.models.Authentication """ _validation = { @@ -1216,7 +1225,8 @@ class IoTEdgeAgentInfo(msrest.serialization.Model): :param tag: Required. Image Tag. :type tag: str :param image_repository: Image repository details. - :type image_repository: ~azure.mgmt.databoxedge.models.ImageRepositoryCredential + :type image_repository: + ~azure.mgmt.databoxedge.v2020_05_01_preview.models.ImageRepositoryCredential """ _validation = { @@ -1262,7 +1272,7 @@ class Role(ARMBaseModel): :vartype type: str :param kind: Required. Role type.Constant filled by server. Possible values include: "IOT", "ASA", "Functions", "Cognitive". - :type kind: str or ~azure.mgmt.databoxedge.models.RoleTypes + :type kind: str or ~azure.mgmt.databoxedge.v2020_05_01_preview.models.RoleTypes """ _validation = { @@ -1306,25 +1316,27 @@ class IoTRole(Role): :vartype type: str :param kind: Required. Role type.Constant filled by server. Possible values include: "IOT", "ASA", "Functions", "Cognitive". - :type kind: str or ~azure.mgmt.databoxedge.models.RoleTypes + :type kind: str or ~azure.mgmt.databoxedge.v2020_05_01_preview.models.RoleTypes :param host_platform: Host OS supported by the IoT role. Possible values include: "Windows", "Linux". - :type host_platform: str or ~azure.mgmt.databoxedge.models.PlatformType + :type host_platform: str or ~azure.mgmt.databoxedge.v2020_05_01_preview.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: ~azure.mgmt.databoxedge.models.IoTDeviceInfo + :type io_t_device_details: ~azure.mgmt.databoxedge.v2020_05_01_preview.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: ~azure.mgmt.databoxedge.models.IoTDeviceInfo + :type io_t_edge_device_details: + ~azure.mgmt.databoxedge.v2020_05_01_preview.models.IoTDeviceInfo :param share_mappings: Mount points of shares in role(s). - :type share_mappings: list[~azure.mgmt.databoxedge.models.MountPointMap] + :type share_mappings: list[~azure.mgmt.databoxedge.v2020_05_01_preview.models.MountPointMap] :param io_t_edge_agent_info: Iot edge agent details to download the agent and bootstrap iot runtime. - :type io_t_edge_agent_info: ~azure.mgmt.databoxedge.models.IoTEdgeAgentInfo + :type io_t_edge_agent_info: ~azure.mgmt.databoxedge.v2020_05_01_preview.models.IoTEdgeAgentInfo :ivar host_platform_type: Platform where the Iot runtime is hosted. Possible values include: "KubernetesCluster", "LinuxVM". - :vartype host_platform_type: str or ~azure.mgmt.databoxedge.models.HostPlatformType + :vartype host_platform_type: str or + ~azure.mgmt.databoxedge.v2020_05_01_preview.models.HostPlatformType :param role_status: Role status. Possible values include: "Enabled", "Disabled". - :type role_status: str or ~azure.mgmt.databoxedge.models.RoleStatus + :type role_status: str or ~azure.mgmt.databoxedge.v2020_05_01_preview.models.RoleStatus """ _validation = { @@ -1454,7 +1466,7 @@ class Job(msrest.serialization.Model): :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 ~azure.mgmt.databoxedge.models.JobStatus + :vartype status: str or ~azure.mgmt.databoxedge.v2020_05_01_preview.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. @@ -1462,19 +1474,22 @@ class Job(msrest.serialization.Model): :ivar percent_complete: The percentage of the job that is complete. :vartype percent_complete: int :ivar error: The error details. - :vartype error: ~azure.mgmt.databoxedge.models.JobErrorDetails + :vartype error: ~azure.mgmt.databoxedge.v2020_05_01_preview.models.JobErrorDetails :ivar job_type: The type of the job. Possible values include: "Invalid", "ScanForUpdates", "DownloadUpdates", "InstallUpdates", "RefreshShare", "RefreshContainer". - :vartype job_type: str or ~azure.mgmt.databoxedge.models.JobType + :vartype job_type: str or ~azure.mgmt.databoxedge.v2020_05_01_preview.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 ~azure.mgmt.databoxedge.models.UpdateOperationStage + :vartype current_stage: str or + ~azure.mgmt.databoxedge.v2020_05_01_preview.models.UpdateOperationStage :ivar download_progress: The download progress. - :vartype download_progress: ~azure.mgmt.databoxedge.models.UpdateDownloadProgress + :vartype download_progress: + ~azure.mgmt.databoxedge.v2020_05_01_preview.models.UpdateDownloadProgress :ivar install_progress: The install progress. - :vartype install_progress: ~azure.mgmt.databoxedge.models.UpdateInstallProgress + :vartype install_progress: + ~azure.mgmt.databoxedge.v2020_05_01_preview.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 @@ -1555,7 +1570,7 @@ class JobErrorDetails(msrest.serialization.Model): 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[~azure.mgmt.databoxedge.models.JobErrorItem] + :vartype error_details: list[~azure.mgmt.databoxedge.v2020_05_01_preview.models.JobErrorItem] :ivar code: The code intended for programmatic access. :vartype code: str :ivar message: The message that describes the error in detail. @@ -1661,23 +1676,25 @@ class MetricSpecificationV1(msrest.serialization.Model): :type display_description: str :param unit: Metric units. Possible values include: "NotSpecified", "Percent", "Count", "Seconds", "Milliseconds", "Bytes", "BytesPerSecond", "CountPerSecond". - :type unit: str or ~azure.mgmt.databoxedge.models.MetricUnit + :type unit: str or ~azure.mgmt.databoxedge.v2020_05_01_preview.models.MetricUnit :param aggregation_type: Metric aggregation type. Possible values include: "NotSpecified", "None", "Average", "Minimum", "Maximum", "Total", "Count". - :type aggregation_type: str or ~azure.mgmt.databoxedge.models.MetricAggregationType + :type aggregation_type: str or + ~azure.mgmt.databoxedge.v2020_05_01_preview.models.MetricAggregationType :param dimensions: Metric dimensions, other than default dimension which is resource. - :type dimensions: list[~azure.mgmt.databoxedge.models.MetricDimensionV1] + :type dimensions: list[~azure.mgmt.databoxedge.v2020_05_01_preview.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 ~azure.mgmt.databoxedge.models.MetricCategory + :type category: str or ~azure.mgmt.databoxedge.v2020_05_01_preview.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 ~azure.mgmt.databoxedge.models.TimeGrain] + :type supported_time_grain_types: list[str or + ~azure.mgmt.databoxedge.v2020_05_01_preview.models.TimeGrain] :param supported_aggregation_types: Support metric aggregation type. :type supported_aggregation_types: list[str or - ~azure.mgmt.databoxedge.models.MetricAggregationType] + ~azure.mgmt.databoxedge.v2020_05_01_preview.models.MetricAggregationType] """ _attribute_map = { @@ -1738,9 +1755,9 @@ class MountPointMap(msrest.serialization.Model): :ivar mount_point: Mount point for the share. :vartype mount_point: str :ivar mount_type: Mounting type. Possible values include: "Volume", "HostPath". - :vartype mount_type: str or ~azure.mgmt.databoxedge.models.MountType + :vartype mount_type: str or ~azure.mgmt.databoxedge.v2020_05_01_preview.models.MountType :ivar role_type: Role type. Possible values include: "IOT", "ASA", "Functions", "Cognitive". - :vartype role_type: str or ~azure.mgmt.databoxedge.models.RoleTypes + :vartype role_type: str or ~azure.mgmt.databoxedge.v2020_05_01_preview.models.RoleTypes """ _validation = { @@ -1781,7 +1798,8 @@ class NetworkAdapter(msrest.serialization.Model): :ivar adapter_id: Instance ID of network adapter. :vartype adapter_id: str :ivar adapter_position: Hardware position of network adapter. - :vartype adapter_position: ~azure.mgmt.databoxedge.models.NetworkAdapterPosition + :vartype adapter_position: + ~azure.mgmt.databoxedge.v2020_05_01_preview.models.NetworkAdapterPosition :ivar index: Logical index of the adapter. :vartype index: int :ivar node_id: Node ID of the network adapter. @@ -1796,17 +1814,19 @@ class NetworkAdapter(msrest.serialization.Model): :vartype link_speed: long :ivar status: Value indicating whether this adapter is valid. Possible values include: "Inactive", "Active". - :vartype status: str or ~azure.mgmt.databoxedge.models.NetworkAdapterStatus + :vartype status: str or ~azure.mgmt.databoxedge.v2020_05_01_preview.models.NetworkAdapterStatus :param rdma_status: Value indicating whether this adapter is RDMA capable. Possible values include: "Incapable", "Capable". - :type rdma_status: str or ~azure.mgmt.databoxedge.models.NetworkAdapterRDMAStatus + :type rdma_status: str or + ~azure.mgmt.databoxedge.v2020_05_01_preview.models.NetworkAdapterRDMAStatus :param dhcp_status: Value indicating whether this adapter has DHCP enabled. Possible values include: "Disabled", "Enabled". - :type dhcp_status: str or ~azure.mgmt.databoxedge.models.NetworkAdapterDHCPStatus + :type dhcp_status: str or + ~azure.mgmt.databoxedge.v2020_05_01_preview.models.NetworkAdapterDHCPStatus :ivar ipv4_configuration: The IPv4 configuration of the network adapter. - :vartype ipv4_configuration: ~azure.mgmt.databoxedge.models.Ipv4Config + :vartype ipv4_configuration: ~azure.mgmt.databoxedge.v2020_05_01_preview.models.Ipv4Config :ivar ipv6_configuration: The IPv6 configuration of the network adapter. - :vartype ipv6_configuration: ~azure.mgmt.databoxedge.models.Ipv6Config + :vartype ipv6_configuration: ~azure.mgmt.databoxedge.v2020_05_01_preview.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. @@ -1878,7 +1898,7 @@ class NetworkAdapterPosition(msrest.serialization.Model): 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 ~azure.mgmt.databoxedge.models.NetworkGroup + :vartype network_group: str or ~azure.mgmt.databoxedge.v2020_05_01_preview.models.NetworkGroup :ivar port: The port. :vartype port: int """ @@ -1914,7 +1934,8 @@ class NetworkSettings(ARMBaseModel): :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[~azure.mgmt.databoxedge.models.NetworkAdapter] + :vartype network_adapters: + list[~azure.mgmt.databoxedge.v2020_05_01_preview.models.NetworkAdapter] """ _validation = { @@ -1954,7 +1975,7 @@ class Node(ARMBaseModel): :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 ~azure.mgmt.databoxedge.models.NodeStatus + :vartype node_status: str or ~azure.mgmt.databoxedge.v2020_05_01_preview.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. @@ -2016,7 +2037,7 @@ class NodeList(msrest.serialization.Model): Variables are only populated by the server, and will be ignored when sending a request. :ivar value: The list of Nodes. - :vartype value: list[~azure.mgmt.databoxedge.models.Node] + :vartype value: list[~azure.mgmt.databoxedge.v2020_05_01_preview.models.Node] """ _validation = { @@ -2041,11 +2062,12 @@ class Operation(msrest.serialization.Model): :param name: Name of the operation. :type name: str :param display: Properties displayed for the operation. - :type display: ~azure.mgmt.databoxedge.models.OperationDisplay + :type display: ~azure.mgmt.databoxedge.v2020_05_01_preview.models.OperationDisplay :param origin: Origin of the operation. :type origin: str :param service_specification: Service specification. - :type service_specification: ~azure.mgmt.databoxedge.models.ServiceSpecification + :type service_specification: + ~azure.mgmt.databoxedge.v2020_05_01_preview.models.ServiceSpecification """ _attribute_map = { @@ -2113,7 +2135,7 @@ class OperationsList(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. :param value: Required. The value. - :type value: list[~azure.mgmt.databoxedge.models.Operation] + :type value: list[~azure.mgmt.databoxedge.v2020_05_01_preview.models.Operation] :param next_link: Link to the next set of results. :type next_link: str """ @@ -2151,21 +2173,23 @@ class Order(ARMBaseModel): :ivar type: The hierarchical type of the object. :vartype type: str :param contact_information: The contact details. - :type contact_information: ~azure.mgmt.databoxedge.models.ContactDetails + :type contact_information: ~azure.mgmt.databoxedge.v2020_05_01_preview.models.ContactDetails :param shipping_address: The shipping address. - :type shipping_address: ~azure.mgmt.databoxedge.models.Address + :type shipping_address: ~azure.mgmt.databoxedge.v2020_05_01_preview.models.Address :param current_status: Current status of the order. - :type current_status: ~azure.mgmt.databoxedge.models.OrderStatus + :type current_status: ~azure.mgmt.databoxedge.v2020_05_01_preview.models.OrderStatus :ivar order_history: List of status changes in the order. - :vartype order_history: list[~azure.mgmt.databoxedge.models.OrderStatus] + :vartype order_history: list[~azure.mgmt.databoxedge.v2020_05_01_preview.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[~azure.mgmt.databoxedge.models.TrackingInfo] + :vartype delivery_tracking_info: + list[~azure.mgmt.databoxedge.v2020_05_01_preview.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[~azure.mgmt.databoxedge.models.TrackingInfo] + :vartype return_tracking_info: + list[~azure.mgmt.databoxedge.v2020_05_01_preview.models.TrackingInfo] """ _validation = { @@ -2215,7 +2239,7 @@ class OrderList(msrest.serialization.Model): Variables are only populated by the server, and will be ignored when sending a request. :ivar value: The list of orders. - :vartype value: list[~azure.mgmt.databoxedge.models.Order] + :vartype value: list[~azure.mgmt.databoxedge.v2020_05_01_preview.models.Order] :ivar next_link: Link to the next set of results. :vartype next_link: str """ @@ -2250,7 +2274,7 @@ class OrderStatus(msrest.serialization.Model): include: "Untracked", "AwaitingFulfilment", "AwaitingPreparation", "AwaitingShipment", "Shipped", "Arriving", "Delivered", "ReplacementRequested", "LostDevice", "Declined", "ReturnInitiated", "AwaitingReturnShipment", "ShippedBack", "CollectedAtMicrosoft". - :type status: str or ~azure.mgmt.databoxedge.models.OrderState + :type status: str or ~azure.mgmt.databoxedge.v2020_05_01_preview.models.OrderState :ivar update_date_time: Time of status update. :vartype update_date_time: ~datetime.datetime :param comments: Comments related to this status change. @@ -2302,11 +2326,11 @@ class PeriodicTimerEventTrigger(Trigger): :vartype type: str :param kind: Required. Trigger Kind.Constant filled by server. Possible values include: "FileEvent", "PeriodicTimerEvent". - :type kind: str or ~azure.mgmt.databoxedge.models.TriggerEventType + :type kind: str or ~azure.mgmt.databoxedge.v2020_05_01_preview.models.TriggerEventType :param source_info: Required. Periodic timer details. - :type source_info: ~azure.mgmt.databoxedge.models.PeriodicTimerSourceInfo + :type source_info: ~azure.mgmt.databoxedge.v2020_05_01_preview.models.PeriodicTimerSourceInfo :param sink_info: Required. Role Sink information. - :type sink_info: ~azure.mgmt.databoxedge.models.RoleSinkInfo + :type sink_info: ~azure.mgmt.databoxedge.v2020_05_01_preview.models.RoleSinkInfo :param custom_context_tag: A custom context tag typically used to correlate the trigger against its usage. For example, if a periodic timer trigger is intended for certain specific IoT modules in the device, the tag can be the name or the image URL of the module. @@ -2441,11 +2465,11 @@ class ResourceTypeSku(msrest.serialization.Model): :ivar name: The Sku name. Possible values include: "Gateway", "Edge", "TEA_1Node", "TEA_1Node_UPS", "TEA_1Node_Heater", "TEA_1Node_UPS_Heater", "TEA_4Node_Heater", "TEA_4Node_UPS_Heater", "TMA", "TDC", "TCA_Large", "TCA_Small", "GPU". - :vartype name: str or ~azure.mgmt.databoxedge.models.SkuName + :vartype name: str or ~azure.mgmt.databoxedge.v2020_05_01_preview.models.SkuName :ivar kind: The Sku kind. :vartype kind: str :ivar tier: The Sku tier. Possible values include: "Standard". - :vartype tier: str or ~azure.mgmt.databoxedge.models.SkuTier + :vartype tier: str or ~azure.mgmt.databoxedge.v2020_05_01_preview.models.SkuTier :ivar family: The Sku family. :vartype family: str :ivar locations: Availability of the SKU for the region. @@ -2453,11 +2477,12 @@ class ResourceTypeSku(msrest.serialization.Model): :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[~azure.mgmt.databoxedge.models.SkuLocationInfo] + :vartype location_info: + list[~azure.mgmt.databoxedge.v2020_05_01_preview.models.SkuLocationInfo] :ivar costs: The pricing info of the Sku. - :vartype costs: list[~azure.mgmt.databoxedge.models.SkuCost] + :vartype costs: list[~azure.mgmt.databoxedge.v2020_05_01_preview.models.SkuCost] :ivar restrictions: Restrictions of the SKU availability. - :vartype restrictions: list[~azure.mgmt.databoxedge.models.SkuRestriction] + :vartype restrictions: list[~azure.mgmt.databoxedge.v2020_05_01_preview.models.SkuRestriction] """ _validation = { @@ -2509,7 +2534,7 @@ class RoleList(msrest.serialization.Model): Variables are only populated by the server, and will be ignored when sending a request. :ivar value: The Value. - :vartype value: list[~azure.mgmt.databoxedge.models.Role] + :vartype value: list[~azure.mgmt.databoxedge.v2020_05_01_preview.models.Role] :ivar next_link: Link to the next set of results. :vartype next_link: str """ @@ -2577,7 +2602,8 @@ class SecuritySettings(ARMBaseModel): (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: ~azure.mgmt.databoxedge.models.AsymmetricEncryptedSecret + :type device_admin_password: + ~azure.mgmt.databoxedge.v2020_05_01_preview.models.AsymmetricEncryptedSecret """ _validation = { @@ -2608,7 +2634,8 @@ class ServiceSpecification(msrest.serialization.Model): """Service specification. :param metric_specifications: Metric specification as defined by shoebox. - :type metric_specifications: list[~azure.mgmt.databoxedge.models.MetricSpecificationV1] + :type metric_specifications: + list[~azure.mgmt.databoxedge.v2020_05_01_preview.models.MetricSpecificationV1] """ _attribute_map = { @@ -2642,27 +2669,32 @@ class Share(ARMBaseModel): :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 ~azure.mgmt.databoxedge.models.ShareStatus + :type share_status: str or ~azure.mgmt.databoxedge.v2020_05_01_preview.models.ShareStatus :param monitoring_status: Required. Current monitoring status of the share. Possible values include: "Enabled", "Disabled". - :type monitoring_status: str or ~azure.mgmt.databoxedge.models.MonitoringStatus + :type monitoring_status: str or + ~azure.mgmt.databoxedge.v2020_05_01_preview.models.MonitoringStatus :param azure_container_info: Azure container mapping for the share. - :type azure_container_info: ~azure.mgmt.databoxedge.models.AzureContainerInfo + :type azure_container_info: + ~azure.mgmt.databoxedge.v2020_05_01_preview.models.AzureContainerInfo :param access_protocol: Required. Access protocol to be used by the share. Possible values include: "SMB", "NFS". - :type access_protocol: str or ~azure.mgmt.databoxedge.models.ShareAccessProtocol + :type access_protocol: str or + ~azure.mgmt.databoxedge.v2020_05_01_preview.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[~azure.mgmt.databoxedge.models.UserAccessRight] + :type user_access_rights: + list[~azure.mgmt.databoxedge.v2020_05_01_preview.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[~azure.mgmt.databoxedge.models.ClientAccessRight] + :type client_access_rights: + list[~azure.mgmt.databoxedge.v2020_05_01_preview.models.ClientAccessRight] :param refresh_details: Details of the refresh job on this share. - :type refresh_details: ~azure.mgmt.databoxedge.models.RefreshDetails + :type refresh_details: ~azure.mgmt.databoxedge.v2020_05_01_preview.models.RefreshDetails :ivar share_mappings: Share mount point to the role. - :vartype share_mappings: list[~azure.mgmt.databoxedge.models.MountPointMap] + :vartype share_mappings: list[~azure.mgmt.databoxedge.v2020_05_01_preview.models.MountPointMap] :param data_policy: Data policy of the share. Possible values include: "Cloud", "Local". - :type data_policy: str or ~azure.mgmt.databoxedge.models.DataPolicy + :type data_policy: str or ~azure.mgmt.databoxedge.v2020_05_01_preview.models.DataPolicy """ _validation = { @@ -2727,7 +2759,7 @@ class ShareAccessRight(msrest.serialization.Model): :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 ~azure.mgmt.databoxedge.models.ShareAccessType + :type access_type: str or ~azure.mgmt.databoxedge.v2020_05_01_preview.models.ShareAccessType """ _validation = { @@ -2758,7 +2790,7 @@ class ShareList(msrest.serialization.Model): Variables are only populated by the server, and will be ignored when sending a request. :ivar value: The list of shares. - :vartype value: list[~azure.mgmt.databoxedge.models.Share] + :vartype value: list[~azure.mgmt.databoxedge.v2020_05_01_preview.models.Share] :ivar next_link: Link to the next set of results. :vartype next_link: str """ @@ -2788,9 +2820,9 @@ class Sku(msrest.serialization.Model): :param name: SKU name. Possible values include: "Gateway", "Edge", "TEA_1Node", "TEA_1Node_UPS", "TEA_1Node_Heater", "TEA_1Node_UPS_Heater", "TEA_4Node_Heater", "TEA_4Node_UPS_Heater", "TMA", "TDC", "TCA_Large", "TCA_Small", "GPU". - :type name: str or ~azure.mgmt.databoxedge.models.SkuName + :type name: str or ~azure.mgmt.databoxedge.v2020_05_01_preview.models.SkuName :param tier: The SKU tier. This is based on the SKU name. Possible values include: "Standard". - :type tier: str or ~azure.mgmt.databoxedge.models.SkuTier + :type tier: str or ~azure.mgmt.databoxedge.v2020_05_01_preview.models.SkuTier """ _attribute_map = { @@ -2895,15 +2927,16 @@ class SkuInformation(msrest.serialization.Model): :ivar locations: The locations where Sku is available. :vartype locations: list[str] :ivar location_info: The locations where Sku is available with zones and sites info. - :vartype location_info: list[~azure.mgmt.databoxedge.models.SkuLocationInfo] + :vartype location_info: + list[~azure.mgmt.databoxedge.v2020_05_01_preview.models.SkuLocationInfo] :ivar required_quota_ids: The required quotaIds for the sku to be available. :vartype required_quota_ids: list[str] :ivar required_features: The required features for the sku to be available. :vartype required_features: list[str] :ivar costs: The cost of the SKU. - :vartype costs: list[~azure.mgmt.databoxedge.models.SkuCost] + :vartype costs: list[~azure.mgmt.databoxedge.v2020_05_01_preview.models.SkuCost] :ivar capabilities: The capabilities of the SKU. - :vartype capabilities: list[~azure.mgmt.databoxedge.models.SKUCapability] + :vartype capabilities: list[~azure.mgmt.databoxedge.v2020_05_01_preview.models.SKUCapability] """ _validation = { @@ -2961,7 +2994,7 @@ class SkuInformationList(msrest.serialization.Model): Variables are only populated by the server, and will be ignored when sending a request. :ivar value: List of ResourceType Sku. - :vartype value: list[~azure.mgmt.databoxedge.models.ResourceTypeSku] + :vartype value: list[~azure.mgmt.databoxedge.v2020_05_01_preview.models.ResourceTypeSku] :ivar next_link: Links to the next set of results. :vartype next_link: str """ @@ -3031,9 +3064,11 @@ class SkuRestriction(msrest.serialization.Model): :vartype values: list[str] :ivar reason_code: The SKU restriction reason. Possible values include: "NotAvailableForSubscription", "QuotaId". - :vartype reason_code: str or ~azure.mgmt.databoxedge.models.SkuRestrictionReasonCode + :vartype reason_code: str or + ~azure.mgmt.databoxedge.v2020_05_01_preview.models.SkuRestrictionReasonCode :ivar restriction_info: Restriction of the SKU for the location/zone. - :vartype restriction_info: ~azure.mgmt.databoxedge.models.SkuRestrictionInfo + :vartype restriction_info: + ~azure.mgmt.databoxedge.v2020_05_01_preview.models.SkuRestrictionInfo """ _validation = { @@ -3106,10 +3141,11 @@ class StorageAccount(ARMBaseModel): :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 ~azure.mgmt.databoxedge.models.StorageAccountStatus + :type storage_account_status: str or + ~azure.mgmt.databoxedge.v2020_05_01_preview.models.StorageAccountStatus :param data_policy: Data policy of the storage Account. Possible values include: "Cloud", "Local". - :type data_policy: str or ~azure.mgmt.databoxedge.models.DataPolicy + :type data_policy: str or ~azure.mgmt.databoxedge.v2020_05_01_preview.models.DataPolicy :param storage_account_credential_id: Storage Account Credential Id. :type storage_account_credential_id: str :ivar blob_endpoint: BlobEndpoint of Storage Account. @@ -3175,18 +3211,18 @@ class StorageAccountCredential(ARMBaseModel): :param user_name: Username for the storage account. :type user_name: str :param account_key: Encrypted storage key. - :type account_key: ~azure.mgmt.databoxedge.models.AsymmetricEncryptedSecret + :type account_key: ~azure.mgmt.databoxedge.v2020_05_01_preview.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 ~azure.mgmt.databoxedge.models.SSLStatus + :type ssl_status: str or ~azure.mgmt.databoxedge.v2020_05_01_preview.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 ~azure.mgmt.databoxedge.models.AccountType + :type account_type: str or ~azure.mgmt.databoxedge.v2020_05_01_preview.models.AccountType :param storage_account_id: Id of the storage account. :type storage_account_id: str """ @@ -3244,7 +3280,8 @@ class StorageAccountCredentialList(msrest.serialization.Model): Variables are only populated by the server, and will be ignored when sending a request. :ivar value: The value. - :vartype value: list[~azure.mgmt.databoxedge.models.StorageAccountCredential] + :vartype value: + list[~azure.mgmt.databoxedge.v2020_05_01_preview.models.StorageAccountCredential] :ivar next_link: Link to the next set of results. :vartype next_link: str """ @@ -3274,7 +3311,7 @@ class StorageAccountList(msrest.serialization.Model): Variables are only populated by the server, and will be ignored when sending a request. :ivar value: The list of storageAccounts. - :vartype value: list[~azure.mgmt.databoxedge.models.StorageAccount] + :vartype value: list[~azure.mgmt.databoxedge.v2020_05_01_preview.models.StorageAccount] :ivar next_link: Link to the next set of results. :vartype next_link: str """ @@ -3302,7 +3339,8 @@ class SymmetricKey(msrest.serialization.Model): """Symmetric key for authentication. :param connection_string: Connection string based on the symmetric key. - :type connection_string: ~azure.mgmt.databoxedge.models.AsymmetricEncryptedSecret + :type connection_string: + ~azure.mgmt.databoxedge.v2020_05_01_preview.models.AsymmetricEncryptedSecret """ _attribute_map = { @@ -3361,7 +3399,7 @@ class TriggerList(msrest.serialization.Model): Variables are only populated by the server, and will be ignored when sending a request. :ivar value: The list of triggers. - :vartype value: list[~azure.mgmt.databoxedge.models.Trigger] + :vartype value: list[~azure.mgmt.databoxedge.v2020_05_01_preview.models.Trigger] :ivar next_link: Link to the next set of results. :vartype next_link: str """ @@ -3392,7 +3430,8 @@ class UpdateDownloadProgress(msrest.serialization.Model): :ivar download_phase: The download phase. Possible values include: "Unknown", "Initializing", "Downloading", "Verifying". - :vartype download_phase: str or ~azure.mgmt.databoxedge.models.DownloadPhase + :vartype download_phase: str or + ~azure.mgmt.databoxedge.v2020_05_01_preview.models.DownloadPhase :ivar percent_complete: Percentage of completion. :vartype percent_complete: int :ivar total_bytes_to_download: Total bytes to download. @@ -3506,10 +3545,12 @@ class UpdateSummary(ARMBaseModel): :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 ~azure.mgmt.databoxedge.models.InstallRebootBehavior + :vartype reboot_behavior: str or + ~azure.mgmt.databoxedge.v2020_05_01_preview.models.InstallRebootBehavior :ivar ongoing_update_operation: The current update operation. Possible values include: "None", "Scan", "Download", "Install". - :vartype ongoing_update_operation: str or ~azure.mgmt.databoxedge.models.UpdateOperation + :vartype ongoing_update_operation: str or + ~azure.mgmt.databoxedge.v2020_05_01_preview.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. @@ -3604,7 +3645,8 @@ class UploadCertificateRequest(msrest.serialization.Model): :param authentication_type: The authentication type. Possible values include: "Invalid", "AzureActiveDirectory". - :type authentication_type: str or ~azure.mgmt.databoxedge.models.AuthenticationType + :type authentication_type: str or + ~azure.mgmt.databoxedge.v2020_05_01_preview.models.AuthenticationType :param certificate: Required. The base64 encoded certificate raw data. :type certificate: str """ @@ -3637,7 +3679,7 @@ class UploadCertificateResponse(msrest.serialization.Model): :param auth_type: Specifies authentication type. Possible values include: "Invalid", "AzureActiveDirectory". - :type auth_type: str or ~azure.mgmt.databoxedge.models.AuthenticationType + :type auth_type: str or ~azure.mgmt.databoxedge.v2020_05_01_preview.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. @@ -3707,13 +3749,15 @@ class User(ARMBaseModel): :ivar type: The hierarchical type of the object. :vartype type: str :param encrypted_password: The password details. - :type encrypted_password: ~azure.mgmt.databoxedge.models.AsymmetricEncryptedSecret + :type encrypted_password: + ~azure.mgmt.databoxedge.v2020_05_01_preview.models.AsymmetricEncryptedSecret :ivar share_access_rights: List of shares that the user has rights on. This field should not be specified during user creation. - :vartype share_access_rights: list[~azure.mgmt.databoxedge.models.ShareAccessRight] + :vartype share_access_rights: + list[~azure.mgmt.databoxedge.v2020_05_01_preview.models.ShareAccessRight] :param user_type: Required. Type of the user. Possible values include: "Share", "LocalManagement", "ARM". - :type user_type: str or ~azure.mgmt.databoxedge.models.UserType + :type user_type: str or ~azure.mgmt.databoxedge.v2020_05_01_preview.models.UserType """ _validation = { @@ -3755,7 +3799,7 @@ class UserAccessRight(msrest.serialization.Model): :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 ~azure.mgmt.databoxedge.models.ShareAccessType + :type access_type: str or ~azure.mgmt.databoxedge.v2020_05_01_preview.models.ShareAccessType """ _validation = { @@ -3786,7 +3830,7 @@ class UserList(msrest.serialization.Model): Variables are only populated by the server, and will be ignored when sending a request. :ivar value: The list of users. - :vartype value: list[~azure.mgmt.databoxedge.models.User] + :vartype value: list[~azure.mgmt.databoxedge.v2020_05_01_preview.models.User] :ivar next_link: Link to the next set of results. :vartype next_link: str """ diff --git a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_05_01_preview/operations/_alerts_operations.py b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_05_01_preview/operations/_alerts_operations.py index 8389c476100e..1c1362f56b1f 100644 --- a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_05_01_preview/operations/_alerts_operations.py +++ b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_05_01_preview/operations/_alerts_operations.py @@ -30,7 +30,7 @@ class AlertsOperations(object): instantiates it for you and attaches it as an attribute. :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.databoxedge.models + :type models: ~azure.mgmt.databoxedge.v2020_05_01_preview.models :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. @@ -60,7 +60,7 @@ def list_by_data_box_edge_device( :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[~azure.mgmt.databoxedge.models.AlertList] + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.databoxedge.v2020_05_01_preview.models.AlertList] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.AlertList"] @@ -140,7 +140,7 @@ def get( :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: ~azure.mgmt.databoxedge.models.Alert + :rtype: ~azure.mgmt.databoxedge.v2020_05_01_preview.models.Alert :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.Alert"] diff --git a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_05_01_preview/operations/_available_skus_operations.py b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_05_01_preview/operations/_available_skus_operations.py index b8ecebaae9f2..01d14b89253e 100644 --- a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_05_01_preview/operations/_available_skus_operations.py +++ b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_05_01_preview/operations/_available_skus_operations.py @@ -30,7 +30,7 @@ class AvailableSkusOperations(object): instantiates it for you and attaches it as an attribute. :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.databoxedge.models + :type models: ~azure.mgmt.databoxedge.v2020_05_01_preview.models :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. @@ -56,7 +56,7 @@ def list( :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either DataBoxEdgeSkuList or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.databoxedge.models.DataBoxEdgeSkuList] + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.databoxedge.v2020_05_01_preview.models.DataBoxEdgeSkuList] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.DataBoxEdgeSkuList"] diff --git a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_05_01_preview/operations/_bandwidth_schedules_operations.py b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_05_01_preview/operations/_bandwidth_schedules_operations.py index 29029559d82e..b827a2edab30 100644 --- a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_05_01_preview/operations/_bandwidth_schedules_operations.py +++ b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_05_01_preview/operations/_bandwidth_schedules_operations.py @@ -32,7 +32,7 @@ class BandwidthSchedulesOperations(object): instantiates it for you and attaches it as an attribute. :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.databoxedge.models + :type models: ~azure.mgmt.databoxedge.v2020_05_01_preview.models :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. @@ -62,7 +62,7 @@ def list_by_data_box_edge_device( :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[~azure.mgmt.databoxedge.models.BandwidthSchedulesList] + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.databoxedge.v2020_05_01_preview.models.BandwidthSchedulesList] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.BandwidthSchedulesList"] @@ -140,7 +140,7 @@ def get( :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: ~azure.mgmt.databoxedge.models.BandwidthSchedule + :rtype: ~azure.mgmt.databoxedge.v2020_05_01_preview.models.BandwidthSchedule :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.BandwidthSchedule"] @@ -261,15 +261,15 @@ def begin_create_or_update( :param resource_group_name: The resource group name. :type resource_group_name: str :param parameters: The bandwidth schedule to be added or updated. - :type parameters: ~azure.mgmt.databoxedge.models.BandwidthSchedule + :type parameters: ~azure.mgmt.databoxedge.v2020_05_01_preview.models.BandwidthSchedule :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: True for ARMPolling, False for no polling, or a - polling object for personal polling strategy + :keyword polling: Pass in True if you'd like the ARMPolling polling method, + False for no polling, or your own initialized polling object for a 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[~azure.mgmt.databoxedge.models.BandwidthSchedule] + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.databoxedge.v2020_05_01_preview.models.BandwidthSchedule] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] @@ -385,8 +385,8 @@ def begin_delete( :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 + :keyword polling: Pass in True if you'd like the ARMPolling polling method, + False for no polling, or your own initialized polling object for a 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) diff --git a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_05_01_preview/operations/_containers_operations.py b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_05_01_preview/operations/_containers_operations.py index 27b68e1363d8..a73b349932d3 100644 --- a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_05_01_preview/operations/_containers_operations.py +++ b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_05_01_preview/operations/_containers_operations.py @@ -32,7 +32,7 @@ class ContainersOperations(object): instantiates it for you and attaches it as an attribute. :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.databoxedge.models + :type models: ~azure.mgmt.databoxedge.v2020_05_01_preview.models :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. @@ -67,7 +67,7 @@ def list_by_storage_account( :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[~azure.mgmt.databoxedge.models.ContainerList] + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.databoxedge.v2020_05_01_preview.models.ContainerList] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.ContainerList"] @@ -151,7 +151,7 @@ def get( :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: ~azure.mgmt.databoxedge.models.Container + :rtype: ~azure.mgmt.databoxedge.v2020_05_01_preview.models.Container :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.Container"] @@ -280,15 +280,15 @@ def begin_create_or_update( :param resource_group_name: The resource group name. :type resource_group_name: str :param container: The container properties. - :type container: ~azure.mgmt.databoxedge.models.Container + :type container: ~azure.mgmt.databoxedge.v2020_05_01_preview.models.Container :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: True for ARMPolling, False for no polling, or a - polling object for personal polling strategy + :keyword polling: Pass in True if you'd like the ARMPolling polling method, + False for no polling, or your own initialized polling object for a 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[~azure.mgmt.databoxedge.models.Container] + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.databoxedge.v2020_05_01_preview.models.Container] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] @@ -411,8 +411,8 @@ def begin_delete( :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 + :keyword polling: Pass in True if you'd like the ARMPolling polling method, + False for no polling, or your own initialized polling object for a 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) @@ -537,8 +537,8 @@ def begin_refresh( :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 + :keyword polling: Pass in True if you'd like the ARMPolling polling method, + False for no polling, or your own initialized polling object for a 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) diff --git a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_05_01_preview/operations/_devices_operations.py b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_05_01_preview/operations/_devices_operations.py index 1342af6402e6..884339fc563c 100644 --- a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_05_01_preview/operations/_devices_operations.py +++ b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_05_01_preview/operations/_devices_operations.py @@ -32,7 +32,7 @@ class DevicesOperations(object): instantiates it for you and attaches it as an attribute. :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.databoxedge.models + :type models: ~azure.mgmt.databoxedge.v2020_05_01_preview.models :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. @@ -60,7 +60,7 @@ def list_by_subscription( :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[~azure.mgmt.databoxedge.models.DataBoxEdgeDeviceList] + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.databoxedge.v2020_05_01_preview.models.DataBoxEdgeDeviceList] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.DataBoxEdgeDeviceList"] @@ -136,7 +136,7 @@ def list_by_resource_group( :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[~azure.mgmt.databoxedge.models.DataBoxEdgeDeviceList] + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.databoxedge.v2020_05_01_preview.models.DataBoxEdgeDeviceList] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.DataBoxEdgeDeviceList"] @@ -212,7 +212,7 @@ def get( :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: ~azure.mgmt.databoxedge.models.DataBoxEdgeDevice + :rtype: ~azure.mgmt.databoxedge.v2020_05_01_preview.models.DataBoxEdgeDevice :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.DataBoxEdgeDevice"] @@ -325,15 +325,15 @@ def begin_create_or_update( :param resource_group_name: The resource group name. :type resource_group_name: str :param data_box_edge_device: The resource object. - :type data_box_edge_device: ~azure.mgmt.databoxedge.models.DataBoxEdgeDevice + :type data_box_edge_device: ~azure.mgmt.databoxedge.v2020_05_01_preview.models.DataBoxEdgeDevice :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 + :keyword polling: Pass in True if you'd like the ARMPolling polling method, + False for no polling, or your own initialized polling object for a 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[~azure.mgmt.databoxedge.models.DataBoxEdgeDevice] + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.databoxedge.v2020_05_01_preview.models.DataBoxEdgeDevice] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] @@ -442,8 +442,8 @@ def begin_delete( :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 + :keyword polling: Pass in True if you'd like the ARMPolling polling method, + False for no polling, or your own initialized polling object for a 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) @@ -507,10 +507,10 @@ def update( :param resource_group_name: The resource group name. :type resource_group_name: str :param parameters: The resource parameters. - :type parameters: ~azure.mgmt.databoxedge.models.DataBoxEdgeDevicePatch + :type parameters: ~azure.mgmt.databoxedge.v2020_05_01_preview.models.DataBoxEdgeDevicePatch :keyword callable cls: A custom type or function that will be passed the direct response :return: DataBoxEdgeDevice, or the result of cls(response) - :rtype: ~azure.mgmt.databoxedge.models.DataBoxEdgeDevice + :rtype: ~azure.mgmt.databoxedge.v2020_05_01_preview.models.DataBoxEdgeDevice :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.DataBoxEdgeDevice"] @@ -621,8 +621,8 @@ def begin_download_updates( :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 + :keyword polling: Pass in True if you'd like the ARMPolling polling method, + False for no polling, or your own initialized polling object for a 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) @@ -686,7 +686,7 @@ def get_extended_information( :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: ~azure.mgmt.databoxedge.models.DataBoxEdgeDeviceExtendedInfo + :rtype: ~azure.mgmt.databoxedge.v2020_05_01_preview.models.DataBoxEdgeDeviceExtendedInfo :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.DataBoxEdgeDeviceExtendedInfo"] @@ -792,8 +792,8 @@ def begin_install_updates( :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 + :keyword polling: Pass in True if you'd like the ARMPolling polling method, + False for no polling, or your own initialized polling object for a 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) @@ -857,7 +857,7 @@ def get_network_settings( :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: ~azure.mgmt.databoxedge.models.NetworkSettings + :rtype: ~azure.mgmt.databoxedge.v2020_05_01_preview.models.NetworkSettings :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkSettings"] @@ -963,8 +963,8 @@ def begin_scan_for_updates( :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 + :keyword polling: Pass in True if you'd like the ARMPolling polling method, + False for no polling, or your own initialized polling object for a 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) @@ -1079,11 +1079,11 @@ def begin_create_or_update_security_settings( :param resource_group_name: The resource group name. :type resource_group_name: str :param security_settings: The security settings. - :type security_settings: ~azure.mgmt.databoxedge.models.SecuritySettings + :type security_settings: ~azure.mgmt.databoxedge.v2020_05_01_preview.models.SecuritySettings :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: True for ARMPolling, False for no polling, or a - polling object for personal polling strategy + :keyword polling: Pass in True if you'd like the ARMPolling polling method, + False for no polling, or your own initialized polling object for a 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) @@ -1151,7 +1151,7 @@ def get_update_summary( :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: ~azure.mgmt.databoxedge.models.UpdateSummary + :rtype: ~azure.mgmt.databoxedge.v2020_05_01_preview.models.UpdateSummary :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.UpdateSummary"] @@ -1210,10 +1210,10 @@ def upload_certificate( :param resource_group_name: The resource group name. :type resource_group_name: str :param parameters: The upload certificate request. - :type parameters: ~azure.mgmt.databoxedge.models.UploadCertificateRequest + :type parameters: ~azure.mgmt.databoxedge.v2020_05_01_preview.models.UploadCertificateRequest :keyword callable cls: A custom type or function that will be passed the direct response :return: UploadCertificateResponse, or the result of cls(response) - :rtype: ~azure.mgmt.databoxedge.models.UploadCertificateResponse + :rtype: ~azure.mgmt.databoxedge.v2020_05_01_preview.models.UploadCertificateResponse :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.UploadCertificateResponse"] diff --git a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_05_01_preview/operations/_jobs_operations.py b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_05_01_preview/operations/_jobs_operations.py index 32fe4d85b897..1eac9900ad85 100644 --- a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_05_01_preview/operations/_jobs_operations.py +++ b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_05_01_preview/operations/_jobs_operations.py @@ -29,7 +29,7 @@ class JobsOperations(object): instantiates it for you and attaches it as an attribute. :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.databoxedge.models + :type models: ~azure.mgmt.databoxedge.v2020_05_01_preview.models :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. @@ -64,7 +64,7 @@ def get( :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: ~azure.mgmt.databoxedge.models.Job + :rtype: ~azure.mgmt.databoxedge.v2020_05_01_preview.models.Job :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.Job"] diff --git a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_05_01_preview/operations/_nodes_operations.py b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_05_01_preview/operations/_nodes_operations.py index a3437b97714e..5e672337610e 100644 --- a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_05_01_preview/operations/_nodes_operations.py +++ b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_05_01_preview/operations/_nodes_operations.py @@ -30,7 +30,7 @@ class NodesOperations(object): instantiates it for you and attaches it as an attribute. :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.databoxedge.models + :type models: ~azure.mgmt.databoxedge.v2020_05_01_preview.models :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. @@ -60,7 +60,7 @@ def list_by_data_box_edge_device( :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[~azure.mgmt.databoxedge.models.NodeList] + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.databoxedge.v2020_05_01_preview.models.NodeList] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.NodeList"] diff --git a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_05_01_preview/operations/_operations.py b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_05_01_preview/operations/_operations.py index 84e6342b8ad7..75fddac15261 100644 --- a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_05_01_preview/operations/_operations.py +++ b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_05_01_preview/operations/_operations.py @@ -30,7 +30,7 @@ class Operations(object): instantiates it for you and attaches it as an attribute. :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.databoxedge.models + :type models: ~azure.mgmt.databoxedge.v2020_05_01_preview.models :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. @@ -56,7 +56,7 @@ def list( :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[~azure.mgmt.databoxedge.models.OperationsList] + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.databoxedge.v2020_05_01_preview.models.OperationsList] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationsList"] diff --git a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_05_01_preview/operations/_operations_status_operations.py b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_05_01_preview/operations/_operations_status_operations.py index a6703db0d11e..b0b1a13be6d9 100644 --- a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_05_01_preview/operations/_operations_status_operations.py +++ b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_05_01_preview/operations/_operations_status_operations.py @@ -29,7 +29,7 @@ class OperationsStatusOperations(object): instantiates it for you and attaches it as an attribute. :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.databoxedge.models + :type models: ~azure.mgmt.databoxedge.v2020_05_01_preview.models :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. @@ -64,7 +64,7 @@ def get( :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: ~azure.mgmt.databoxedge.models.Job + :rtype: ~azure.mgmt.databoxedge.v2020_05_01_preview.models.Job :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.Job"] diff --git a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_05_01_preview/operations/_orders_operations.py b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_05_01_preview/operations/_orders_operations.py index d6f98a697a4a..367baeaac122 100644 --- a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_05_01_preview/operations/_orders_operations.py +++ b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_05_01_preview/operations/_orders_operations.py @@ -32,7 +32,7 @@ class OrdersOperations(object): instantiates it for you and attaches it as an attribute. :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.databoxedge.models + :type models: ~azure.mgmt.databoxedge.v2020_05_01_preview.models :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. @@ -64,7 +64,7 @@ def list_by_data_box_edge_device( :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[~azure.mgmt.databoxedge.models.OrderList] + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.databoxedge.v2020_05_01_preview.models.OrderList] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.OrderList"] @@ -141,7 +141,7 @@ def get( :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: ~azure.mgmt.databoxedge.models.Order + :rtype: ~azure.mgmt.databoxedge.v2020_05_01_preview.models.Order :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.Order"] @@ -258,15 +258,15 @@ def begin_create_or_update( :param resource_group_name: The resource group name. :type resource_group_name: str :param order: The order to be created or updated. - :type order: ~azure.mgmt.databoxedge.models.Order + :type order: ~azure.mgmt.databoxedge.v2020_05_01_preview.models.Order :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: True for ARMPolling, False for no polling, or a - polling object for personal polling strategy + :keyword polling: Pass in True if you'd like the ARMPolling polling method, + False for no polling, or your own initialized polling object for a 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[~azure.mgmt.databoxedge.models.Order] + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.databoxedge.v2020_05_01_preview.models.Order] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] @@ -377,8 +377,8 @@ def begin_delete( :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 + :keyword polling: Pass in True if you'd like the ARMPolling polling method, + False for no polling, or your own initialized polling object for a 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) diff --git a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_05_01_preview/operations/_roles_operations.py b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_05_01_preview/operations/_roles_operations.py index e20d745bec16..8b933caa218d 100644 --- a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_05_01_preview/operations/_roles_operations.py +++ b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_05_01_preview/operations/_roles_operations.py @@ -32,7 +32,7 @@ class RolesOperations(object): instantiates it for you and attaches it as an attribute. :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.databoxedge.models + :type models: ~azure.mgmt.databoxedge.v2020_05_01_preview.models :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. @@ -62,7 +62,7 @@ def list_by_data_box_edge_device( :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[~azure.mgmt.databoxedge.models.RoleList] + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.databoxedge.v2020_05_01_preview.models.RoleList] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.RoleList"] @@ -140,7 +140,7 @@ def get( :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: ~azure.mgmt.databoxedge.models.Role + :rtype: ~azure.mgmt.databoxedge.v2020_05_01_preview.models.Role :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.Role"] @@ -261,15 +261,15 @@ def begin_create_or_update( :param resource_group_name: The resource group name. :type resource_group_name: str :param role: The role properties. - :type role: ~azure.mgmt.databoxedge.models.Role + :type role: ~azure.mgmt.databoxedge.v2020_05_01_preview.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 + :keyword polling: Pass in True if you'd like the ARMPolling polling method, + False for no polling, or your own initialized polling object for a 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[~azure.mgmt.databoxedge.models.Role] + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.databoxedge.v2020_05_01_preview.models.Role] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] @@ -385,8 +385,8 @@ def begin_delete( :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 + :keyword polling: Pass in True if you'd like the ARMPolling polling method, + False for no polling, or your own initialized polling object for a 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) diff --git a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_05_01_preview/operations/_shares_operations.py b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_05_01_preview/operations/_shares_operations.py index bb978c9dd8d5..3a44b369eb61 100644 --- a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_05_01_preview/operations/_shares_operations.py +++ b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_05_01_preview/operations/_shares_operations.py @@ -32,7 +32,7 @@ class SharesOperations(object): instantiates it for you and attaches it as an attribute. :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.databoxedge.models + :type models: ~azure.mgmt.databoxedge.v2020_05_01_preview.models :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. @@ -64,7 +64,7 @@ def list_by_data_box_edge_device( :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[~azure.mgmt.databoxedge.models.ShareList] + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.databoxedge.v2020_05_01_preview.models.ShareList] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.ShareList"] @@ -144,7 +144,7 @@ def get( :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: ~azure.mgmt.databoxedge.models.Share + :rtype: ~azure.mgmt.databoxedge.v2020_05_01_preview.models.Share :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.Share"] @@ -267,15 +267,15 @@ def begin_create_or_update( :param resource_group_name: The resource group name. :type resource_group_name: str :param share: The share properties. - :type share: ~azure.mgmt.databoxedge.models.Share + :type share: ~azure.mgmt.databoxedge.v2020_05_01_preview.models.Share :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: True for ARMPolling, False for no polling, or a - polling object for personal polling strategy + :keyword polling: Pass in True if you'd like the ARMPolling polling method, + False for no polling, or your own initialized polling object for a 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[~azure.mgmt.databoxedge.models.Share] + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.databoxedge.v2020_05_01_preview.models.Share] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] @@ -391,8 +391,8 @@ def begin_delete( :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 + :keyword polling: Pass in True if you'd like the ARMPolling polling method, + False for no polling, or your own initialized polling object for a 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) @@ -510,8 +510,8 @@ def begin_refresh( :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 + :keyword polling: Pass in True if you'd like the ARMPolling polling method, + False for no polling, or your own initialized polling object for a 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) diff --git a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_05_01_preview/operations/_skus_operations.py b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_05_01_preview/operations/_skus_operations.py index e025401f3a7c..ccd712a63908 100644 --- a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_05_01_preview/operations/_skus_operations.py +++ b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_05_01_preview/operations/_skus_operations.py @@ -30,7 +30,7 @@ class SkusOperations(object): instantiates it for you and attaches it as an attribute. :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.databoxedge.models + :type models: ~azure.mgmt.databoxedge.v2020_05_01_preview.models :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. @@ -59,7 +59,7 @@ def list( :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[~azure.mgmt.databoxedge.models.SkuInformationList] + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.databoxedge.v2020_05_01_preview.models.SkuInformationList] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.SkuInformationList"] diff --git a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_05_01_preview/operations/_storage_account_credentials_operations.py b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_05_01_preview/operations/_storage_account_credentials_operations.py index 470e57f115f6..1e20a36ee799 100644 --- a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_05_01_preview/operations/_storage_account_credentials_operations.py +++ b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_05_01_preview/operations/_storage_account_credentials_operations.py @@ -32,7 +32,7 @@ class StorageAccountCredentialsOperations(object): instantiates it for you and attaches it as an attribute. :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.databoxedge.models + :type models: ~azure.mgmt.databoxedge.v2020_05_01_preview.models :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. @@ -64,7 +64,7 @@ def list_by_data_box_edge_device( :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[~azure.mgmt.databoxedge.models.StorageAccountCredentialList] + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.databoxedge.v2020_05_01_preview.models.StorageAccountCredentialList] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.StorageAccountCredentialList"] @@ -142,7 +142,7 @@ def get( :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: ~azure.mgmt.databoxedge.models.StorageAccountCredential + :rtype: ~azure.mgmt.databoxedge.v2020_05_01_preview.models.StorageAccountCredential :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.StorageAccountCredential"] @@ -263,15 +263,15 @@ def begin_create_or_update( :param resource_group_name: The resource group name. :type resource_group_name: str :param storage_account_credential: The storage account credential. - :type storage_account_credential: ~azure.mgmt.databoxedge.models.StorageAccountCredential + :type storage_account_credential: ~azure.mgmt.databoxedge.v2020_05_01_preview.models.StorageAccountCredential :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: True for ARMPolling, False for no polling, or a - polling object for personal polling strategy + :keyword polling: Pass in True if you'd like the ARMPolling polling method, + False for no polling, or your own initialized polling object for a 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[~azure.mgmt.databoxedge.models.StorageAccountCredential] + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.databoxedge.v2020_05_01_preview.models.StorageAccountCredential] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] @@ -387,8 +387,8 @@ def begin_delete( :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 + :keyword polling: Pass in True if you'd like the ARMPolling polling method, + False for no polling, or your own initialized polling object for a 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) diff --git a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_05_01_preview/operations/_storage_accounts_operations.py b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_05_01_preview/operations/_storage_accounts_operations.py index 0a85720f4995..1c5a65220bb0 100644 --- a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_05_01_preview/operations/_storage_accounts_operations.py +++ b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_05_01_preview/operations/_storage_accounts_operations.py @@ -32,7 +32,7 @@ class StorageAccountsOperations(object): instantiates it for you and attaches it as an attribute. :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.databoxedge.models + :type models: ~azure.mgmt.databoxedge.v2020_05_01_preview.models :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. @@ -64,7 +64,7 @@ def list_by_data_box_edge_device( :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[~azure.mgmt.databoxedge.models.StorageAccountList] + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.databoxedge.v2020_05_01_preview.models.StorageAccountList] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.StorageAccountList"] @@ -144,7 +144,7 @@ def get( :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: ~azure.mgmt.databoxedge.models.StorageAccount + :rtype: ~azure.mgmt.databoxedge.v2020_05_01_preview.models.StorageAccount :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.StorageAccount"] @@ -267,15 +267,15 @@ def begin_create_or_update( :param resource_group_name: The resource group name. :type resource_group_name: str :param storage_account: The StorageAccount properties. - :type storage_account: ~azure.mgmt.databoxedge.models.StorageAccount + :type storage_account: ~azure.mgmt.databoxedge.v2020_05_01_preview.models.StorageAccount :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: True for ARMPolling, False for no polling, or a - polling object for personal polling strategy + :keyword polling: Pass in True if you'd like the ARMPolling polling method, + False for no polling, or your own initialized polling object for a 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[~azure.mgmt.databoxedge.models.StorageAccount] + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.databoxedge.v2020_05_01_preview.models.StorageAccount] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] @@ -391,8 +391,8 @@ def begin_delete( :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 + :keyword polling: Pass in True if you'd like the ARMPolling polling method, + False for no polling, or your own initialized polling object for a 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) diff --git a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_05_01_preview/operations/_triggers_operations.py b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_05_01_preview/operations/_triggers_operations.py index 87a1c0369e38..52c027b9dae5 100644 --- a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_05_01_preview/operations/_triggers_operations.py +++ b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_05_01_preview/operations/_triggers_operations.py @@ -32,7 +32,7 @@ class TriggersOperations(object): instantiates it for you and attaches it as an attribute. :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.databoxedge.models + :type models: ~azure.mgmt.databoxedge.v2020_05_01_preview.models :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. @@ -66,7 +66,7 @@ def list_by_data_box_edge_device( :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[~azure.mgmt.databoxedge.models.TriggerList] + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.databoxedge.v2020_05_01_preview.models.TriggerList] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.TriggerList"] @@ -146,7 +146,7 @@ def get( :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: ~azure.mgmt.databoxedge.models.Trigger + :rtype: ~azure.mgmt.databoxedge.v2020_05_01_preview.models.Trigger :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.Trigger"] @@ -267,15 +267,15 @@ def begin_create_or_update( :param resource_group_name: The resource group name. :type resource_group_name: str :param trigger: The trigger. - :type trigger: ~azure.mgmt.databoxedge.models.Trigger + :type trigger: ~azure.mgmt.databoxedge.v2020_05_01_preview.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 + :keyword polling: Pass in True if you'd like the ARMPolling polling method, + False for no polling, or your own initialized polling object for a 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[~azure.mgmt.databoxedge.models.Trigger] + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.databoxedge.v2020_05_01_preview.models.Trigger] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] @@ -391,8 +391,8 @@ def begin_delete( :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 + :keyword polling: Pass in True if you'd like the ARMPolling polling method, + False for no polling, or your own initialized polling object for a 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) diff --git a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_05_01_preview/operations/_users_operations.py b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_05_01_preview/operations/_users_operations.py index 05ba1780380d..ab9302f39c18 100644 --- a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_05_01_preview/operations/_users_operations.py +++ b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_05_01_preview/operations/_users_operations.py @@ -32,7 +32,7 @@ class UsersOperations(object): instantiates it for you and attaches it as an attribute. :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.databoxedge.models + :type models: ~azure.mgmt.databoxedge.v2020_05_01_preview.models :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. @@ -65,7 +65,7 @@ def list_by_data_box_edge_device( :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[~azure.mgmt.databoxedge.models.UserList] + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.databoxedge.v2020_05_01_preview.models.UserList] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.UserList"] @@ -145,7 +145,7 @@ def get( :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: ~azure.mgmt.databoxedge.models.User + :rtype: ~azure.mgmt.databoxedge.v2020_05_01_preview.models.User :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.User"] @@ -267,15 +267,15 @@ def begin_create_or_update( :param resource_group_name: The resource group name. :type resource_group_name: str :param user: The user details. - :type user: ~azure.mgmt.databoxedge.models.User + :type user: ~azure.mgmt.databoxedge.v2020_05_01_preview.models.User :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: True for ARMPolling, False for no polling, or a - polling object for personal polling strategy + :keyword polling: Pass in True if you'd like the ARMPolling polling method, + False for no polling, or your own initialized polling object for a 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[~azure.mgmt.databoxedge.models.User] + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.databoxedge.v2020_05_01_preview.models.User] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] @@ -391,8 +391,8 @@ def begin_delete( :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 + :keyword polling: Pass in True if you'd like the ARMPolling polling method, + False for no polling, or your own initialized polling object for a 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) diff --git a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_09_01/__init__.py b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_09_01/__init__.py new file mode 100644 index 000000000000..e63196b6b98f --- /dev/null +++ b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_09_01/__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/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_09_01/_configuration.py b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_09_01/_configuration.py new file mode 100644 index 000000000000..a5b47c318d7a --- /dev/null +++ b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_09_01/_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 = "2020-09-01" + self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default']) + kwargs.setdefault('sdk_moniker', 'mgmt-databoxedge/{}'.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/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_09_01/_data_box_edge_management_client.py b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_09_01/_data_box_edge_management_client.py new file mode 100644 index 000000000000..d17c09ae83c7 --- /dev/null +++ b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_09_01/_data_box_edge_management_client.py @@ -0,0 +1,174 @@ +# 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 azure.core.pipeline.transport import HttpRequest, HttpResponse + +from ._configuration import DataBoxEdgeManagementClientConfiguration +from .operations import Operations +from .operations import AvailableSkusOperations +from .operations import DevicesOperations +from .operations import AlertsOperations +from .operations import BandwidthSchedulesOperations +from .operations import JobsOperations +from .operations import NodesOperations +from .operations import OperationsStatusOperations +from .operations import OrdersOperations +from .operations import RolesOperations +from .operations import AddonsOperations +from .operations import MonitoringConfigOperations +from .operations import SharesOperations +from .operations import StorageAccountCredentialsOperations +from .operations import StorageAccountsOperations +from .operations import ContainersOperations +from .operations import TriggersOperations +from .operations import UsersOperations +from . import models + + +class DataBoxEdgeManagementClient(object): + """The DataBoxEdge Client. + + :ivar operations: Operations operations + :vartype operations: azure.mgmt.databoxedge.v2020_09_01.operations.Operations + :ivar available_skus: AvailableSkusOperations operations + :vartype available_skus: azure.mgmt.databoxedge.v2020_09_01.operations.AvailableSkusOperations + :ivar devices: DevicesOperations operations + :vartype devices: azure.mgmt.databoxedge.v2020_09_01.operations.DevicesOperations + :ivar alerts: AlertsOperations operations + :vartype alerts: azure.mgmt.databoxedge.v2020_09_01.operations.AlertsOperations + :ivar bandwidth_schedules: BandwidthSchedulesOperations operations + :vartype bandwidth_schedules: azure.mgmt.databoxedge.v2020_09_01.operations.BandwidthSchedulesOperations + :ivar jobs: JobsOperations operations + :vartype jobs: azure.mgmt.databoxedge.v2020_09_01.operations.JobsOperations + :ivar nodes: NodesOperations operations + :vartype nodes: azure.mgmt.databoxedge.v2020_09_01.operations.NodesOperations + :ivar operations_status: OperationsStatusOperations operations + :vartype operations_status: azure.mgmt.databoxedge.v2020_09_01.operations.OperationsStatusOperations + :ivar orders: OrdersOperations operations + :vartype orders: azure.mgmt.databoxedge.v2020_09_01.operations.OrdersOperations + :ivar roles: RolesOperations operations + :vartype roles: azure.mgmt.databoxedge.v2020_09_01.operations.RolesOperations + :ivar addons: AddonsOperations operations + :vartype addons: azure.mgmt.databoxedge.v2020_09_01.operations.AddonsOperations + :ivar monitoring_config: MonitoringConfigOperations operations + :vartype monitoring_config: azure.mgmt.databoxedge.v2020_09_01.operations.MonitoringConfigOperations + :ivar shares: SharesOperations operations + :vartype shares: azure.mgmt.databoxedge.v2020_09_01.operations.SharesOperations + :ivar storage_account_credentials: StorageAccountCredentialsOperations operations + :vartype storage_account_credentials: azure.mgmt.databoxedge.v2020_09_01.operations.StorageAccountCredentialsOperations + :ivar storage_accounts: StorageAccountsOperations operations + :vartype storage_accounts: azure.mgmt.databoxedge.v2020_09_01.operations.StorageAccountsOperations + :ivar containers: ContainersOperations operations + :vartype containers: azure.mgmt.databoxedge.v2020_09_01.operations.ContainersOperations + :ivar triggers: TriggersOperations operations + :vartype triggers: azure.mgmt.databoxedge.v2020_09_01.operations.TriggersOperations + :ivar users: UsersOperations operations + :vartype users: azure.mgmt.databoxedge.v2020_09_01.operations.UsersOperations + :param credential: Credential needed for the client to connect to Azure. + :type credential: ~azure.core.credentials.TokenCredential + :param subscription_id: The subscription ID. + :type subscription_id: str + :param str base_url: Service URL + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + """ + + def __init__( + self, + credential, # type: "TokenCredential" + subscription_id, # type: str + base_url=None, # type: Optional[str] + **kwargs # type: Any + ): + # type: (...) -> None + if not base_url: + base_url = 'https://management.azure.com' + self._config = DataBoxEdgeManagementClientConfiguration(credential, subscription_id, **kwargs) + self._client = ARMPipelineClient(base_url=base_url, config=self._config, **kwargs) + + client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} + self._serialize = Serializer(client_models) + self._serialize.client_side_validation = False + self._deserialize = Deserializer(client_models) + + self.operations = Operations( + self._client, self._config, self._serialize, self._deserialize) + self.available_skus = AvailableSkusOperations( + self._client, self._config, self._serialize, self._deserialize) + self.devices = DevicesOperations( + self._client, self._config, self._serialize, self._deserialize) + self.alerts = AlertsOperations( + self._client, self._config, self._serialize, self._deserialize) + self.bandwidth_schedules = BandwidthSchedulesOperations( + self._client, self._config, self._serialize, self._deserialize) + self.jobs = JobsOperations( + self._client, self._config, self._serialize, self._deserialize) + self.nodes = NodesOperations( + self._client, self._config, self._serialize, self._deserialize) + self.operations_status = OperationsStatusOperations( + self._client, self._config, self._serialize, self._deserialize) + self.orders = OrdersOperations( + self._client, self._config, self._serialize, self._deserialize) + self.roles = RolesOperations( + self._client, self._config, self._serialize, self._deserialize) + self.addons = AddonsOperations( + self._client, self._config, self._serialize, self._deserialize) + self.monitoring_config = MonitoringConfigOperations( + self._client, self._config, self._serialize, self._deserialize) + self.shares = SharesOperations( + self._client, self._config, self._serialize, self._deserialize) + self.storage_account_credentials = StorageAccountCredentialsOperations( + self._client, self._config, self._serialize, self._deserialize) + self.storage_accounts = StorageAccountsOperations( + self._client, self._config, self._serialize, self._deserialize) + self.containers = ContainersOperations( + self._client, self._config, self._serialize, self._deserialize) + self.triggers = TriggersOperations( + self._client, self._config, self._serialize, self._deserialize) + self.users = UsersOperations( + self._client, self._config, self._serialize, self._deserialize) + + def _send_request(self, http_request, **kwargs): + # type: (HttpRequest, Any) -> HttpResponse + """Runs the network request through the client's chained policies. + + :param http_request: The network request you want to make. Required. + :type http_request: ~azure.core.pipeline.transport.HttpRequest + :keyword bool stream: Whether the response payload will be streamed. Defaults to True. + :return: The response of your network call. Does not do error handling on your response. + :rtype: ~azure.core.pipeline.transport.HttpResponse + """ + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + http_request.url = self._client.format_url(http_request.url, **path_format_arguments) + stream = kwargs.pop("stream", True) + pipeline_response = self._client._pipeline.run(http_request, stream=stream, **kwargs) + return pipeline_response.http_response + + 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/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_09_01/_metadata.json b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_09_01/_metadata.json new file mode 100644 index 000000000000..95fd599d3039 --- /dev/null +++ b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_09_01/_metadata.json @@ -0,0 +1,120 @@ +{ + "chosen_version": "2020-09-01", + "total_api_version_list": ["2020-09-01"], + "client": { + "name": "DataBoxEdgeManagementClient", + "filename": "_data_box_edge_management_client", + "description": "The DataBoxEdge Client.", + "base_url": "\u0027https://management.azure.com\u0027", + "custom_base_url": null, + "azure_arm": true, + "has_lro_operations": true, + "client_side_validation": false, + "sync_imports": "{\"typing\": {\"azurecore\": {\"azure.core.credentials\": [\"TokenCredential\"]}}, \"regular\": {\"azurecore\": {\"azure.profiles\": [\"KnownProfiles\", \"ProfileDefinition\"], \"azure.profiles.multiapiclient\": [\"MultiApiClientMixin\"], \"msrest\": [\"Deserializer\", \"Serializer\"], \"azure.mgmt.core\": [\"ARMPipelineClient\"]}, \"local\": {\"._configuration\": [\"DataBoxEdgeManagementClientConfiguration\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}, \"azurecore\": {\"azure.core.pipeline.transport\": [\"HttpRequest\", \"HttpResponse\"]}}}", + "async_imports": "{\"typing\": {\"azurecore\": {\"azure.core.credentials_async\": [\"AsyncTokenCredential\"]}}, \"regular\": {\"azurecore\": {\"azure.profiles\": [\"KnownProfiles\", \"ProfileDefinition\"], \"azure.profiles.multiapiclient\": [\"MultiApiClientMixin\"], \"msrest\": [\"Deserializer\", \"Serializer\"], \"azure.mgmt.core\": [\"AsyncARMPipelineClient\"]}, \"local\": {\"._configuration\": [\"DataBoxEdgeManagementClientConfiguration\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}, \"azurecore\": {\"azure.core.pipeline.transport\": [\"AsyncHttpResponse\", \"HttpRequest\"]}}}" + }, + "global_parameters": { + "sync": { + "credential": { + "signature": "credential, # type: \"TokenCredential\"", + "description": "Credential needed for the client to connect to Azure.", + "docstring_type": "~azure.core.credentials.TokenCredential", + "required": true + }, + "subscription_id": { + "signature": "subscription_id, # type: str", + "description": "The subscription ID.", + "docstring_type": "str", + "required": true + } + }, + "async": { + "credential": { + "signature": "credential: \"AsyncTokenCredential\",", + "description": "Credential needed for the client to connect to Azure.", + "docstring_type": "~azure.core.credentials_async.AsyncTokenCredential", + "required": true + }, + "subscription_id": { + "signature": "subscription_id: str,", + "description": "The subscription ID.", + "docstring_type": "str", + "required": true + } + }, + "constant": { + }, + "call": "credential, subscription_id", + "service_client_specific": { + "sync": { + "api_version": { + "signature": "api_version=None, # type: Optional[str]", + "description": "API version to use if no profile is provided, or if missing in profile.", + "docstring_type": "str", + "required": false + }, + "base_url": { + "signature": "base_url=None, # type: Optional[str]", + "description": "Service URL", + "docstring_type": "str", + "required": false + }, + "profile": { + "signature": "profile=KnownProfiles.default, # type: KnownProfiles", + "description": "A profile definition, from KnownProfiles to dict.", + "docstring_type": "azure.profiles.KnownProfiles", + "required": false + } + }, + "async": { + "api_version": { + "signature": "api_version: Optional[str] = None,", + "description": "API version to use if no profile is provided, or if missing in profile.", + "docstring_type": "str", + "required": false + }, + "base_url": { + "signature": "base_url: Optional[str] = None,", + "description": "Service URL", + "docstring_type": "str", + "required": false + }, + "profile": { + "signature": "profile: KnownProfiles = KnownProfiles.default,", + "description": "A profile definition, from KnownProfiles to dict.", + "docstring_type": "azure.profiles.KnownProfiles", + "required": false + } + } + } + }, + "config": { + "credential": true, + "credential_scopes": ["https://management.azure.com/.default"], + "credential_default_policy_type": "BearerTokenCredentialPolicy", + "credential_default_policy_type_has_async_version": true, + "credential_key_header_name": null, + "sync_imports": "{\"regular\": {\"azurecore\": {\"azure.core.configuration\": [\"Configuration\"], \"azure.core.pipeline\": [\"policies\"], \"azure.mgmt.core.policies\": [\"ARMHttpLoggingPolicy\"]}, \"local\": {\"._version\": [\"VERSION\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\"]}}, \"typing\": {\"azurecore\": {\"azure.core.credentials\": [\"TokenCredential\"]}}}", + "async_imports": "{\"regular\": {\"azurecore\": {\"azure.core.configuration\": [\"Configuration\"], \"azure.core.pipeline\": [\"policies\"], \"azure.mgmt.core.policies\": [\"ARMHttpLoggingPolicy\"]}, \"local\": {\".._version\": [\"VERSION\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\"]}}, \"typing\": {\"azurecore\": {\"azure.core.credentials_async\": [\"AsyncTokenCredential\"]}}}" + }, + "operation_groups": { + "operations": "Operations", + "available_skus": "AvailableSkusOperations", + "devices": "DevicesOperations", + "alerts": "AlertsOperations", + "bandwidth_schedules": "BandwidthSchedulesOperations", + "jobs": "JobsOperations", + "nodes": "NodesOperations", + "operations_status": "OperationsStatusOperations", + "orders": "OrdersOperations", + "roles": "RolesOperations", + "addons": "AddonsOperations", + "monitoring_config": "MonitoringConfigOperations", + "shares": "SharesOperations", + "storage_account_credentials": "StorageAccountCredentialsOperations", + "storage_accounts": "StorageAccountsOperations", + "containers": "ContainersOperations", + "triggers": "TriggersOperations", + "users": "UsersOperations" + } +} \ No newline at end of file diff --git a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_09_01/aio/__init__.py b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_09_01/aio/__init__.py new file mode 100644 index 000000000000..c33d46ee91d8 --- /dev/null +++ b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_09_01/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/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_09_01/aio/_configuration.py b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_09_01/aio/_configuration.py new file mode 100644 index 000000000000..ee8f3c8f4c5e --- /dev/null +++ b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_09_01/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 = "2020-09-01" + self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default']) + kwargs.setdefault('sdk_moniker', 'mgmt-databoxedge/{}'.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/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_09_01/aio/_data_box_edge_management_client.py b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_09_01/aio/_data_box_edge_management_client.py new file mode 100644 index 000000000000..dc7f95bad1ec --- /dev/null +++ b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_09_01/aio/_data_box_edge_management_client.py @@ -0,0 +1,167 @@ +# 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.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.mgmt.core import AsyncARMPipelineClient +from msrest import Deserializer, Serializer + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from azure.core.credentials_async import AsyncTokenCredential + +from ._configuration import DataBoxEdgeManagementClientConfiguration +from .operations import Operations +from .operations import AvailableSkusOperations +from .operations import DevicesOperations +from .operations import AlertsOperations +from .operations import BandwidthSchedulesOperations +from .operations import JobsOperations +from .operations import NodesOperations +from .operations import OperationsStatusOperations +from .operations import OrdersOperations +from .operations import RolesOperations +from .operations import AddonsOperations +from .operations import MonitoringConfigOperations +from .operations import SharesOperations +from .operations import StorageAccountCredentialsOperations +from .operations import StorageAccountsOperations +from .operations import ContainersOperations +from .operations import TriggersOperations +from .operations import UsersOperations +from .. import models + + +class DataBoxEdgeManagementClient(object): + """The DataBoxEdge Client. + + :ivar operations: Operations operations + :vartype operations: azure.mgmt.databoxedge.v2020_09_01.aio.operations.Operations + :ivar available_skus: AvailableSkusOperations operations + :vartype available_skus: azure.mgmt.databoxedge.v2020_09_01.aio.operations.AvailableSkusOperations + :ivar devices: DevicesOperations operations + :vartype devices: azure.mgmt.databoxedge.v2020_09_01.aio.operations.DevicesOperations + :ivar alerts: AlertsOperations operations + :vartype alerts: azure.mgmt.databoxedge.v2020_09_01.aio.operations.AlertsOperations + :ivar bandwidth_schedules: BandwidthSchedulesOperations operations + :vartype bandwidth_schedules: azure.mgmt.databoxedge.v2020_09_01.aio.operations.BandwidthSchedulesOperations + :ivar jobs: JobsOperations operations + :vartype jobs: azure.mgmt.databoxedge.v2020_09_01.aio.operations.JobsOperations + :ivar nodes: NodesOperations operations + :vartype nodes: azure.mgmt.databoxedge.v2020_09_01.aio.operations.NodesOperations + :ivar operations_status: OperationsStatusOperations operations + :vartype operations_status: azure.mgmt.databoxedge.v2020_09_01.aio.operations.OperationsStatusOperations + :ivar orders: OrdersOperations operations + :vartype orders: azure.mgmt.databoxedge.v2020_09_01.aio.operations.OrdersOperations + :ivar roles: RolesOperations operations + :vartype roles: azure.mgmt.databoxedge.v2020_09_01.aio.operations.RolesOperations + :ivar addons: AddonsOperations operations + :vartype addons: azure.mgmt.databoxedge.v2020_09_01.aio.operations.AddonsOperations + :ivar monitoring_config: MonitoringConfigOperations operations + :vartype monitoring_config: azure.mgmt.databoxedge.v2020_09_01.aio.operations.MonitoringConfigOperations + :ivar shares: SharesOperations operations + :vartype shares: azure.mgmt.databoxedge.v2020_09_01.aio.operations.SharesOperations + :ivar storage_account_credentials: StorageAccountCredentialsOperations operations + :vartype storage_account_credentials: azure.mgmt.databoxedge.v2020_09_01.aio.operations.StorageAccountCredentialsOperations + :ivar storage_accounts: StorageAccountsOperations operations + :vartype storage_accounts: azure.mgmt.databoxedge.v2020_09_01.aio.operations.StorageAccountsOperations + :ivar containers: ContainersOperations operations + :vartype containers: azure.mgmt.databoxedge.v2020_09_01.aio.operations.ContainersOperations + :ivar triggers: TriggersOperations operations + :vartype triggers: azure.mgmt.databoxedge.v2020_09_01.aio.operations.TriggersOperations + :ivar users: UsersOperations operations + :vartype users: azure.mgmt.databoxedge.v2020_09_01.aio.operations.UsersOperations + :param credential: Credential needed for the client to connect to Azure. + :type credential: ~azure.core.credentials_async.AsyncTokenCredential + :param subscription_id: The subscription ID. + :type subscription_id: str + :param str base_url: Service URL + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + """ + + def __init__( + self, + credential: "AsyncTokenCredential", + subscription_id: str, + base_url: Optional[str] = None, + **kwargs: Any + ) -> None: + if not base_url: + base_url = 'https://management.azure.com' + self._config = DataBoxEdgeManagementClientConfiguration(credential, subscription_id, **kwargs) + self._client = AsyncARMPipelineClient(base_url=base_url, config=self._config, **kwargs) + + client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} + self._serialize = Serializer(client_models) + self._serialize.client_side_validation = False + self._deserialize = Deserializer(client_models) + + self.operations = Operations( + self._client, self._config, self._serialize, self._deserialize) + self.available_skus = AvailableSkusOperations( + self._client, self._config, self._serialize, self._deserialize) + self.devices = DevicesOperations( + self._client, self._config, self._serialize, self._deserialize) + self.alerts = AlertsOperations( + self._client, self._config, self._serialize, self._deserialize) + self.bandwidth_schedules = BandwidthSchedulesOperations( + self._client, self._config, self._serialize, self._deserialize) + self.jobs = JobsOperations( + self._client, self._config, self._serialize, self._deserialize) + self.nodes = NodesOperations( + self._client, self._config, self._serialize, self._deserialize) + self.operations_status = OperationsStatusOperations( + self._client, self._config, self._serialize, self._deserialize) + self.orders = OrdersOperations( + self._client, self._config, self._serialize, self._deserialize) + self.roles = RolesOperations( + self._client, self._config, self._serialize, self._deserialize) + self.addons = AddonsOperations( + self._client, self._config, self._serialize, self._deserialize) + self.monitoring_config = MonitoringConfigOperations( + self._client, self._config, self._serialize, self._deserialize) + self.shares = SharesOperations( + self._client, self._config, self._serialize, self._deserialize) + self.storage_account_credentials = StorageAccountCredentialsOperations( + self._client, self._config, self._serialize, self._deserialize) + self.storage_accounts = StorageAccountsOperations( + self._client, self._config, self._serialize, self._deserialize) + self.containers = ContainersOperations( + self._client, self._config, self._serialize, self._deserialize) + self.triggers = TriggersOperations( + self._client, self._config, self._serialize, self._deserialize) + self.users = UsersOperations( + self._client, self._config, self._serialize, self._deserialize) + + async def _send_request(self, http_request: HttpRequest, **kwargs: Any) -> AsyncHttpResponse: + """Runs the network request through the client's chained policies. + + :param http_request: The network request you want to make. Required. + :type http_request: ~azure.core.pipeline.transport.HttpRequest + :keyword bool stream: Whether the response payload will be streamed. Defaults to True. + :return: The response of your network call. Does not do error handling on your response. + :rtype: ~azure.core.pipeline.transport.AsyncHttpResponse + """ + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + http_request.url = self._client.format_url(http_request.url, **path_format_arguments) + stream = kwargs.pop("stream", True) + pipeline_response = await self._client._pipeline.run(http_request, stream=stream, **kwargs) + return pipeline_response.http_response + + 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/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_09_01/aio/operations/__init__.py b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_09_01/aio/operations/__init__.py new file mode 100644 index 000000000000..d70057be6458 --- /dev/null +++ b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_09_01/aio/operations/__init__.py @@ -0,0 +1,47 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from ._operations import Operations +from ._available_skus_operations import AvailableSkusOperations +from ._devices_operations import DevicesOperations +from ._alerts_operations import AlertsOperations +from ._bandwidth_schedules_operations import BandwidthSchedulesOperations +from ._jobs_operations import JobsOperations +from ._nodes_operations import NodesOperations +from ._operations_status_operations import OperationsStatusOperations +from ._orders_operations import OrdersOperations +from ._roles_operations import RolesOperations +from ._addons_operations import AddonsOperations +from ._monitoring_config_operations import MonitoringConfigOperations +from ._shares_operations import SharesOperations +from ._storage_account_credentials_operations import StorageAccountCredentialsOperations +from ._storage_accounts_operations import StorageAccountsOperations +from ._containers_operations import ContainersOperations +from ._triggers_operations import TriggersOperations +from ._users_operations import UsersOperations + +__all__ = [ + 'Operations', + 'AvailableSkusOperations', + 'DevicesOperations', + 'AlertsOperations', + 'BandwidthSchedulesOperations', + 'JobsOperations', + 'NodesOperations', + 'OperationsStatusOperations', + 'OrdersOperations', + 'RolesOperations', + 'AddonsOperations', + 'MonitoringConfigOperations', + 'SharesOperations', + 'StorageAccountCredentialsOperations', + 'StorageAccountsOperations', + 'ContainersOperations', + 'TriggersOperations', + 'UsersOperations', +] diff --git a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_09_01/aio/operations/_addons_operations.py b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_09_01/aio/operations/_addons_operations.py new file mode 100644 index 000000000000..e2da3a2ef7d4 --- /dev/null +++ b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_09_01/aio/operations/_addons_operations.py @@ -0,0 +1,450 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling + +from ... import models as _models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class AddonsOperations: + """AddonsOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.databoxedge.v2020_09_01.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list_by_role( + self, + device_name: str, + role_name: str, + resource_group_name: str, + **kwargs + ) -> AsyncIterable["_models.AddonList"]: + """Lists all the addons configured in the role. + + :param device_name: The device name. + :type device_name: str + :param role_name: The role name. + :type role_name: str + :param resource_group_name: The resource group name. + :type resource_group_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either AddonList or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.databoxedge.v2020_09_01.models.AddonList] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.AddonList"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_by_role.metadata['url'] # type: ignore + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'roleName': self._serialize.url("role_name", role_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('AddonList', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_by_role.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/roles/{roleName}/addons'} # type: ignore + + async def get( + self, + device_name: str, + role_name: str, + addon_name: str, + resource_group_name: str, + **kwargs + ) -> "_models.Addon": + """Gets a specific addon by name. + + :param device_name: The device name. + :type device_name: str + :param role_name: The role name. + :type role_name: str + :param addon_name: The addon name. + :type addon_name: str + :param resource_group_name: The resource group name. + :type resource_group_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: Addon, or the result of cls(response) + :rtype: ~azure.mgmt.databoxedge.v2020_09_01.models.Addon + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.Addon"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'roleName': self._serialize.url("role_name", role_name, 'str'), + 'addonName': self._serialize.url("addon_name", addon_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('Addon', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/roles/{roleName}/addons/{addonName}'} # type: ignore + + async def _create_or_update_initial( + self, + device_name: str, + role_name: str, + addon_name: str, + resource_group_name: str, + addon: "_models.Addon", + **kwargs + ) -> Optional["_models.Addon"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.Addon"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._create_or_update_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'roleName': self._serialize.url("role_name", role_name, 'str'), + 'addonName': self._serialize.url("addon_name", addon_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(addon, 'Addon') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('Addon', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/roles/{roleName}/addons/{addonName}'} # type: ignore + + async def begin_create_or_update( + self, + device_name: str, + role_name: str, + addon_name: str, + resource_group_name: str, + addon: "_models.Addon", + **kwargs + ) -> AsyncLROPoller["_models.Addon"]: + """Create or update a addon. + + :param device_name: The device name. + :type device_name: str + :param role_name: The role name. + :type role_name: str + :param addon_name: The addon name. + :type addon_name: str + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param addon: The addon properties. + :type addon: ~azure.mgmt.databoxedge.v2020_09_01.models.Addon + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: Pass in True if you'd like the AsyncARMPolling polling method, + False for no polling, or your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either Addon or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.databoxedge.v2020_09_01.models.Addon] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Addon"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._create_or_update_initial( + device_name=device_name, + role_name=role_name, + addon_name=addon_name, + resource_group_name=resource_group_name, + addon=addon, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('Addon', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'roleName': self._serialize.url("role_name", role_name, 'str'), + 'addonName': self._serialize.url("addon_name", addon_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/roles/{roleName}/addons/{addonName}'} # type: ignore + + async def _delete_initial( + self, + device_name: str, + role_name: str, + addon_name: str, + resource_group_name: str, + **kwargs + ) -> None: + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self._delete_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'roleName': self._serialize.url("role_name", role_name, 'str'), + 'addonName': self._serialize.url("addon_name", addon_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/roles/{roleName}/addons/{addonName}'} # type: ignore + + async def begin_delete( + self, + device_name: str, + role_name: str, + addon_name: str, + resource_group_name: str, + **kwargs + ) -> AsyncLROPoller[None]: + """Deletes the addon on the device. + + :param device_name: The device name. + :type device_name: str + :param role_name: The role name. + :type role_name: str + :param addon_name: The addon name. + :type addon_name: str + :param resource_group_name: The resource group name. + :type resource_group_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: Pass in True if you'd like the AsyncARMPolling polling method, + False for no polling, or your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._delete_initial( + device_name=device_name, + role_name=role_name, + addon_name=addon_name, + resource_group_name=resource_group_name, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'roleName': self._serialize.url("role_name", role_name, 'str'), + 'addonName': self._serialize.url("addon_name", addon_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/roles/{roleName}/addons/{addonName}'} # type: ignore diff --git a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_09_01/aio/operations/_alerts_operations.py b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_09_01/aio/operations/_alerts_operations.py new file mode 100644 index 000000000000..5b134957aeda --- /dev/null +++ b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_09_01/aio/operations/_alerts_operations.py @@ -0,0 +1,180 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.mgmt.core.exceptions import ARMErrorFormat + +from ... import models as _models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class AlertsOperations: + """AlertsOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.databoxedge.v2020_09_01.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[~azure.mgmt.databoxedge.v2020_09_01.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 = "2020-09-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: ~azure.mgmt.databoxedge.v2020_09_01.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 = "2020-09-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/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_09_01/aio/operations/_available_skus_operations.py b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_09_01/aio/operations/_available_skus_operations.py new file mode 100644 index 000000000000..cb20cc6d9af5 --- /dev/null +++ b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_09_01/aio/operations/_available_skus_operations.py @@ -0,0 +1,110 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.mgmt.core.exceptions import ARMErrorFormat + +from ... import models as _models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class AvailableSkusOperations: + """AvailableSkusOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.databoxedge.v2020_09_01.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list( + self, + **kwargs + ) -> AsyncIterable["_models.DataBoxEdgeSkuList"]: + """List all the available Skus and information related to them. + + List all the available Skus and information related to them. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either DataBoxEdgeSkuList or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.databoxedge.v2020_09_01.models.DataBoxEdgeSkuList] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.DataBoxEdgeSkuList"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('DataBoxEdgeSkuList', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.DataBoxEdge/availableSkus'} # type: ignore diff --git a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_09_01/aio/operations/_bandwidth_schedules_operations.py b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_09_01/aio/operations/_bandwidth_schedules_operations.py new file mode 100644 index 000000000000..dd7b1aab3acf --- /dev/null +++ b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_09_01/aio/operations/_bandwidth_schedules_operations.py @@ -0,0 +1,428 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling + +from ... import models as _models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class BandwidthSchedulesOperations: + """BandwidthSchedulesOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.databoxedge.v2020_09_01.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[~azure.mgmt.databoxedge.v2020_09_01.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 = "2020-09-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: ~azure.mgmt.databoxedge.v2020_09_01.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 = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('BandwidthSchedule', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/bandwidthSchedules/{name}'} # type: ignore + + async def _create_or_update_initial( + self, + device_name: str, + name: str, + resource_group_name: str, + parameters: "_models.BandwidthSchedule", + **kwargs + ) -> Optional["_models.BandwidthSchedule"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.BandwidthSchedule"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._create_or_update_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, 'BandwidthSchedule') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('BandwidthSchedule', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/bandwidthSchedules/{name}'} # type: ignore + + async def begin_create_or_update( + self, + device_name: str, + name: str, + resource_group_name: str, + parameters: "_models.BandwidthSchedule", + **kwargs + ) -> AsyncLROPoller["_models.BandwidthSchedule"]: + """Creates or updates a bandwidth schedule. + + :param device_name: The device name. + :type device_name: str + :param name: The bandwidth schedule name which needs to be added/updated. + :type name: str + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param parameters: The bandwidth schedule to be added or updated. + :type parameters: ~azure.mgmt.databoxedge.v2020_09_01.models.BandwidthSchedule + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: Pass in True if you'd like the AsyncARMPolling polling method, + False for no polling, or your own initialized polling object for a 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[~azure.mgmt.databoxedge.v2020_09_01.models.BandwidthSchedule] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.BandwidthSchedule"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._create_or_update_initial( + device_name=device_name, + name=name, + resource_group_name=resource_group_name, + parameters=parameters, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('BandwidthSchedule', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/bandwidthSchedules/{name}'} # type: ignore + + async def _delete_initial( + self, + device_name: str, + name: str, + resource_group_name: str, + **kwargs + ) -> None: + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-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: Pass in True if you'd like the AsyncARMPolling polling method, + False for no polling, or your own initialized polling object for a 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/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_09_01/aio/operations/_containers_operations.py b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_09_01/aio/operations/_containers_operations.py new file mode 100644 index 000000000000..a1cc1ba15971 --- /dev/null +++ b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_09_01/aio/operations/_containers_operations.py @@ -0,0 +1,580 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling + +from ... import models as _models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class ContainersOperations: + """ContainersOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.databoxedge.v2020_09_01.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[~azure.mgmt.databoxedge.v2020_09_01.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 = "2020-09-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: ~azure.mgmt.databoxedge.v2020_09_01.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 = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'storageAccountName': self._serialize.url("storage_account_name", storage_account_name, 'str'), + 'containerName': self._serialize.url("container_name", container_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('Container', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/storageAccounts/{storageAccountName}/containers/{containerName}'} # type: ignore + + async def _create_or_update_initial( + self, + device_name: str, + storage_account_name: str, + container_name: str, + resource_group_name: str, + container: "_models.Container", + **kwargs + ) -> Optional["_models.Container"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.Container"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._create_or_update_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'storageAccountName': self._serialize.url("storage_account_name", storage_account_name, 'str'), + 'containerName': self._serialize.url("container_name", container_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(container, 'Container') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('Container', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/storageAccounts/{storageAccountName}/containers/{containerName}'} # type: ignore + + async def begin_create_or_update( + self, + device_name: str, + storage_account_name: str, + container_name: str, + resource_group_name: str, + container: "_models.Container", + **kwargs + ) -> AsyncLROPoller["_models.Container"]: + """Creates a new container or updates an existing container on the device. + + Creates a new container or updates an existing container on the device. + + :param device_name: The device name. + :type device_name: str + :param storage_account_name: The Storage Account Name. + :type storage_account_name: str + :param container_name: The container name. + :type container_name: str + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param container: The container properties. + :type container: ~azure.mgmt.databoxedge.v2020_09_01.models.Container + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: Pass in True if you'd like the AsyncARMPolling polling method, + False for no polling, or your own initialized polling object for a 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[~azure.mgmt.databoxedge.v2020_09_01.models.Container] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Container"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._create_or_update_initial( + device_name=device_name, + storage_account_name=storage_account_name, + container_name=container_name, + resource_group_name=resource_group_name, + container=container, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('Container', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'storageAccountName': self._serialize.url("storage_account_name", storage_account_name, 'str'), + 'containerName': self._serialize.url("container_name", container_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/storageAccounts/{storageAccountName}/containers/{containerName}'} # type: ignore + + async def _delete_initial( + self, + device_name: str, + storage_account_name: str, + container_name: str, + resource_group_name: str, + **kwargs + ) -> None: + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-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: Pass in True if you'd like the AsyncARMPolling polling method, + False for no polling, or your own initialized polling object for a 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 = "2020-09-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: Pass in True if you'd like the AsyncARMPolling polling method, + False for no polling, or your own initialized polling object for a 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/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_09_01/aio/operations/_devices_operations.py b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_09_01/aio/operations/_devices_operations.py new file mode 100644 index 000000000000..a57be9277501 --- /dev/null +++ b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_09_01/aio/operations/_devices_operations.py @@ -0,0 +1,1363 @@ +# 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 as _models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class DevicesOperations: + """DevicesOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.databoxedge.v2020_09_01.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[~azure.mgmt.databoxedge.v2020_09_01.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 = "2020-09-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[~azure.mgmt.databoxedge.v2020_09_01.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 = "2020-09-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: ~azure.mgmt.databoxedge.v2020_09_01.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 = "2020-09-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, + data_box_edge_device: "_models.DataBoxEdgeDevice", + **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', {})) + api_version = "2020-09-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, + data_box_edge_device: "_models.DataBoxEdgeDevice", + **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 data_box_edge_device: The resource object. + :type data_box_edge_device: ~azure.mgmt.databoxedge.v2020_09_01.models.DataBoxEdgeDevice + :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: Pass in True if you'd like the AsyncARMPolling polling method, + False for no polling, or your own initialized polling object for a 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[~azure.mgmt.databoxedge.v2020_09_01.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, + data_box_edge_device=data_box_edge_device, + 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 = "2020-09-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: Pass in True if you'd like the AsyncARMPolling polling method, + False for no polling, or your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._delete_initial( + device_name=device_name, + resource_group_name=resource_group_name, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}'} # type: ignore + + async def update( + self, + device_name: str, + resource_group_name: str, + parameters: "_models.DataBoxEdgeDevicePatch", + **kwargs + ) -> "_models.DataBoxEdgeDevice": + """Modifies a Data Box Edge/Data Box Gateway resource. + + :param device_name: The device name. + :type device_name: str + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param parameters: The resource parameters. + :type parameters: ~azure.mgmt.databoxedge.v2020_09_01.models.DataBoxEdgeDevicePatch + :keyword callable cls: A custom type or function that will be passed the direct response + :return: DataBoxEdgeDevice, or the result of cls(response) + :rtype: ~azure.mgmt.databoxedge.v2020_09_01.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 = "2020-09-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update.metadata['url'] # type: ignore + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, 'DataBoxEdgeDevicePatch') + body_content_kwargs['content'] = body_content + request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('DataBoxEdgeDevice', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}'} # type: ignore + + async def _download_updates_initial( + self, + device_name: str, + resource_group_name: str, + **kwargs + ) -> None: + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self._download_updates_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _download_updates_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/downloadUpdates'} # type: ignore + + async def begin_download_updates( + self, + device_name: str, + resource_group_name: str, + **kwargs + ) -> AsyncLROPoller[None]: + """Downloads the updates on a Data Box Edge/Data Box Gateway device. + + Downloads the updates on a Data Box Edge/Data Box Gateway device. + + :param device_name: The device name. + :type device_name: str + :param resource_group_name: The resource group name. + :type resource_group_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: Pass in True if you'd like the AsyncARMPolling polling method, + False for no polling, or your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._download_updates_initial( + device_name=device_name, + resource_group_name=resource_group_name, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_download_updates.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/downloadUpdates'} # type: ignore + + async def generate_certificate( + self, + device_name: str, + resource_group_name: str, + **kwargs + ) -> "_models.GenerateCertResponse": + """Generates certificate for activation key. + + :param device_name: The device name. + :type device_name: str + :param resource_group_name: The resource group name. + :type resource_group_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: GenerateCertResponse, or the result of cls(response) + :rtype: ~azure.mgmt.databoxedge.v2020_09_01.models.GenerateCertResponse + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.GenerateCertResponse"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.generate_certificate.metadata['url'] # type: ignore + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('GenerateCertResponse', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + generate_certificate.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/generateCertificate'} # type: ignore + + async def get_extended_information( + self, + device_name: str, + resource_group_name: str, + **kwargs + ) -> "_models.DataBoxEdgeDeviceExtendedInfo": + """Gets additional information for the specified Azure Stack Edge/Data Box Gateway device. + + :param device_name: The device name. + :type device_name: str + :param resource_group_name: The resource group name. + :type resource_group_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: DataBoxEdgeDeviceExtendedInfo, or the result of cls(response) + :rtype: ~azure.mgmt.databoxedge.v2020_09_01.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 = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.get_extended_information.metadata['url'] # type: ignore + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('DataBoxEdgeDeviceExtendedInfo', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_extended_information.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/getExtendedInformation'} # type: ignore + + async def _install_updates_initial( + self, + device_name: str, + resource_group_name: str, + **kwargs + ) -> None: + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self._install_updates_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _install_updates_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/installUpdates'} # type: ignore + + async def begin_install_updates( + self, + device_name: str, + resource_group_name: str, + **kwargs + ) -> AsyncLROPoller[None]: + """Installs the updates on the Data Box Edge/Data Box Gateway device. + + Installs the updates on the Data Box Edge/Data Box Gateway device. + + :param device_name: The device name. + :type device_name: str + :param resource_group_name: The resource group name. + :type resource_group_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: Pass in True if you'd like the AsyncARMPolling polling method, + False for no polling, or your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._install_updates_initial( + device_name=device_name, + resource_group_name=resource_group_name, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_install_updates.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/installUpdates'} # type: ignore + + async def get_network_settings( + self, + device_name: str, + resource_group_name: str, + **kwargs + ) -> "_models.NetworkSettings": + """Gets the network settings of the specified Data Box Edge/Data Box Gateway device. + + :param device_name: The device name. + :type device_name: str + :param resource_group_name: The resource group name. + :type resource_group_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: NetworkSettings, or the result of cls(response) + :rtype: ~azure.mgmt.databoxedge.v2020_09_01.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 = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.get_network_settings.metadata['url'] # type: ignore + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('NetworkSettings', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_network_settings.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/networkSettings/default'} # type: ignore + + async def _scan_for_updates_initial( + self, + device_name: str, + resource_group_name: str, + **kwargs + ) -> None: + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self._scan_for_updates_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _scan_for_updates_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/scanForUpdates'} # type: ignore + + async def begin_scan_for_updates( + self, + device_name: str, + resource_group_name: str, + **kwargs + ) -> AsyncLROPoller[None]: + """Scans for updates on a Data Box Edge/Data Box Gateway device. + + Scans for updates on a Data Box Edge/Data Box Gateway device. + + :param device_name: The device name. + :type device_name: str + :param resource_group_name: The resource group name. + :type resource_group_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: Pass in True if you'd like the AsyncARMPolling polling method, + False for no polling, or your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._scan_for_updates_initial( + device_name=device_name, + resource_group_name=resource_group_name, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_scan_for_updates.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/scanForUpdates'} # type: ignore + + async def _create_or_update_security_settings_initial( + self, + device_name: str, + resource_group_name: str, + security_settings: "_models.SecuritySettings", + **kwargs + ) -> None: + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._create_or_update_security_settings_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(security_settings, 'SecuritySettings') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _create_or_update_security_settings_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/securitySettings/default/update'} # type: ignore + + async def begin_create_or_update_security_settings( + self, + device_name: str, + resource_group_name: str, + security_settings: "_models.SecuritySettings", + **kwargs + ) -> AsyncLROPoller[None]: + """Updates the security settings on a Data Box Edge/Data Box Gateway device. + + :param device_name: The device name. + :type device_name: str + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param security_settings: The security settings. + :type security_settings: ~azure.mgmt.databoxedge.v2020_09_01.models.SecuritySettings + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: Pass in True if you'd like the AsyncARMPolling polling method, + False for no polling, or your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._create_or_update_security_settings_initial( + device_name=device_name, + resource_group_name=resource_group_name, + security_settings=security_settings, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create_or_update_security_settings.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/securitySettings/default/update'} # type: ignore + + async def update_extended_information( + self, + device_name: str, + resource_group_name: str, + parameters: "_models.DataBoxEdgeDeviceExtendedInfoPatch", + **kwargs + ) -> "_models.DataBoxEdgeDeviceExtendedInfo": + """Gets additional information for the specified Data Box Edge/Data Box Gateway device. + + :param device_name: The device name. + :type device_name: str + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param parameters: The patch object. + :type parameters: ~azure.mgmt.databoxedge.v2020_09_01.models.DataBoxEdgeDeviceExtendedInfoPatch + :keyword callable cls: A custom type or function that will be passed the direct response + :return: DataBoxEdgeDeviceExtendedInfo, or the result of cls(response) + :rtype: ~azure.mgmt.databoxedge.v2020_09_01.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 = "2020-09-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update_extended_information.metadata['url'] # type: ignore + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, 'DataBoxEdgeDeviceExtendedInfoPatch') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('DataBoxEdgeDeviceExtendedInfo', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update_extended_information.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/updateExtendedInformation'} # type: ignore + + async def get_update_summary( + self, + device_name: str, + resource_group_name: str, + **kwargs + ) -> "_models.UpdateSummary": + """Gets information about the availability of updates based on the last scan of the device. It also gets information about any ongoing download or install jobs on the device. + + Gets information about the availability of updates based on the last scan of the device. It + also gets information about any ongoing download or install jobs on the device. + + :param device_name: The device name. + :type device_name: str + :param resource_group_name: The resource group name. + :type resource_group_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: UpdateSummary, or the result of cls(response) + :rtype: ~azure.mgmt.databoxedge.v2020_09_01.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 = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.get_update_summary.metadata['url'] # type: ignore + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('UpdateSummary', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_update_summary.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/updateSummary/default'} # type: ignore + + async def upload_certificate( + self, + device_name: str, + resource_group_name: str, + parameters: "_models.UploadCertificateRequest", + **kwargs + ) -> "_models.UploadCertificateResponse": + """Uploads registration certificate for the device. + + :param device_name: The device name. + :type device_name: str + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param parameters: The upload certificate request. + :type parameters: ~azure.mgmt.databoxedge.v2020_09_01.models.UploadCertificateRequest + :keyword callable cls: A custom type or function that will be passed the direct response + :return: UploadCertificateResponse, or the result of cls(response) + :rtype: ~azure.mgmt.databoxedge.v2020_09_01.models.UploadCertificateResponse + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.UploadCertificateResponse"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-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/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_09_01/aio/operations/_jobs_operations.py b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_09_01/aio/operations/_jobs_operations.py new file mode 100644 index 000000000000..11ea6d59f07a --- /dev/null +++ b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_09_01/aio/operations/_jobs_operations.py @@ -0,0 +1,105 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, Callable, Dict, Generic, Optional, TypeVar +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.mgmt.core.exceptions import ARMErrorFormat + +from ... import models as _models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class JobsOperations: + """JobsOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.databoxedge.v2020_09_01.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: ~azure.mgmt.databoxedge.v2020_09_01.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 = "2020-09-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/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_09_01/aio/operations/_monitoring_config_operations.py b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_09_01/aio/operations/_monitoring_config_operations.py new file mode 100644 index 000000000000..af835149a368 --- /dev/null +++ b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_09_01/aio/operations/_monitoring_config_operations.py @@ -0,0 +1,440 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling + +from ... import models as _models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class MonitoringConfigOperations: + """MonitoringConfigOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.databoxedge.v2020_09_01.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list( + self, + device_name: str, + role_name: str, + resource_group_name: str, + **kwargs + ) -> AsyncIterable["_models.MonitoringMetricConfigurationList"]: + """Lists metric configurations in a role. + + Lists metric configurations in a role. + + :param device_name: The device name. + :type device_name: str + :param role_name: The role name. + :type role_name: str + :param resource_group_name: The resource group name. + :type resource_group_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either MonitoringMetricConfigurationList or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.databoxedge.v2020_09_01.models.MonitoringMetricConfigurationList] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.MonitoringMetricConfigurationList"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list.metadata['url'] # type: ignore + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'roleName': self._serialize.url("role_name", role_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('MonitoringMetricConfigurationList', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/roles/{roleName}/monitoringConfig'} # type: ignore + + async def get( + self, + device_name: str, + role_name: str, + resource_group_name: str, + **kwargs + ) -> "_models.MonitoringMetricConfiguration": + """Gets a metric configuration of a role. + + Gets a metric configuration of a role. + + :param device_name: The device name. + :type device_name: str + :param role_name: The role name. + :type role_name: str + :param resource_group_name: The resource group name. + :type resource_group_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: MonitoringMetricConfiguration, or the result of cls(response) + :rtype: ~azure.mgmt.databoxedge.v2020_09_01.models.MonitoringMetricConfiguration + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.MonitoringMetricConfiguration"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'roleName': self._serialize.url("role_name", role_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('MonitoringMetricConfiguration', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/roles/{roleName}/monitoringConfig/default'} # type: ignore + + async def _create_or_update_initial( + self, + device_name: str, + role_name: str, + resource_group_name: str, + monitoring_metric_configuration: "_models.MonitoringMetricConfiguration", + **kwargs + ) -> Optional["_models.MonitoringMetricConfiguration"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.MonitoringMetricConfiguration"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._create_or_update_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'roleName': self._serialize.url("role_name", role_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(monitoring_metric_configuration, 'MonitoringMetricConfiguration') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('MonitoringMetricConfiguration', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/roles/{roleName}/monitoringConfig/default'} # type: ignore + + async def begin_create_or_update( + self, + device_name: str, + role_name: str, + resource_group_name: str, + monitoring_metric_configuration: "_models.MonitoringMetricConfiguration", + **kwargs + ) -> AsyncLROPoller["_models.MonitoringMetricConfiguration"]: + """Creates a new metric configuration or updates an existing one for a role. + + Creates a new metric configuration or updates an existing one for a role. + + :param device_name: The device name. + :type device_name: str + :param role_name: The role name. + :type role_name: str + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param monitoring_metric_configuration: The metric configuration. + :type monitoring_metric_configuration: ~azure.mgmt.databoxedge.v2020_09_01.models.MonitoringMetricConfiguration + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: Pass in True if you'd like the AsyncARMPolling polling method, + False for no polling, or your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either MonitoringMetricConfiguration or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.databoxedge.v2020_09_01.models.MonitoringMetricConfiguration] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.MonitoringMetricConfiguration"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._create_or_update_initial( + device_name=device_name, + role_name=role_name, + resource_group_name=resource_group_name, + monitoring_metric_configuration=monitoring_metric_configuration, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('MonitoringMetricConfiguration', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'roleName': self._serialize.url("role_name", role_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/roles/{roleName}/monitoringConfig/default'} # type: ignore + + async def _delete_initial( + self, + device_name: str, + role_name: str, + resource_group_name: str, + **kwargs + ) -> None: + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self._delete_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'roleName': self._serialize.url("role_name", role_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/roles/{roleName}/monitoringConfig/default'} # type: ignore + + async def begin_delete( + self, + device_name: str, + role_name: str, + resource_group_name: str, + **kwargs + ) -> AsyncLROPoller[None]: + """deletes a new metric configuration for a role. + + deletes a new metric configuration for a role. + + :param device_name: The device name. + :type device_name: str + :param role_name: The role name. + :type role_name: str + :param resource_group_name: The resource group name. + :type resource_group_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: Pass in True if you'd like the AsyncARMPolling polling method, + False for no polling, or your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._delete_initial( + device_name=device_name, + role_name=role_name, + resource_group_name=resource_group_name, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'roleName': self._serialize.url("role_name", role_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/roles/{roleName}/monitoringConfig/default'} # type: ignore diff --git a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_09_01/aio/operations/_nodes_operations.py b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_09_01/aio/operations/_nodes_operations.py new file mode 100644 index 000000000000..951e1d5c4232 --- /dev/null +++ b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_09_01/aio/operations/_nodes_operations.py @@ -0,0 +1,116 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.mgmt.core.exceptions import ARMErrorFormat + +from ... import models as _models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class NodesOperations: + """NodesOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.databoxedge.v2020_09_01.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[~azure.mgmt.databoxedge.v2020_09_01.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 = "2020-09-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_by_data_box_edge_device.metadata['url'] # type: ignore + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('NodeList', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_by_data_box_edge_device.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/nodes'} # type: ignore diff --git a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_09_01/aio/operations/_operations.py b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_09_01/aio/operations/_operations.py new file mode 100644 index 000000000000..105241694868 --- /dev/null +++ b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_09_01/aio/operations/_operations.py @@ -0,0 +1,106 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.mgmt.core.exceptions import ARMErrorFormat + +from ... import models as _models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class Operations: + """Operations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.databoxedge.v2020_09_01.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[~azure.mgmt.databoxedge.v2020_09_01.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 = "2020-09-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/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_09_01/aio/operations/_operations_status_operations.py b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_09_01/aio/operations/_operations_status_operations.py new file mode 100644 index 000000000000..1e807137bab8 --- /dev/null +++ b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_09_01/aio/operations/_operations_status_operations.py @@ -0,0 +1,105 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, Callable, Dict, Generic, Optional, TypeVar +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.mgmt.core.exceptions import ARMErrorFormat + +from ... import models as _models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class OperationsStatusOperations: + """OperationsStatusOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.databoxedge.v2020_09_01.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: ~azure.mgmt.databoxedge.v2020_09_01.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 = "2020-09-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/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_09_01/aio/operations/_orders_operations.py b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_09_01/aio/operations/_orders_operations.py new file mode 100644 index 000000000000..220286ce394f --- /dev/null +++ b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_09_01/aio/operations/_orders_operations.py @@ -0,0 +1,478 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling + +from ... import models as _models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class OrdersOperations: + """OrdersOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.databoxedge.v2020_09_01.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[~azure.mgmt.databoxedge.v2020_09_01.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 = "2020-09-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: ~azure.mgmt.databoxedge.v2020_09_01.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 = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('Order', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/orders/default'} # type: ignore + + async def _create_or_update_initial( + self, + device_name: str, + resource_group_name: str, + order: "_models.Order", + **kwargs + ) -> Optional["_models.Order"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.Order"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._create_or_update_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(order, 'Order') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('Order', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/orders/default'} # type: ignore + + async def begin_create_or_update( + self, + device_name: str, + resource_group_name: str, + order: "_models.Order", + **kwargs + ) -> AsyncLROPoller["_models.Order"]: + """Creates or updates an order. + + Creates or updates an order. + + :param device_name: The order details of a device. + :type device_name: str + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param order: The order to be created or updated. + :type order: ~azure.mgmt.databoxedge.v2020_09_01.models.Order + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: Pass in True if you'd like the AsyncARMPolling polling method, + False for no polling, or your own initialized polling object for a 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[~azure.mgmt.databoxedge.v2020_09_01.models.Order] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Order"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._create_or_update_initial( + device_name=device_name, + resource_group_name=resource_group_name, + order=order, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('Order', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/orders/default'} # type: ignore + + async def _delete_initial( + self, + device_name: str, + resource_group_name: str, + **kwargs + ) -> None: + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-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: Pass in True if you'd like the AsyncARMPolling polling method, + False for no polling, or your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._delete_initial( + device_name=device_name, + resource_group_name=resource_group_name, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/orders/default'} # type: ignore + + async def list_dc_access_code( + self, + device_name: str, + resource_group_name: str, + **kwargs + ) -> "_models.DCAccessCode": + """Gets the DCAccess Code. + + Gets the DCAccess Code. + + :param device_name: The device name. + :type device_name: str + :param resource_group_name: The resource group name. + :type resource_group_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: DCAccessCode, or the result of cls(response) + :rtype: ~azure.mgmt.databoxedge.v2020_09_01.models.DCAccessCode + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.DCAccessCode"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.list_dc_access_code.metadata['url'] # type: ignore + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('DCAccessCode', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + list_dc_access_code.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/orders/default/listDCAccessCode'} # type: ignore diff --git a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_09_01/aio/operations/_roles_operations.py b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_09_01/aio/operations/_roles_operations.py new file mode 100644 index 000000000000..1d06b52d0b3c --- /dev/null +++ b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_09_01/aio/operations/_roles_operations.py @@ -0,0 +1,428 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling + +from ... import models as _models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class RolesOperations: + """RolesOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.databoxedge.v2020_09_01.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[~azure.mgmt.databoxedge.v2020_09_01.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 = "2020-09-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: ~azure.mgmt.databoxedge.v2020_09_01.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 = "2020-09-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 = "2020-09-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: ~azure.mgmt.databoxedge.v2020_09_01.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: Pass in True if you'd like the AsyncARMPolling polling method, + False for no polling, or your own initialized polling object for a 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[~azure.mgmt.databoxedge.v2020_09_01.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 = "2020-09-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: Pass in True if you'd like the AsyncARMPolling polling method, + False for no polling, or your own initialized polling object for a 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/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_09_01/aio/operations/_shares_operations.py b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_09_01/aio/operations/_shares_operations.py new file mode 100644 index 000000000000..246846443d64 --- /dev/null +++ b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_09_01/aio/operations/_shares_operations.py @@ -0,0 +1,551 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling + +from ... import models as _models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class SharesOperations: + """SharesOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.databoxedge.v2020_09_01.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[~azure.mgmt.databoxedge.v2020_09_01.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 = "2020-09-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: ~azure.mgmt.databoxedge.v2020_09_01.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 = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('Share', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/shares/{name}'} # type: ignore + + async def _create_or_update_initial( + self, + device_name: str, + name: str, + resource_group_name: str, + share: "_models.Share", + **kwargs + ) -> Optional["_models.Share"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.Share"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._create_or_update_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(share, 'Share') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('Share', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/shares/{name}'} # type: ignore + + async def begin_create_or_update( + self, + device_name: str, + name: str, + resource_group_name: str, + share: "_models.Share", + **kwargs + ) -> AsyncLROPoller["_models.Share"]: + """Creates a new share or updates an existing share on the device. + + Creates a new share or updates an existing share on the device. + + :param device_name: The device name. + :type device_name: str + :param name: The share name. + :type name: str + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param share: The share properties. + :type share: ~azure.mgmt.databoxedge.v2020_09_01.models.Share + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: Pass in True if you'd like the AsyncARMPolling polling method, + False for no polling, or your own initialized polling object for a 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[~azure.mgmt.databoxedge.v2020_09_01.models.Share] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Share"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._create_or_update_initial( + device_name=device_name, + name=name, + resource_group_name=resource_group_name, + share=share, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('Share', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/shares/{name}'} # type: ignore + + async def _delete_initial( + self, + device_name: str, + name: str, + resource_group_name: str, + **kwargs + ) -> None: + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-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: Pass in True if you'd like the AsyncARMPolling polling method, + False for no polling, or your own initialized polling object for a 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 = "2020-09-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: Pass in True if you'd like the AsyncARMPolling polling method, + False for no polling, or your own initialized polling object for a 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/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_09_01/aio/operations/_storage_account_credentials_operations.py b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_09_01/aio/operations/_storage_account_credentials_operations.py new file mode 100644 index 000000000000..9c11230abb8d --- /dev/null +++ b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_09_01/aio/operations/_storage_account_credentials_operations.py @@ -0,0 +1,430 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling + +from ... import models as _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: ~azure.mgmt.databoxedge.v2020_09_01.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[~azure.mgmt.databoxedge.v2020_09_01.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 = "2020-09-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: ~azure.mgmt.databoxedge.v2020_09_01.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 = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('StorageAccountCredential', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/storageAccountCredentials/{name}'} # type: ignore + + async def _create_or_update_initial( + self, + device_name: str, + name: str, + resource_group_name: str, + storage_account_credential: "_models.StorageAccountCredential", + **kwargs + ) -> Optional["_models.StorageAccountCredential"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.StorageAccountCredential"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._create_or_update_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(storage_account_credential, 'StorageAccountCredential') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('StorageAccountCredential', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/storageAccountCredentials/{name}'} # type: ignore + + async def begin_create_or_update( + self, + device_name: str, + name: str, + resource_group_name: str, + storage_account_credential: "_models.StorageAccountCredential", + **kwargs + ) -> AsyncLROPoller["_models.StorageAccountCredential"]: + """Creates or updates the storage account credential. + + :param device_name: The device name. + :type device_name: str + :param name: The storage account credential name. + :type name: str + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param storage_account_credential: The storage account credential. + :type storage_account_credential: ~azure.mgmt.databoxedge.v2020_09_01.models.StorageAccountCredential + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: Pass in True if you'd like the AsyncARMPolling polling method, + False for no polling, or your own initialized polling object for a 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[~azure.mgmt.databoxedge.v2020_09_01.models.StorageAccountCredential] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.StorageAccountCredential"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._create_or_update_initial( + device_name=device_name, + name=name, + resource_group_name=resource_group_name, + storage_account_credential=storage_account_credential, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('StorageAccountCredential', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/storageAccountCredentials/{name}'} # type: ignore + + async def _delete_initial( + self, + device_name: str, + name: str, + resource_group_name: str, + **kwargs + ) -> None: + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-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: Pass in True if you'd like the AsyncARMPolling polling method, + False for no polling, or your own initialized polling object for a 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/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_09_01/aio/operations/_storage_accounts_operations.py b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_09_01/aio/operations/_storage_accounts_operations.py new file mode 100644 index 000000000000..59b3bd05ec14 --- /dev/null +++ b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_09_01/aio/operations/_storage_accounts_operations.py @@ -0,0 +1,434 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling + +from ... import models as _models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class StorageAccountsOperations: + """StorageAccountsOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.databoxedge.v2020_09_01.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list_by_data_box_edge_device( + self, + device_name: str, + resource_group_name: str, + **kwargs + ) -> AsyncIterable["_models.StorageAccountList"]: + """Lists all the StorageAccounts in a Data Box Edge/Data Box Gateway device. + + Lists all the StorageAccounts in a Data Box Edge/Data Box Gateway device. + + :param device_name: The device name. + :type device_name: str + :param resource_group_name: The resource group name. + :type resource_group_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either StorageAccountList or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.databoxedge.v2020_09_01.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 = "2020-09-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: ~azure.mgmt.databoxedge.v2020_09_01.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 = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'storageAccountName': self._serialize.url("storage_account_name", storage_account_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('StorageAccount', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/storageAccounts/{storageAccountName}'} # type: ignore + + async def _create_or_update_initial( + self, + device_name: str, + storage_account_name: str, + resource_group_name: str, + storage_account: "_models.StorageAccount", + **kwargs + ) -> Optional["_models.StorageAccount"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.StorageAccount"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._create_or_update_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'storageAccountName': self._serialize.url("storage_account_name", storage_account_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(storage_account, 'StorageAccount') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('StorageAccount', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/storageAccounts/{storageAccountName}'} # type: ignore + + async def begin_create_or_update( + self, + device_name: str, + storage_account_name: str, + resource_group_name: str, + storage_account: "_models.StorageAccount", + **kwargs + ) -> AsyncLROPoller["_models.StorageAccount"]: + """Creates a new StorageAccount or updates an existing StorageAccount on the device. + + Creates a new StorageAccount or updates an existing StorageAccount on the device. + + :param device_name: The device name. + :type device_name: str + :param storage_account_name: The StorageAccount name. + :type storage_account_name: str + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param storage_account: The StorageAccount properties. + :type storage_account: ~azure.mgmt.databoxedge.v2020_09_01.models.StorageAccount + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: Pass in True if you'd like the AsyncARMPolling polling method, + False for no polling, or your own initialized polling object for a 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[~azure.mgmt.databoxedge.v2020_09_01.models.StorageAccount] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.StorageAccount"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._create_or_update_initial( + device_name=device_name, + storage_account_name=storage_account_name, + resource_group_name=resource_group_name, + storage_account=storage_account, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('StorageAccount', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'storageAccountName': self._serialize.url("storage_account_name", storage_account_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/storageAccounts/{storageAccountName}'} # type: ignore + + async def _delete_initial( + self, + device_name: str, + storage_account_name: str, + resource_group_name: str, + **kwargs + ) -> None: + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-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: Pass in True if you'd like the AsyncARMPolling polling method, + False for no polling, or your own initialized polling object for a 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/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_09_01/aio/operations/_triggers_operations.py b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_09_01/aio/operations/_triggers_operations.py new file mode 100644 index 000000000000..47074ae7f1c3 --- /dev/null +++ b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_09_01/aio/operations/_triggers_operations.py @@ -0,0 +1,434 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling + +from ... import models as _models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class TriggersOperations: + """TriggersOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.databoxedge.v2020_09_01.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[~azure.mgmt.databoxedge.v2020_09_01.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 = "2020-09-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: ~azure.mgmt.databoxedge.v2020_09_01.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 = "2020-09-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 = "2020-09-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: ~azure.mgmt.databoxedge.v2020_09_01.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: Pass in True if you'd like the AsyncARMPolling polling method, + False for no polling, or your own initialized polling object for a 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[~azure.mgmt.databoxedge.v2020_09_01.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 = "2020-09-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: Pass in True if you'd like the AsyncARMPolling polling method, + False for no polling, or your own initialized polling object for a 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/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_09_01/aio/operations/_users_operations.py b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_09_01/aio/operations/_users_operations.py new file mode 100644 index 000000000000..7a72b497646b --- /dev/null +++ b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_09_01/aio/operations/_users_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 as _models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class UsersOperations: + """UsersOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.databoxedge.v2020_09_01.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, + expand: 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 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 UserList or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.databoxedge.v2020_09_01.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 = "2020-09-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 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('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: ~azure.mgmt.databoxedge.v2020_09_01.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 = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('User', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/users/{name}'} # type: ignore + + async def _create_or_update_initial( + self, + device_name: str, + name: str, + resource_group_name: str, + user: "_models.User", + **kwargs + ) -> Optional["_models.User"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.User"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._create_or_update_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(user, 'User') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('User', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/users/{name}'} # type: ignore + + async def begin_create_or_update( + self, + device_name: str, + name: str, + resource_group_name: str, + user: "_models.User", + **kwargs + ) -> AsyncLROPoller["_models.User"]: + """Creates a new user or updates an existing user's information on a Data Box Edge/Data Box + Gateway device. + + :param device_name: The device name. + :type device_name: str + :param name: The user name. + :type name: str + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param user: The user details. + :type user: ~azure.mgmt.databoxedge.v2020_09_01.models.User + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: Pass in True if you'd like the AsyncARMPolling polling method, + False for no polling, or your own initialized polling object for a 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[~azure.mgmt.databoxedge.v2020_09_01.models.User] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.User"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._create_or_update_initial( + device_name=device_name, + name=name, + resource_group_name=resource_group_name, + user=user, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('User', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/users/{name}'} # type: ignore + + async def _delete_initial( + self, + device_name: str, + name: str, + resource_group_name: str, + **kwargs + ) -> None: + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-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: Pass in True if you'd like the AsyncARMPolling polling method, + False for no polling, or your own initialized polling object for a 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/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_09_01/models/__init__.py b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_09_01/models/__init__.py new file mode 100644 index 000000000000..8b331ada40a8 --- /dev/null +++ b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_09_01/models/__init__.py @@ -0,0 +1,476 @@ +# 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 ARMBaseModel + from ._models_py3 import Addon + from ._models_py3 import AddonList + from ._models_py3 import Address + from ._models_py3 import Alert + from ._models_py3 import AlertErrorDetails + from ._models_py3 import AlertList + from ._models_py3 import ArcAddon + from ._models_py3 import AsymmetricEncryptedSecret + from ._models_py3 import Authentication + from ._models_py3 import AzureContainerInfo + from ._models_py3 import BandwidthSchedule + from ._models_py3 import BandwidthSchedulesList + from ._models_py3 import ClientAccessRight + from ._models_py3 import CloudEdgeManagementRole + from ._models_py3 import CloudErrorBody + from ._models_py3 import CniConfig + from ._models_py3 import ComputeResource + from ._models_py3 import ContactDetails + from ._models_py3 import Container + from ._models_py3 import ContainerList + from ._models_py3 import DCAccessCode + from ._models_py3 import DataBoxEdgeDevice + from ._models_py3 import DataBoxEdgeDeviceExtendedInfo + from ._models_py3 import DataBoxEdgeDeviceExtendedInfoPatch + from ._models_py3 import DataBoxEdgeDeviceList + from ._models_py3 import DataBoxEdgeDevicePatch + from ._models_py3 import DataBoxEdgeMoveRequest + from ._models_py3 import DataBoxEdgeSku + from ._models_py3 import DataBoxEdgeSkuList + from ._models_py3 import EdgeProfile + from ._models_py3 import EdgeProfilePatch + from ._models_py3 import EdgeProfileSubscription + from ._models_py3 import EdgeProfileSubscriptionPatch + from ._models_py3 import EtcdInfo + from ._models_py3 import FileEventTrigger + from ._models_py3 import FileSourceInfo + from ._models_py3 import GenerateCertResponse + from ._models_py3 import ImageRepositoryCredential + from ._models_py3 import IoTAddon + from ._models_py3 import IoTDeviceInfo + from ._models_py3 import IoTEdgeAgentInfo + from ._models_py3 import IoTRole + from ._models_py3 import Ipv4Config + from ._models_py3 import Ipv6Config + from ._models_py3 import Job + from ._models_py3 import JobErrorDetails + from ._models_py3 import JobErrorItem + from ._models_py3 import KubernetesClusterInfo + from ._models_py3 import KubernetesIPConfiguration + from ._models_py3 import KubernetesRole + from ._models_py3 import KubernetesRoleCompute + from ._models_py3 import KubernetesRoleNetwork + from ._models_py3 import KubernetesRoleResources + from ._models_py3 import KubernetesRoleStorage + from ._models_py3 import KubernetesRoleStorageClassInfo + from ._models_py3 import LoadBalancerConfig + from ._models_py3 import MECRole + from ._models_py3 import MetricConfiguration + from ._models_py3 import MetricCounter + from ._models_py3 import MetricCounterSet + from ._models_py3 import MetricDimension + from ._models_py3 import MetricDimensionV1 + from ._models_py3 import MetricSpecificationV1 + from ._models_py3 import MonitoringMetricConfiguration + from ._models_py3 import MonitoringMetricConfigurationList + from ._models_py3 import MountPointMap + from ._models_py3 import NetworkAdapter + from ._models_py3 import NetworkAdapterPosition + from ._models_py3 import NetworkSettings + from ._models_py3 import Node + from ._models_py3 import NodeInfo + from ._models_py3 import NodeList + from ._models_py3 import Operation + from ._models_py3 import OperationDisplay + from ._models_py3 import OperationsList + from ._models_py3 import Order + from ._models_py3 import OrderList + from ._models_py3 import OrderStatus + from ._models_py3 import PeriodicTimerEventTrigger + from ._models_py3 import PeriodicTimerSourceInfo + from ._models_py3 import RefreshDetails + from ._models_py3 import ResourceIdentity + from ._models_py3 import ResourceMoveDetails + from ._models_py3 import ResourceTypeSku + from ._models_py3 import Role + from ._models_py3 import RoleList + from ._models_py3 import RoleSinkInfo + from ._models_py3 import 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 SkuInformation + from ._models_py3 import SkuInformationList + from ._models_py3 import SkuLocationInfo + from ._models_py3 import StorageAccount + from ._models_py3 import StorageAccountCredential + from ._models_py3 import StorageAccountCredentialList + from ._models_py3 import StorageAccountList + from ._models_py3 import SubscriptionRegisteredFeatures + from ._models_py3 import SymmetricKey + from ._models_py3 import SystemData + from ._models_py3 import TrackingInfo + from ._models_py3 import Trigger + from ._models_py3 import TriggerList + from ._models_py3 import 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 ARMBaseModel # type: ignore + from ._models import Addon # type: ignore + from ._models import AddonList # type: ignore + from ._models import Address # type: ignore + from ._models import Alert # type: ignore + from ._models import AlertErrorDetails # type: ignore + from ._models import AlertList # type: ignore + from ._models import ArcAddon # type: ignore + from ._models import AsymmetricEncryptedSecret # type: ignore + from ._models import Authentication # type: ignore + from ._models import AzureContainerInfo # type: ignore + from ._models import BandwidthSchedule # type: ignore + from ._models import BandwidthSchedulesList # type: ignore + from ._models import ClientAccessRight # type: ignore + from ._models import CloudEdgeManagementRole # type: ignore + from ._models import CloudErrorBody # type: ignore + from ._models import CniConfig # type: ignore + from ._models import ComputeResource # type: ignore + from ._models import ContactDetails # type: ignore + from ._models import Container # type: ignore + from ._models import ContainerList # type: ignore + from ._models import DCAccessCode # type: ignore + from ._models import DataBoxEdgeDevice # type: ignore + from ._models import DataBoxEdgeDeviceExtendedInfo # type: ignore + from ._models import DataBoxEdgeDeviceExtendedInfoPatch # type: ignore + from ._models import DataBoxEdgeDeviceList # type: ignore + from ._models import DataBoxEdgeDevicePatch # type: ignore + from ._models import DataBoxEdgeMoveRequest # type: ignore + from ._models import DataBoxEdgeSku # type: ignore + from ._models import DataBoxEdgeSkuList # type: ignore + from ._models import EdgeProfile # type: ignore + from ._models import EdgeProfilePatch # type: ignore + from ._models import EdgeProfileSubscription # type: ignore + from ._models import EdgeProfileSubscriptionPatch # type: ignore + from ._models import EtcdInfo # type: ignore + from ._models import FileEventTrigger # type: ignore + from ._models import FileSourceInfo # type: ignore + from ._models import GenerateCertResponse # type: ignore + from ._models import ImageRepositoryCredential # type: ignore + from ._models import IoTAddon # type: ignore + from ._models import IoTDeviceInfo # type: ignore + from ._models import IoTEdgeAgentInfo # type: ignore + from ._models import IoTRole # type: ignore + from ._models import Ipv4Config # type: ignore + from ._models import Ipv6Config # type: ignore + from ._models import Job # type: ignore + from ._models import JobErrorDetails # type: ignore + from ._models import JobErrorItem # type: ignore + from ._models import KubernetesClusterInfo # type: ignore + from ._models import KubernetesIPConfiguration # type: ignore + from ._models import KubernetesRole # type: ignore + from ._models import KubernetesRoleCompute # type: ignore + from ._models import KubernetesRoleNetwork # type: ignore + from ._models import KubernetesRoleResources # type: ignore + from ._models import KubernetesRoleStorage # type: ignore + from ._models import KubernetesRoleStorageClassInfo # type: ignore + from ._models import LoadBalancerConfig # type: ignore + from ._models import MECRole # type: ignore + from ._models import MetricConfiguration # type: ignore + from ._models import MetricCounter # type: ignore + from ._models import MetricCounterSet # type: ignore + from ._models import MetricDimension # type: ignore + from ._models import MetricDimensionV1 # type: ignore + from ._models import MetricSpecificationV1 # type: ignore + from ._models import MonitoringMetricConfiguration # type: ignore + from ._models import MonitoringMetricConfigurationList # type: ignore + from ._models import MountPointMap # type: ignore + from ._models import NetworkAdapter # type: ignore + from ._models import NetworkAdapterPosition # type: ignore + from ._models import NetworkSettings # type: ignore + from ._models import Node # type: ignore + from ._models import NodeInfo # type: ignore + from ._models import NodeList # type: ignore + from ._models import Operation # type: ignore + from ._models import OperationDisplay # type: ignore + from ._models import OperationsList # type: ignore + from ._models import Order # type: ignore + from ._models import OrderList # type: ignore + from ._models import OrderStatus # type: ignore + from ._models import PeriodicTimerEventTrigger # type: ignore + from ._models import PeriodicTimerSourceInfo # type: ignore + from ._models import RefreshDetails # type: ignore + from ._models import ResourceIdentity # type: ignore + from ._models import ResourceMoveDetails # type: ignore + from ._models import ResourceTypeSku # type: ignore + from ._models import Role # type: ignore + from ._models import RoleList # type: ignore + from ._models import RoleSinkInfo # type: ignore + from ._models import 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 SkuInformation # type: ignore + from ._models import SkuInformationList # type: ignore + from ._models import SkuLocationInfo # type: ignore + from ._models import StorageAccount # type: ignore + from ._models import StorageAccountCredential # type: ignore + from ._models import StorageAccountCredentialList # type: ignore + from ._models import StorageAccountList # type: ignore + from ._models import SubscriptionRegisteredFeatures # type: ignore + from ._models import SymmetricKey # type: ignore + from ._models import SystemData # type: ignore + from ._models import TrackingInfo # type: ignore + from ._models import Trigger # type: ignore + from ._models import TriggerList # type: ignore + from ._models import 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, + AddonState, + AddonType, + AlertSeverity, + AuthenticationType, + AzureContainerDataFormat, + ClientPermissionType, + ContainerStatus, + CreatedByType, + DataBoxEdgeDeviceKind, + DataBoxEdgeDeviceStatus, + DataPolicy, + DayOfWeek, + DeviceType, + DownloadPhase, + EncryptionAlgorithm, + HostPlatformType, + InstallRebootBehavior, + JobStatus, + JobType, + KubernetesNodeType, + KubernetesState, + MetricAggregationType, + MetricCategory, + MetricUnit, + MonitoringStatus, + MountType, + MsiIdentityType, + NetworkAdapterDHCPStatus, + NetworkAdapterRDMAStatus, + NetworkAdapterStatus, + NetworkGroup, + NodeStatus, + OrderState, + PlatformType, + PosixComplianceStatus, + ResourceMoveStatus, + RoleStatus, + RoleTypes, + SSLStatus, + ShareAccessProtocol, + ShareAccessType, + ShareStatus, + ShipmentType, + SkuAvailability, + SkuName, + SkuSignupOption, + SkuTier, + SkuVersion, + StorageAccountStatus, + SubscriptionState, + TimeGrain, + TriggerEventType, + UpdateOperation, + UpdateOperationStage, + UserType, +) + +__all__ = [ + 'ARMBaseModel', + 'Addon', + 'AddonList', + 'Address', + 'Alert', + 'AlertErrorDetails', + 'AlertList', + 'ArcAddon', + 'AsymmetricEncryptedSecret', + 'Authentication', + 'AzureContainerInfo', + 'BandwidthSchedule', + 'BandwidthSchedulesList', + 'ClientAccessRight', + 'CloudEdgeManagementRole', + 'CloudErrorBody', + 'CniConfig', + 'ComputeResource', + 'ContactDetails', + 'Container', + 'ContainerList', + 'DCAccessCode', + 'DataBoxEdgeDevice', + 'DataBoxEdgeDeviceExtendedInfo', + 'DataBoxEdgeDeviceExtendedInfoPatch', + 'DataBoxEdgeDeviceList', + 'DataBoxEdgeDevicePatch', + 'DataBoxEdgeMoveRequest', + 'DataBoxEdgeSku', + 'DataBoxEdgeSkuList', + 'EdgeProfile', + 'EdgeProfilePatch', + 'EdgeProfileSubscription', + 'EdgeProfileSubscriptionPatch', + 'EtcdInfo', + 'FileEventTrigger', + 'FileSourceInfo', + 'GenerateCertResponse', + 'ImageRepositoryCredential', + 'IoTAddon', + 'IoTDeviceInfo', + 'IoTEdgeAgentInfo', + 'IoTRole', + 'Ipv4Config', + 'Ipv6Config', + 'Job', + 'JobErrorDetails', + 'JobErrorItem', + 'KubernetesClusterInfo', + 'KubernetesIPConfiguration', + 'KubernetesRole', + 'KubernetesRoleCompute', + 'KubernetesRoleNetwork', + 'KubernetesRoleResources', + 'KubernetesRoleStorage', + 'KubernetesRoleStorageClassInfo', + 'LoadBalancerConfig', + 'MECRole', + 'MetricConfiguration', + 'MetricCounter', + 'MetricCounterSet', + 'MetricDimension', + 'MetricDimensionV1', + 'MetricSpecificationV1', + 'MonitoringMetricConfiguration', + 'MonitoringMetricConfigurationList', + 'MountPointMap', + 'NetworkAdapter', + 'NetworkAdapterPosition', + 'NetworkSettings', + 'Node', + 'NodeInfo', + 'NodeList', + 'Operation', + 'OperationDisplay', + 'OperationsList', + 'Order', + 'OrderList', + 'OrderStatus', + 'PeriodicTimerEventTrigger', + 'PeriodicTimerSourceInfo', + 'RefreshDetails', + 'ResourceIdentity', + 'ResourceMoveDetails', + 'ResourceTypeSku', + 'Role', + 'RoleList', + 'RoleSinkInfo', + 'SecuritySettings', + 'ServiceSpecification', + 'Share', + 'ShareAccessRight', + 'ShareList', + 'Sku', + 'SkuCost', + 'SkuInformation', + 'SkuInformationList', + 'SkuLocationInfo', + 'StorageAccount', + 'StorageAccountCredential', + 'StorageAccountCredentialList', + 'StorageAccountList', + 'SubscriptionRegisteredFeatures', + 'SymmetricKey', + 'SystemData', + 'TrackingInfo', + 'Trigger', + 'TriggerList', + 'UpdateDownloadProgress', + 'UpdateInstallProgress', + 'UpdateSummary', + 'UploadCertificateRequest', + 'UploadCertificateResponse', + 'User', + 'UserAccessRight', + 'UserList', + 'AccountType', + 'AddonState', + 'AddonType', + 'AlertSeverity', + 'AuthenticationType', + 'AzureContainerDataFormat', + 'ClientPermissionType', + 'ContainerStatus', + 'CreatedByType', + 'DataBoxEdgeDeviceKind', + 'DataBoxEdgeDeviceStatus', + 'DataPolicy', + 'DayOfWeek', + 'DeviceType', + 'DownloadPhase', + 'EncryptionAlgorithm', + 'HostPlatformType', + 'InstallRebootBehavior', + 'JobStatus', + 'JobType', + 'KubernetesNodeType', + 'KubernetesState', + 'MetricAggregationType', + 'MetricCategory', + 'MetricUnit', + 'MonitoringStatus', + 'MountType', + 'MsiIdentityType', + 'NetworkAdapterDHCPStatus', + 'NetworkAdapterRDMAStatus', + 'NetworkAdapterStatus', + 'NetworkGroup', + 'NodeStatus', + 'OrderState', + 'PlatformType', + 'PosixComplianceStatus', + 'ResourceMoveStatus', + 'RoleStatus', + 'RoleTypes', + 'SSLStatus', + 'ShareAccessProtocol', + 'ShareAccessType', + 'ShareStatus', + 'ShipmentType', + 'SkuAvailability', + 'SkuName', + 'SkuSignupOption', + 'SkuTier', + 'SkuVersion', + 'StorageAccountStatus', + 'SubscriptionState', + 'TimeGrain', + 'TriggerEventType', + 'UpdateOperation', + 'UpdateOperationStage', + 'UserType', +] diff --git a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_09_01/models/_data_box_edge_management_client_enums.py b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_09_01/models/_data_box_edge_management_client_enums.py new file mode 100644 index 000000000000..0cec6392e961 --- /dev/null +++ b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_09_01/models/_data_box_edge_management_client_enums.py @@ -0,0 +1,546 @@ +# 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 AddonState(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Addon Provisioning State + """ + + INVALID = "Invalid" + CREATING = "Creating" + CREATED = "Created" + UPDATING = "Updating" + RECONFIGURING = "Reconfiguring" + FAILED = "Failed" + DELETING = "Deleting" + +class AddonType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Addon type. + """ + + IOT_EDGE = "IotEdge" + ARC_FOR_KUBERNETES = "ArcForKubernetes" + +class AlertSeverity(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Severity of the alert. + """ + + INFORMATIONAL = "Informational" + WARNING = "Warning" + CRITICAL = "Critical" + +class AuthenticationType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """The authentication type. + """ + + INVALID = "Invalid" + AZURE_ACTIVE_DIRECTORY = "AzureActiveDirectory" + +class AzureContainerDataFormat(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Storage format used for the file represented by the share. + """ + + BLOCK_BLOB = "BlockBlob" + PAGE_BLOB = "PageBlob" + AZURE_FILE = "AzureFile" + +class ClientPermissionType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Type of access to be allowed for the client. + """ + + NO_ACCESS = "NoAccess" + READ_ONLY = "ReadOnly" + READ_WRITE = "ReadWrite" + +class ContainerStatus(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Current status of the container. + """ + + OK = "OK" + OFFLINE = "Offline" + UNKNOWN = "Unknown" + UPDATING = "Updating" + NEEDS_ATTENTION = "NeedsAttention" + +class CreatedByType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """The type of identity that created the resource. + """ + + USER = "User" + APPLICATION = "Application" + MANAGED_IDENTITY = "ManagedIdentity" + KEY = "Key" + +class DataBoxEdgeDeviceKind(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """The etag for the devices. + """ + + AZURE_DATA_BOX_GATEWAY = "AzureDataBoxGateway" + AZURE_STACK_EDGE = "AzureStackEdge" + AZURE_STACK_HUB = "AzureStackHub" + AZURE_MODULAR_DATA_CENTRE = "AzureModularDataCentre" + +class DataBoxEdgeDeviceStatus(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """The status of the Data Box Edge/Gateway device. + """ + + READY_TO_SETUP = "ReadyToSetup" + ONLINE = "Online" + OFFLINE = "Offline" + NEEDS_ATTENTION = "NeedsAttention" + DISCONNECTED = "Disconnected" + PARTIALLY_DISCONNECTED = "PartiallyDisconnected" + MAINTENANCE = "Maintenance" + +class DataPolicy(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Data policy of the share. + """ + + CLOUD = "Cloud" + LOCAL = "Local" + +class DayOfWeek(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + + SUNDAY = "Sunday" + MONDAY = "Monday" + TUESDAY = "Tuesday" + WEDNESDAY = "Wednesday" + THURSDAY = "Thursday" + FRIDAY = "Friday" + SATURDAY = "Saturday" + +class DeviceType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """The type of the Data Box Edge/Gateway device. + """ + + DATA_BOX_EDGE_DEVICE = "DataBoxEdgeDevice" + +class DownloadPhase(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """The download phase. + """ + + UNKNOWN = "Unknown" + INITIALIZING = "Initializing" + DOWNLOADING = "Downloading" + VERIFYING = "Verifying" + +class EncryptionAlgorithm(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """The algorithm used to encrypt "Value". + """ + + NONE = "None" + AES256 = "AES256" + RSAES_PKCS1_V1_5 = "RSAES_PKCS1_v_1_5" + +class HostPlatformType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Platform where the runtime is hosted. + """ + + KUBERNETES_CLUSTER = "KubernetesCluster" + LINUX_VM = "LinuxVM" + +class InstallRebootBehavior(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Indicates if updates are available and at least one of the updates needs a reboot. + """ + + NEVER_REBOOTS = "NeverReboots" + REQUIRES_REBOOT = "RequiresReboot" + REQUEST_REBOOT = "RequestReboot" + +class JobStatus(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """The current status of the job. + """ + + INVALID = "Invalid" + RUNNING = "Running" + SUCCEEDED = "Succeeded" + FAILED = "Failed" + CANCELED = "Canceled" + PAUSED = "Paused" + SCHEDULED = "Scheduled" + +class JobType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """The type of the job. + """ + + INVALID = "Invalid" + SCAN_FOR_UPDATES = "ScanForUpdates" + DOWNLOAD_UPDATES = "DownloadUpdates" + INSTALL_UPDATES = "InstallUpdates" + REFRESH_SHARE = "RefreshShare" + REFRESH_CONTAINER = "RefreshContainer" + BACKUP = "Backup" + RESTORE = "Restore" + TRIGGER_SUPPORT_PACKAGE = "TriggerSupportPackage" + +class KubernetesNodeType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Node type - Master/Worker + """ + + INVALID = "Invalid" + MASTER = "Master" + WORKER = "Worker" + +class KubernetesState(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """State of Kubernetes deployment + """ + + INVALID = "Invalid" + CREATING = "Creating" + CREATED = "Created" + UPDATING = "Updating" + RECONFIGURING = "Reconfiguring" + FAILED = "Failed" + DELETING = "Deleting" + +class MetricAggregationType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Metric aggregation type. + """ + + NOT_SPECIFIED = "NotSpecified" + NONE = "None" + AVERAGE = "Average" + MINIMUM = "Minimum" + MAXIMUM = "Maximum" + TOTAL = "Total" + COUNT = "Count" + +class MetricCategory(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Metric category. + """ + + CAPACITY = "Capacity" + TRANSACTION = "Transaction" + +class MetricUnit(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Metric units. + """ + + NOT_SPECIFIED = "NotSpecified" + PERCENT = "Percent" + COUNT = "Count" + SECONDS = "Seconds" + MILLISECONDS = "Milliseconds" + BYTES = "Bytes" + BYTES_PER_SECOND = "BytesPerSecond" + COUNT_PER_SECOND = "CountPerSecond" + +class MonitoringStatus(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Current monitoring status of the share. + """ + + ENABLED = "Enabled" + DISABLED = "Disabled" + +class MountType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Mounting type. + """ + + VOLUME = "Volume" + HOST_PATH = "HostPath" + +class MsiIdentityType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Identity type + """ + + NONE = "None" + SYSTEM_ASSIGNED = "SystemAssigned" + USER_ASSIGNED = "UserAssigned" + +class NetworkAdapterDHCPStatus(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Value indicating whether this adapter has DHCP enabled. + """ + + DISABLED = "Disabled" + ENABLED = "Enabled" + +class NetworkAdapterRDMAStatus(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Value indicating whether this adapter is RDMA capable. + """ + + INCAPABLE = "Incapable" + CAPABLE = "Capable" + +class NetworkAdapterStatus(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Value indicating whether this adapter is valid. + """ + + INACTIVE = "Inactive" + ACTIVE = "Active" + +class NetworkGroup(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """The network group. + """ + + NONE = "None" + NON_RDMA = "NonRDMA" + RDMA = "RDMA" + +class NodeStatus(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """The current status of the individual node + """ + + UNKNOWN = "Unknown" + UP = "Up" + DOWN = "Down" + REBOOTING = "Rebooting" + SHUTTING_DOWN = "ShuttingDown" + +class OrderState(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Status of the order as per the allowed status types. + """ + + UNTRACKED = "Untracked" + AWAITING_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" + AWAITING_PICKUP = "AwaitingPickup" + PICKUP_COMPLETED = "PickupCompleted" + AWAITING_DROP = "AwaitingDrop" + +class PlatformType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Host OS supported by the Arc addon. + """ + + WINDOWS = "Windows" + LINUX = "Linux" + +class PosixComplianceStatus(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """If provisioned storage is posix compliant. + """ + + INVALID = "Invalid" + ENABLED = "Enabled" + DISABLED = "Disabled" + +class ResourceMoveStatus(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Denotes whether move operation is in progress + """ + + NONE = "None" + RESOURCE_MOVE_IN_PROGRESS = "ResourceMoveInProgress" + RESOURCE_MOVE_FAILED = "ResourceMoveFailed" + +class RoleStatus(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Local Edge Management Status + """ + + ENABLED = "Enabled" + DISABLED = "Disabled" + +class RoleTypes(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + + IOT = "IOT" + ASA = "ASA" + FUNCTIONS = "Functions" + COGNITIVE = "Cognitive" + MEC = "MEC" + CLOUD_EDGE_MANAGEMENT = "CloudEdgeManagement" + KUBERNETES = "Kubernetes" + +class ShareAccessProtocol(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Access protocol to be used by the share. + """ + + SMB = "SMB" + NFS = "NFS" + +class ShareAccessType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Type of access to be allowed on the share for this user. + """ + + CHANGE = "Change" + READ = "Read" + CUSTOM = "Custom" + +class ShareStatus(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Current status of the share. + """ + + OFFLINE = "Offline" + UNKNOWN = "Unknown" + OK = "OK" + UPDATING = "Updating" + NEEDS_ATTENTION = "NeedsAttention" + +class ShipmentType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + + NOT_APPLICABLE = "NotApplicable" + SHIPPED_TO_CUSTOMER = "ShippedToCustomer" + SELF_PICKUP = "SelfPickup" + +class SkuAvailability(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Links to the next set of results + """ + + AVAILABLE = "Available" + UNAVAILABLE = "Unavailable" + +class SkuName(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """The Sku name. + """ + + GATEWAY = "Gateway" + EDGE = "Edge" + TEA1_NODE = "TEA_1Node" + TEA1_NODE_UPS = "TEA_1Node_UPS" + TEA1_NODE_HEATER = "TEA_1Node_Heater" + TEA1_NODE_UPS_HEATER = "TEA_1Node_UPS_Heater" + TEA4_NODE_HEATER = "TEA_4Node_Heater" + TEA4_NODE_UPS_HEATER = "TEA_4Node_UPS_Heater" + TMA = "TMA" + TDC = "TDC" + TCA_SMALL = "TCA_Small" + GPU = "GPU" + TCA_LARGE = "TCA_Large" + EDGE_P_BASE = "EdgeP_Base" + EDGE_P_HIGH = "EdgeP_High" + EDGE_PR_BASE = "EdgePR_Base" + EDGE_PR_BASE_UPS = "EdgePR_Base_UPS" + EDGE_MR_MINI = "EdgeMR_Mini" + RCA_SMALL = "RCA_Small" + RCA_LARGE = "RCA_Large" + RDC = "RDC" + +class SkuSignupOption(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Sku can be signed up by customer or not. + """ + + NONE = "None" + AVAILABLE = "Available" + +class SkuTier(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """The Sku tier. + """ + + STANDARD = "Standard" + +class SkuVersion(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Availability of the Sku as preview/stable. + """ + + STABLE = "Stable" + PREVIEW = "Preview" + +class SSLStatus(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Signifies whether SSL needs to be enabled or not. + """ + + ENABLED = "Enabled" + DISABLED = "Disabled" + +class StorageAccountStatus(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Current status of the storage account + """ + + OK = "OK" + OFFLINE = "Offline" + UNKNOWN = "Unknown" + UPDATING = "Updating" + NEEDS_ATTENTION = "NeedsAttention" + +class SubscriptionState(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + + REGISTERED = "Registered" + WARNED = "Warned" + SUSPENDED = "Suspended" + DELETED = "Deleted" + UNREGISTERED = "Unregistered" + +class TimeGrain(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + + PT1_M = "PT1M" + PT5_M = "PT5M" + PT15_M = "PT15M" + PT30_M = "PT30M" + PT1_H = "PT1H" + PT6_H = "PT6H" + PT12_H = "PT12H" + PT1_D = "PT1D" + +class TriggerEventType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Trigger Kind. + """ + + FILE_EVENT = "FileEvent" + PERIODIC_TIMER_EVENT = "PeriodicTimerEvent" + +class UpdateOperation(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """The current update operation. + """ + + NONE = "None" + SCAN = "Scan" + DOWNLOAD = "Download" + INSTALL = "Install" + +class UpdateOperationStage(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Current stage of the update operation. + """ + + UNKNOWN = "Unknown" + INITIAL = "Initial" + SCAN_STARTED = "ScanStarted" + SCAN_COMPLETE = "ScanComplete" + SCAN_FAILED = "ScanFailed" + DOWNLOAD_STARTED = "DownloadStarted" + DOWNLOAD_COMPLETE = "DownloadComplete" + DOWNLOAD_FAILED = "DownloadFailed" + INSTALL_STARTED = "InstallStarted" + INSTALL_COMPLETE = "InstallComplete" + INSTALL_FAILED = "InstallFailed" + REBOOT_INITIATED = "RebootInitiated" + SUCCESS = "Success" + FAILURE = "Failure" + RESCAN_STARTED = "RescanStarted" + RESCAN_COMPLETE = "RescanComplete" + RESCAN_FAILED = "RescanFailed" + +class UserType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Type of the user. + """ + + SHARE = "Share" + LOCAL_MANAGEMENT = "LocalManagement" + ARM = "ARM" diff --git a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_09_01/models/_models.py b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_09_01/models/_models.py new file mode 100644 index 000000000000..b67bee38c64f --- /dev/null +++ b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_09_01/models/_models.py @@ -0,0 +1,4986 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +import msrest.serialization + + +class ARMBaseModel(msrest.serialization.Model): + """Represents the base class for all object models. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: The path ID that uniquely identifies the object. + :vartype id: str + :ivar name: The object name. + :vartype name: str + :ivar type: The hierarchical type of the object. + :vartype type: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ARMBaseModel, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None + + +class Addon(ARMBaseModel): + """Role Addon. + + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: ArcAddon, IoTAddon. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: The path ID that uniquely identifies the object. + :vartype id: str + :ivar name: The object name. + :vartype name: str + :ivar type: The hierarchical type of the object. + :vartype type: str + :param kind: Required. Addon type.Constant filled by server. Possible values include: + "IotEdge", "ArcForKubernetes". + :type kind: str or ~azure.mgmt.databoxedge.v2020_09_01.models.AddonType + :ivar system_data: Addon type. + :vartype system_data: ~azure.mgmt.databoxedge.v2020_09_01.models.SystemData + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'kind': {'required': True}, + 'system_data': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + } + + _subtype_map = { + 'kind': {'ArcForKubernetes': 'ArcAddon', 'IotEdge': 'IoTAddon'} + } + + def __init__( + self, + **kwargs + ): + super(Addon, self).__init__(**kwargs) + self.kind = 'Addon' # type: str + self.system_data = None + + +class AddonList(msrest.serialization.Model): + """Collection of all the Role addon on the Azure Stack Edge device. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar value: The Value. + :vartype value: list[~azure.mgmt.databoxedge.v2020_09_01.models.Addon] + :ivar next_link: Link to the next set of results. + :vartype next_link: str + """ + + _validation = { + 'value': {'readonly': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[Addon]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(AddonList, self).__init__(**kwargs) + self.value = None + self.next_link = None + + +class Address(msrest.serialization.Model): + """The shipping address of the customer. + + All required parameters must be populated in order to send to Azure. + + :param address_line1: The address line1. + :type address_line1: str + :param address_line2: The address line2. + :type address_line2: str + :param address_line3: The address line3. + :type address_line3: str + :param postal_code: The postal code. + :type postal_code: str + :param city: The city name. + :type city: str + :param state: The state name. + :type state: str + :param country: Required. The country name. + :type country: str + """ + + _validation = { + 'country': {'required': True}, + } + + _attribute_map = { + 'address_line1': {'key': 'addressLine1', 'type': 'str'}, + 'address_line2': {'key': 'addressLine2', 'type': 'str'}, + 'address_line3': {'key': 'addressLine3', 'type': 'str'}, + 'postal_code': {'key': 'postalCode', 'type': 'str'}, + 'city': {'key': 'city', 'type': 'str'}, + 'state': {'key': 'state', 'type': 'str'}, + 'country': {'key': 'country', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(Address, self).__init__(**kwargs) + self.address_line1 = kwargs.get('address_line1', None) + self.address_line2 = kwargs.get('address_line2', None) + self.address_line3 = kwargs.get('address_line3', None) + self.postal_code = kwargs.get('postal_code', None) + self.city = kwargs.get('city', None) + self.state = kwargs.get('state', None) + self.country = kwargs['country'] + + +class Alert(ARMBaseModel): + """Alert on the data box edge/gateway device. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: The path ID that uniquely identifies the object. + :vartype id: str + :ivar name: The object name. + :vartype name: str + :ivar type: The hierarchical type of the object. + :vartype type: str + :ivar system_data: Alert generated in the resource. + :vartype system_data: ~azure.mgmt.databoxedge.v2020_09_01.models.SystemData + :ivar title: Alert title. + :vartype title: str + :ivar alert_type: Alert type. + :vartype alert_type: str + :ivar appeared_at_date_time: UTC time when the alert appeared. + :vartype appeared_at_date_time: ~datetime.datetime + :ivar recommendation: Alert recommendation. + :vartype recommendation: str + :ivar severity: Severity of the alert. Possible values include: "Informational", "Warning", + "Critical". + :vartype severity: str or ~azure.mgmt.databoxedge.v2020_09_01.models.AlertSeverity + :ivar error_details: Error details of the alert. + :vartype error_details: ~azure.mgmt.databoxedge.v2020_09_01.models.AlertErrorDetails + :ivar detailed_information: Alert details. + :vartype detailed_information: dict[str, str] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'system_data': {'readonly': True}, + 'title': {'readonly': True}, + 'alert_type': {'readonly': True}, + 'appeared_at_date_time': {'readonly': True}, + 'recommendation': {'readonly': True}, + 'severity': {'readonly': True}, + 'error_details': {'readonly': True}, + 'detailed_information': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'title': {'key': 'properties.title', 'type': 'str'}, + 'alert_type': {'key': 'properties.alertType', 'type': 'str'}, + 'appeared_at_date_time': {'key': 'properties.appearedAtDateTime', 'type': 'iso-8601'}, + 'recommendation': {'key': 'properties.recommendation', 'type': 'str'}, + 'severity': {'key': 'properties.severity', 'type': 'str'}, + 'error_details': {'key': 'properties.errorDetails', 'type': 'AlertErrorDetails'}, + 'detailed_information': {'key': 'properties.detailedInformation', 'type': '{str}'}, + } + + def __init__( + self, + **kwargs + ): + super(Alert, self).__init__(**kwargs) + self.system_data = None + self.title = None + self.alert_type = None + self.appeared_at_date_time = None + self.recommendation = None + self.severity = None + self.error_details = None + self.detailed_information = None + + +class AlertErrorDetails(msrest.serialization.Model): + """Error details for the alert. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar error_code: Error code. + :vartype error_code: str + :ivar error_message: Error Message. + :vartype error_message: str + :ivar occurrences: Number of occurrences. + :vartype occurrences: int + """ + + _validation = { + 'error_code': {'readonly': True}, + 'error_message': {'readonly': True}, + 'occurrences': {'readonly': True}, + } + + _attribute_map = { + 'error_code': {'key': 'errorCode', 'type': 'str'}, + 'error_message': {'key': 'errorMessage', 'type': 'str'}, + 'occurrences': {'key': 'occurrences', 'type': 'int'}, + } + + def __init__( + self, + **kwargs + ): + super(AlertErrorDetails, self).__init__(**kwargs) + self.error_code = None + self.error_message = None + self.occurrences = None + + +class AlertList(msrest.serialization.Model): + """Collection of alerts. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar value: The value. + :vartype value: list[~azure.mgmt.databoxedge.v2020_09_01.models.Alert] + :ivar next_link: Link to the next set of results. + :vartype next_link: str + """ + + _validation = { + 'value': {'readonly': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[Alert]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(AlertList, self).__init__(**kwargs) + self.value = None + self.next_link = None + + +class ArcAddon(Addon): + """Arc Addon. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: The path ID that uniquely identifies the object. + :vartype id: str + :ivar name: The object name. + :vartype name: str + :ivar type: The hierarchical type of the object. + :vartype type: str + :param kind: Required. Addon type.Constant filled by server. Possible values include: + "IotEdge", "ArcForKubernetes". + :type kind: str or ~azure.mgmt.databoxedge.v2020_09_01.models.AddonType + :ivar system_data: Addon type. + :vartype system_data: ~azure.mgmt.databoxedge.v2020_09_01.models.SystemData + :param subscription_id: Required. Arc resource subscription Id. + :type subscription_id: str + :param resource_group_name: Required. Arc resource group name. + :type resource_group_name: str + :param resource_name: Required. Arc resource Name. + :type resource_name: str + :param resource_location: Required. Arc resource location. + :type resource_location: str + :ivar version: Arc resource version. + :vartype version: str + :ivar host_platform: Host OS supported by the Arc addon. Possible values include: "Windows", + "Linux". + :vartype host_platform: str or ~azure.mgmt.databoxedge.v2020_09_01.models.PlatformType + :ivar host_platform_type: Platform where the runtime is hosted. Possible values include: + "KubernetesCluster", "LinuxVM". + :vartype host_platform_type: str or ~azure.mgmt.databoxedge.v2020_09_01.models.HostPlatformType + :ivar provisioning_state: Addon Provisioning State. Possible values include: "Invalid", + "Creating", "Created", "Updating", "Reconfiguring", "Failed", "Deleting". + :vartype provisioning_state: str or ~azure.mgmt.databoxedge.v2020_09_01.models.AddonState + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'kind': {'required': True}, + 'system_data': {'readonly': True}, + 'subscription_id': {'required': True}, + 'resource_group_name': {'required': True}, + 'resource_name': {'required': True}, + 'resource_location': {'required': True}, + 'version': {'readonly': True}, + 'host_platform': {'readonly': True}, + 'host_platform_type': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'subscription_id': {'key': 'properties.subscriptionId', 'type': 'str'}, + 'resource_group_name': {'key': 'properties.resourceGroupName', 'type': 'str'}, + 'resource_name': {'key': 'properties.resourceName', 'type': 'str'}, + 'resource_location': {'key': 'properties.resourceLocation', 'type': 'str'}, + 'version': {'key': 'properties.version', 'type': 'str'}, + 'host_platform': {'key': 'properties.hostPlatform', 'type': 'str'}, + 'host_platform_type': {'key': 'properties.hostPlatformType', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ArcAddon, self).__init__(**kwargs) + self.kind = 'ArcForKubernetes' # type: str + self.subscription_id = kwargs['subscription_id'] + self.resource_group_name = kwargs['resource_group_name'] + self.resource_name = kwargs['resource_name'] + self.resource_location = kwargs['resource_location'] + self.version = None + self.host_platform = None + self.host_platform_type = None + self.provisioning_state = None + + +class AsymmetricEncryptedSecret(msrest.serialization.Model): + """Represent the secrets intended for encryption with asymmetric key pair. + + All required parameters must be populated in order to send to Azure. + + :param value: Required. The value of the secret. + :type value: str + :param encryption_cert_thumbprint: Thumbprint certificate used to encrypt \"Value\". If the + value is unencrypted, it will be null. + :type encryption_cert_thumbprint: str + :param encryption_algorithm: Required. The algorithm used to encrypt "Value". Possible values + include: "None", "AES256", "RSAES_PKCS1_v_1_5". + :type encryption_algorithm: str or + ~azure.mgmt.databoxedge.v2020_09_01.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: ~azure.mgmt.databoxedge.v2020_09_01.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 ~azure.mgmt.databoxedge.v2020_09_01.models.AzureContainerDataFormat + """ + + _validation = { + 'storage_account_credential_id': {'required': True}, + 'container_name': {'required': True}, + 'data_format': {'required': True}, + } + + _attribute_map = { + 'storage_account_credential_id': {'key': 'storageAccountCredentialId', 'type': 'str'}, + 'container_name': {'key': 'containerName', 'type': 'str'}, + 'data_format': {'key': 'dataFormat', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(AzureContainerInfo, self).__init__(**kwargs) + self.storage_account_credential_id = kwargs['storage_account_credential_id'] + self.container_name = kwargs['container_name'] + self.data_format = kwargs['data_format'] + + +class BandwidthSchedule(ARMBaseModel): + """The bandwidth schedule details. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: The path ID that uniquely identifies the object. + :vartype id: str + :ivar name: The object name. + :vartype name: str + :ivar type: The hierarchical type of the object. + :vartype type: str + :ivar system_data: Bandwidth object related to ASE resource. + :vartype system_data: ~azure.mgmt.databoxedge.v2020_09_01.models.SystemData + :param start: Required. The start time of the schedule in UTC. + :type start: str + :param stop: Required. The stop time of the schedule in UTC. + :type stop: str + :param rate_in_mbps: Required. The bandwidth rate in Mbps. + :type rate_in_mbps: int + :param days: Required. The days of the week when this schedule is applicable. + :type days: list[str or ~azure.mgmt.databoxedge.v2020_09_01.models.DayOfWeek] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'system_data': {'readonly': True}, + 'start': {'required': True}, + 'stop': {'required': True}, + 'rate_in_mbps': {'required': True}, + 'days': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'start': {'key': 'properties.start', 'type': 'str'}, + 'stop': {'key': 'properties.stop', 'type': 'str'}, + 'rate_in_mbps': {'key': 'properties.rateInMbps', 'type': 'int'}, + 'days': {'key': 'properties.days', 'type': '[str]'}, + } + + def __init__( + self, + **kwargs + ): + super(BandwidthSchedule, self).__init__(**kwargs) + self.system_data = None + self.start = kwargs['start'] + self.stop = kwargs['stop'] + self.rate_in_mbps = kwargs['rate_in_mbps'] + self.days = kwargs['days'] + + +class BandwidthSchedulesList(msrest.serialization.Model): + """The collection of bandwidth schedules. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar value: The list of bandwidth schedules. + :vartype value: list[~azure.mgmt.databoxedge.v2020_09_01.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 ~azure.mgmt.databoxedge.v2020_09_01.models.ClientPermissionType + """ + + _validation = { + 'client': {'required': True}, + 'access_permission': {'required': True}, + } + + _attribute_map = { + 'client': {'key': 'client', 'type': 'str'}, + 'access_permission': {'key': 'accessPermission', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ClientAccessRight, self).__init__(**kwargs) + self.client = kwargs['client'] + self.access_permission = kwargs['access_permission'] + + +class Role(ARMBaseModel): + """Compute role. + + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: CloudEdgeManagementRole, IoTRole, KubernetesRole, MECRole. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: The path ID that uniquely identifies the object. + :vartype id: str + :ivar name: The object name. + :vartype name: str + :ivar type: The hierarchical type of the object. + :vartype type: str + :param kind: Required. Role type.Constant filled by server. Possible values include: "IOT", + "ASA", "Functions", "Cognitive", "MEC", "CloudEdgeManagement", "Kubernetes". + :type kind: str or ~azure.mgmt.databoxedge.v2020_09_01.models.RoleTypes + :ivar system_data: Role configured on ASE resource. + :vartype system_data: ~azure.mgmt.databoxedge.v2020_09_01.models.SystemData + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'kind': {'required': True}, + 'system_data': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + } + + _subtype_map = { + 'kind': {'CloudEdgeManagement': 'CloudEdgeManagementRole', 'IOT': 'IoTRole', 'Kubernetes': 'KubernetesRole', 'MEC': 'MECRole'} + } + + def __init__( + self, + **kwargs + ): + super(Role, self).__init__(**kwargs) + self.kind = 'Role' # type: str + self.system_data = None + + +class CloudEdgeManagementRole(Role): + """CloudEdgeManagementRole role. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: The path ID that uniquely identifies the object. + :vartype id: str + :ivar name: The object name. + :vartype name: str + :ivar type: The hierarchical type of the object. + :vartype type: str + :param kind: Required. Role type.Constant filled by server. Possible values include: "IOT", + "ASA", "Functions", "Cognitive", "MEC", "CloudEdgeManagement", "Kubernetes". + :type kind: str or ~azure.mgmt.databoxedge.v2020_09_01.models.RoleTypes + :ivar system_data: Role configured on ASE resource. + :vartype system_data: ~azure.mgmt.databoxedge.v2020_09_01.models.SystemData + :ivar local_management_status: Local Edge Management Status. Possible values include: + "Enabled", "Disabled". + :vartype local_management_status: str or ~azure.mgmt.databoxedge.v2020_09_01.models.RoleStatus + :ivar edge_profile: Edge Profile of the resource. + :vartype edge_profile: ~azure.mgmt.databoxedge.v2020_09_01.models.EdgeProfile + :param role_status: Role status. Possible values include: "Enabled", "Disabled". + :type role_status: str or ~azure.mgmt.databoxedge.v2020_09_01.models.RoleStatus + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'kind': {'required': True}, + 'system_data': {'readonly': True}, + 'local_management_status': {'readonly': True}, + 'edge_profile': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'local_management_status': {'key': 'properties.localManagementStatus', 'type': 'str'}, + 'edge_profile': {'key': 'properties.edgeProfile', 'type': 'EdgeProfile'}, + 'role_status': {'key': 'properties.roleStatus', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(CloudEdgeManagementRole, self).__init__(**kwargs) + self.kind = 'CloudEdgeManagement' # type: str + self.local_management_status = None + self.edge_profile = None + self.role_status = kwargs.get('role_status', None) + + +class CloudErrorBody(msrest.serialization.Model): + """An error response from the service. + + :param code: An identifier for the error. Codes are invariant and are intended to be consumed + programmatically. + :type code: str + :param message: A message describing the error, intended to be suitable for display in a user + interface. + :type message: str + :param details: A list of additional details about the error. + :type details: list[~azure.mgmt.databoxedge.v2020_09_01.models.CloudErrorBody] + """ + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + 'details': {'key': 'details', 'type': '[CloudErrorBody]'}, + } + + def __init__( + self, + **kwargs + ): + super(CloudErrorBody, self).__init__(**kwargs) + self.code = kwargs.get('code', None) + self.message = kwargs.get('message', None) + self.details = kwargs.get('details', None) + + +class CniConfig(msrest.serialization.Model): + """Cni configuration. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar type: Cni type. + :vartype type: str + :ivar version: Cni version. + :vartype version: str + :ivar pod_subnet: Pod Subnet. + :vartype pod_subnet: str + :ivar service_subnet: Service subnet. + :vartype service_subnet: str + """ + + _validation = { + 'type': {'readonly': True}, + 'version': {'readonly': True}, + 'pod_subnet': {'readonly': True}, + 'service_subnet': {'readonly': True}, + } + + _attribute_map = { + 'type': {'key': 'type', 'type': 'str'}, + 'version': {'key': 'version', 'type': 'str'}, + 'pod_subnet': {'key': 'podSubnet', 'type': 'str'}, + 'service_subnet': {'key': 'serviceSubnet', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(CniConfig, self).__init__(**kwargs) + self.type = None + self.version = None + self.pod_subnet = None + self.service_subnet = None + + +class ComputeResource(msrest.serialization.Model): + """Compute infrastructure Resource. + + All required parameters must be populated in order to send to Azure. + + :param processor_count: Required. Processor count. + :type processor_count: int + :param memory_in_gb: Required. Memory in GB. + :type memory_in_gb: long + """ + + _validation = { + 'processor_count': {'required': True}, + 'memory_in_gb': {'required': True}, + } + + _attribute_map = { + 'processor_count': {'key': 'processorCount', 'type': 'int'}, + 'memory_in_gb': {'key': 'memoryInGB', 'type': 'long'}, + } + + def __init__( + self, + **kwargs + ): + super(ComputeResource, self).__init__(**kwargs) + self.processor_count = kwargs['processor_count'] + self.memory_in_gb = kwargs['memory_in_gb'] + + +class ContactDetails(msrest.serialization.Model): + """Contains all the contact details of the customer. + + All required parameters must be populated in order to send to Azure. + + :param contact_person: Required. The contact person name. + :type contact_person: str + :param company_name: Required. The name of the company. + :type company_name: str + :param phone: Required. The phone number. + :type phone: str + :param email_list: Required. The email list. + :type email_list: list[str] + """ + + _validation = { + 'contact_person': {'required': True}, + 'company_name': {'required': True}, + 'phone': {'required': True}, + 'email_list': {'required': True}, + } + + _attribute_map = { + 'contact_person': {'key': 'contactPerson', 'type': 'str'}, + 'company_name': {'key': 'companyName', 'type': 'str'}, + 'phone': {'key': 'phone', 'type': 'str'}, + 'email_list': {'key': 'emailList', 'type': '[str]'}, + } + + def __init__( + self, + **kwargs + ): + super(ContactDetails, self).__init__(**kwargs) + self.contact_person = kwargs['contact_person'] + self.company_name = kwargs['company_name'] + self.phone = kwargs['phone'] + self.email_list = kwargs['email_list'] + + +class Container(ARMBaseModel): + """Represents a container on the Data Box Edge/Gateway device. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: The path ID that uniquely identifies the object. + :vartype id: str + :ivar name: The object name. + :vartype name: str + :ivar type: The hierarchical type of the object. + :vartype type: str + :ivar system_data: Container in DataBoxEdge Resource. + :vartype system_data: ~azure.mgmt.databoxedge.v2020_09_01.models.SystemData + :ivar container_status: Current status of the container. Possible values include: "OK", + "Offline", "Unknown", "Updating", "NeedsAttention". + :vartype container_status: str or ~azure.mgmt.databoxedge.v2020_09_01.models.ContainerStatus + :param data_format: Required. DataFormat for Container. Possible values include: "BlockBlob", + "PageBlob", "AzureFile". + :type data_format: str or ~azure.mgmt.databoxedge.v2020_09_01.models.AzureContainerDataFormat + :ivar refresh_details: Details of the refresh job on this container. + :vartype refresh_details: ~azure.mgmt.databoxedge.v2020_09_01.models.RefreshDetails + :ivar created_date_time: The UTC time when container got created. + :vartype created_date_time: ~datetime.datetime + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'system_data': {'readonly': True}, + 'container_status': {'readonly': True}, + 'data_format': {'required': True}, + 'refresh_details': {'readonly': True}, + 'created_date_time': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'container_status': {'key': 'properties.containerStatus', 'type': 'str'}, + 'data_format': {'key': 'properties.dataFormat', 'type': 'str'}, + 'refresh_details': {'key': 'properties.refreshDetails', 'type': 'RefreshDetails'}, + 'created_date_time': {'key': 'properties.createdDateTime', 'type': 'iso-8601'}, + } + + def __init__( + self, + **kwargs + ): + super(Container, self).__init__(**kwargs) + self.system_data = None + self.container_status = None + self.data_format = kwargs['data_format'] + self.refresh_details = None + self.created_date_time = None + + +class ContainerList(msrest.serialization.Model): + """Collection of all the containers on the Data Box Edge/Gateway device. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar value: The list of containers. + :vartype value: list[~azure.mgmt.databoxedge.v2020_09_01.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: ~azure.mgmt.databoxedge.v2020_09_01.models.Sku + :param etag: The etag for the devices. + :type etag: str + :param identity: Msi identity of the resource. + :type identity: ~azure.mgmt.databoxedge.v2020_09_01.models.ResourceIdentity + :ivar kind: The etag for the devices. Possible values include: "AzureDataBoxGateway", + "AzureStackEdge", "AzureStackHub", "AzureModularDataCentre". + :vartype kind: str or ~azure.mgmt.databoxedge.v2020_09_01.models.DataBoxEdgeDeviceKind + :ivar system_data: DataBoxEdge Resource. + :vartype system_data: ~azure.mgmt.databoxedge.v2020_09_01.models.SystemData + :param data_box_edge_device_status: The status of the Data Box Edge/Gateway device. Possible + values include: "ReadyToSetup", "Online", "Offline", "NeedsAttention", "Disconnected", + "PartiallyDisconnected", "Maintenance". + :type data_box_edge_device_status: str or + ~azure.mgmt.databoxedge.v2020_09_01.models.DataBoxEdgeDeviceStatus + :ivar serial_number: The Serial Number of Data Box Edge/Gateway device. + :vartype serial_number: str + :ivar description: The Description of the Data Box Edge/Gateway device. + :vartype description: str + :ivar model_description: The description of the Data Box Edge/Gateway device model. + :vartype model_description: str + :ivar device_type: The type of the Data Box Edge/Gateway device. Possible values include: + "DataBoxEdgeDevice". + :vartype device_type: str or ~azure.mgmt.databoxedge.v2020_09_01.models.DeviceType + :ivar friendly_name: The Data Box Edge/Gateway device name. + :vartype friendly_name: str + :ivar culture: The Data Box Edge/Gateway device culture. + :vartype culture: str + :ivar device_model: The Data Box Edge/Gateway device model. + :vartype device_model: str + :ivar device_software_version: The Data Box Edge/Gateway device software version. + :vartype device_software_version: str + :ivar device_local_capacity: The Data Box Edge/Gateway device local capacity in MB. + :vartype device_local_capacity: long + :ivar time_zone: The Data Box Edge/Gateway device timezone. + :vartype time_zone: str + :ivar device_hcs_version: The device software version number of the device (eg: 1.2.18105.6). + :vartype device_hcs_version: str + :ivar configured_role_types: Type of compute roles configured. + :vartype configured_role_types: list[str or + ~azure.mgmt.databoxedge.v2020_09_01.models.RoleTypes] + :ivar node_count: The number of nodes in the cluster. + :vartype node_count: int + :ivar resource_move_details: The details of the move operation on this resource. + :vartype resource_move_details: ~azure.mgmt.databoxedge.v2020_09_01.models.ResourceMoveDetails + :ivar edge_profile: The details of Edge Profile for this resource. + :vartype edge_profile: ~azure.mgmt.databoxedge.v2020_09_01.models.EdgeProfile + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': True}, + 'kind': {'readonly': True}, + 'system_data': {'readonly': True}, + 'serial_number': {'readonly': True}, + 'description': {'readonly': True}, + 'model_description': {'readonly': True}, + 'device_type': {'readonly': True}, + 'friendly_name': {'readonly': True}, + 'culture': {'readonly': True}, + 'device_model': {'readonly': True}, + 'device_software_version': {'readonly': True}, + 'device_local_capacity': {'readonly': True}, + 'time_zone': {'readonly': True}, + 'device_hcs_version': {'readonly': True}, + 'configured_role_types': {'readonly': True}, + 'node_count': {'readonly': True}, + 'resource_move_details': {'readonly': True}, + 'edge_profile': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'sku': {'key': 'sku', 'type': 'Sku'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'identity': {'key': 'identity', 'type': 'ResourceIdentity'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'data_box_edge_device_status': {'key': 'properties.dataBoxEdgeDeviceStatus', 'type': 'str'}, + 'serial_number': {'key': 'properties.serialNumber', 'type': 'str'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + 'model_description': {'key': 'properties.modelDescription', 'type': 'str'}, + 'device_type': {'key': 'properties.deviceType', 'type': 'str'}, + 'friendly_name': {'key': 'properties.friendlyName', 'type': 'str'}, + 'culture': {'key': 'properties.culture', 'type': 'str'}, + 'device_model': {'key': 'properties.deviceModel', 'type': 'str'}, + 'device_software_version': {'key': 'properties.deviceSoftwareVersion', 'type': 'str'}, + 'device_local_capacity': {'key': 'properties.deviceLocalCapacity', 'type': 'long'}, + 'time_zone': {'key': 'properties.timeZone', 'type': 'str'}, + 'device_hcs_version': {'key': 'properties.deviceHcsVersion', 'type': 'str'}, + 'configured_role_types': {'key': 'properties.configuredRoleTypes', 'type': '[str]'}, + 'node_count': {'key': 'properties.nodeCount', 'type': 'int'}, + 'resource_move_details': {'key': 'properties.resourceMoveDetails', 'type': 'ResourceMoveDetails'}, + 'edge_profile': {'key': 'properties.edgeProfile', 'type': 'EdgeProfile'}, + } + + def __init__( + self, + **kwargs + ): + super(DataBoxEdgeDevice, self).__init__(**kwargs) + self.location = kwargs['location'] + self.tags = kwargs.get('tags', None) + self.sku = kwargs.get('sku', None) + self.etag = kwargs.get('etag', None) + self.identity = kwargs.get('identity', None) + self.kind = None + self.system_data = None + self.data_box_edge_device_status = kwargs.get('data_box_edge_device_status', None) + self.serial_number = None + self.description = None + self.model_description = None + self.device_type = None + self.friendly_name = None + self.culture = None + self.device_model = None + self.device_software_version = None + self.device_local_capacity = None + self.time_zone = None + self.device_hcs_version = None + self.configured_role_types = None + self.node_count = None + self.resource_move_details = None + self.edge_profile = None + + +class DataBoxEdgeDeviceExtendedInfo(ARMBaseModel): + """The extended Info of the Data Box Edge/Gateway device. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: The path ID that uniquely identifies the object. + :vartype id: str + :ivar name: The object name. + :vartype name: str + :ivar type: The hierarchical type of the object. + :vartype type: str + :param encryption_key_thumbprint: The digital signature of encrypted certificate. + :type encryption_key_thumbprint: str + :param encryption_key: The public part of the encryption certificate. Client uses this to + encrypt any secret. + :type encryption_key: str + :ivar resource_key: The Resource ID of the Resource. + :vartype resource_key: str + :param client_secret_store_id: The Key Vault ARM Id for client secrets. + :type client_secret_store_id: str + :param client_secret_store_url: The url to access the Client Key Vault. + :type client_secret_store_url: str + :param channel_integrity_key_name: The name of Channel Integrity Key stored in the Client Key + Vault. + :type channel_integrity_key_name: str + :param channel_integrity_key_version: The version of Channel Integrity Key stored in the Client + Key Vault. + :type channel_integrity_key_version: str + """ + + _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'}, + 'client_secret_store_id': {'key': 'properties.clientSecretStoreId', 'type': 'str'}, + 'client_secret_store_url': {'key': 'properties.clientSecretStoreUrl', 'type': 'str'}, + 'channel_integrity_key_name': {'key': 'properties.channelIntegrityKeyName', 'type': 'str'}, + 'channel_integrity_key_version': {'key': 'properties.channelIntegrityKeyVersion', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(DataBoxEdgeDeviceExtendedInfo, self).__init__(**kwargs) + self.encryption_key_thumbprint = kwargs.get('encryption_key_thumbprint', None) + self.encryption_key = kwargs.get('encryption_key', None) + self.resource_key = None + self.client_secret_store_id = kwargs.get('client_secret_store_id', None) + self.client_secret_store_url = kwargs.get('client_secret_store_url', None) + self.channel_integrity_key_name = kwargs.get('channel_integrity_key_name', None) + self.channel_integrity_key_version = kwargs.get('channel_integrity_key_version', None) + + +class DataBoxEdgeDeviceExtendedInfoPatch(msrest.serialization.Model): + """The Data Box Edge/Gateway device extended info patch. + + :param client_secret_store_id: The Key Vault ARM Id for client secrets. + :type client_secret_store_id: str + :param client_secret_store_url: The url to access the Client Key Vault. + :type client_secret_store_url: str + :param channel_integrity_key_name: The name for Channel Integrity Key stored in the Client Key + Vault. + :type channel_integrity_key_name: str + :param channel_integrity_key_version: The version of Channel Integrity Key stored in the Client + Key Vault. + :type channel_integrity_key_version: str + """ + + _attribute_map = { + 'client_secret_store_id': {'key': 'clientSecretStoreId', 'type': 'str'}, + 'client_secret_store_url': {'key': 'clientSecretStoreUrl', 'type': 'str'}, + 'channel_integrity_key_name': {'key': 'channelIntegrityKeyName', 'type': 'str'}, + 'channel_integrity_key_version': {'key': 'channelIntegrityKeyVersion', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(DataBoxEdgeDeviceExtendedInfoPatch, self).__init__(**kwargs) + self.client_secret_store_id = kwargs.get('client_secret_store_id', None) + self.client_secret_store_url = kwargs.get('client_secret_store_url', None) + self.channel_integrity_key_name = kwargs.get('channel_integrity_key_name', None) + self.channel_integrity_key_version = kwargs.get('channel_integrity_key_version', None) + + +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[~azure.mgmt.databoxedge.v2020_09_01.models.DataBoxEdgeDevice] + :ivar next_link: Link to the next set of results. + :vartype next_link: str + """ + + _validation = { + 'value': {'readonly': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[DataBoxEdgeDevice]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(DataBoxEdgeDeviceList, self).__init__(**kwargs) + self.value = None + self.next_link = None + + +class DataBoxEdgeDevicePatch(msrest.serialization.Model): + """The Data Box Edge/Gateway device patch. + + :param tags: A set of tags. The tags attached to the Data Box Edge/Gateway resource. + :type tags: dict[str, str] + :param identity: Msi identity of the resource. + :type identity: ~azure.mgmt.databoxedge.v2020_09_01.models.ResourceIdentity + :param edge_profile: Edge Profile property of the Data Box Edge/Gateway device. + :type edge_profile: ~azure.mgmt.databoxedge.v2020_09_01.models.EdgeProfilePatch + """ + + _attribute_map = { + 'tags': {'key': 'tags', 'type': '{str}'}, + 'identity': {'key': 'identity', 'type': 'ResourceIdentity'}, + 'edge_profile': {'key': 'properties.edgeProfile', 'type': 'EdgeProfilePatch'}, + } + + def __init__( + self, + **kwargs + ): + super(DataBoxEdgeDevicePatch, self).__init__(**kwargs) + self.tags = kwargs.get('tags', None) + self.identity = kwargs.get('identity', None) + self.edge_profile = kwargs.get('edge_profile', None) + + +class DataBoxEdgeMoveRequest(msrest.serialization.Model): + """Resource Move details. + + All required parameters must be populated in order to send to Azure. + + :param target_resource_group: Required. Target resource group ARMId. + :type target_resource_group: str + :param resources: Required. List of resources to be moved. + :type resources: list[str] + """ + + _validation = { + 'target_resource_group': {'required': True}, + 'resources': {'required': True}, + } + + _attribute_map = { + 'target_resource_group': {'key': 'targetResourceGroup', 'type': 'str'}, + 'resources': {'key': 'resources', 'type': '[str]'}, + } + + def __init__( + self, + **kwargs + ): + super(DataBoxEdgeMoveRequest, self).__init__(**kwargs) + self.target_resource_group = kwargs['target_resource_group'] + self.resources = kwargs['resources'] + + +class DataBoxEdgeSku(msrest.serialization.Model): + """The Sku information. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar resource_type: The type of the resource. + :vartype resource_type: str + :ivar name: The Sku name. Possible values include: "Gateway", "Edge", "TEA_1Node", + "TEA_1Node_UPS", "TEA_1Node_Heater", "TEA_1Node_UPS_Heater", "TEA_4Node_Heater", + "TEA_4Node_UPS_Heater", "TMA", "TDC", "TCA_Small", "GPU", "TCA_Large", "EdgeP_Base", + "EdgeP_High", "EdgePR_Base", "EdgePR_Base_UPS", "EdgeMR_Mini", "RCA_Small", "RCA_Large", "RDC". + :vartype name: str or ~azure.mgmt.databoxedge.v2020_09_01.models.SkuName + :ivar kind: The Sku kind. + :vartype kind: str + :ivar tier: The Sku tier. Possible values include: "Standard". + :vartype tier: str or ~azure.mgmt.databoxedge.v2020_09_01.models.SkuTier + :ivar size: The Sku kind. + :vartype size: str + :ivar family: The Sku family. + :vartype family: str + :ivar locations: Availability of the Sku for the region. + :vartype locations: list[str] + :ivar api_versions: The API versions in which Sku is available. + :vartype api_versions: list[str] + :ivar location_info: Availability of the Sku for the location/zone/site. + :vartype location_info: list[~azure.mgmt.databoxedge.v2020_09_01.models.SkuLocationInfo] + :ivar costs: The pricing info of the Sku. + :vartype costs: list[~azure.mgmt.databoxedge.v2020_09_01.models.SkuCost] + :ivar signup_option: Sku can be signed up by customer or not. Possible values include: "None", + "Available". + :vartype signup_option: str or ~azure.mgmt.databoxedge.v2020_09_01.models.SkuSignupOption + :ivar version: Availability of the Sku as preview/stable. Possible values include: "Stable", + "Preview". + :vartype version: str or ~azure.mgmt.databoxedge.v2020_09_01.models.SkuVersion + :ivar availability: Links to the next set of results. Possible values include: "Available", + "Unavailable". + :vartype availability: str or ~azure.mgmt.databoxedge.v2020_09_01.models.SkuAvailability + :ivar shipment_types: List of Shipment Types supported by this SKU. + :vartype shipment_types: list[str or ~azure.mgmt.databoxedge.v2020_09_01.models.ShipmentType] + """ + + _validation = { + 'resource_type': {'readonly': True}, + 'name': {'readonly': True}, + 'kind': {'readonly': True}, + 'tier': {'readonly': True}, + 'size': {'readonly': True}, + 'family': {'readonly': True}, + 'locations': {'readonly': True}, + 'api_versions': {'readonly': True}, + 'location_info': {'readonly': True}, + 'costs': {'readonly': True}, + 'signup_option': {'readonly': True}, + 'version': {'readonly': True}, + 'availability': {'readonly': True}, + 'shipment_types': {'readonly': True}, + } + + _attribute_map = { + 'resource_type': {'key': 'resourceType', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'tier': {'key': 'tier', 'type': 'str'}, + 'size': {'key': 'size', 'type': 'str'}, + 'family': {'key': 'family', 'type': 'str'}, + 'locations': {'key': 'locations', 'type': '[str]'}, + 'api_versions': {'key': 'apiVersions', 'type': '[str]'}, + 'location_info': {'key': 'locationInfo', 'type': '[SkuLocationInfo]'}, + 'costs': {'key': 'costs', 'type': '[SkuCost]'}, + 'signup_option': {'key': 'signupOption', 'type': 'str'}, + 'version': {'key': 'version', 'type': 'str'}, + 'availability': {'key': 'availability', 'type': 'str'}, + 'shipment_types': {'key': 'shipmentTypes', 'type': '[str]'}, + } + + def __init__( + self, + **kwargs + ): + super(DataBoxEdgeSku, self).__init__(**kwargs) + self.resource_type = None + self.name = None + self.kind = None + self.tier = None + self.size = None + self.family = None + self.locations = None + self.api_versions = None + self.location_info = None + self.costs = None + self.signup_option = None + self.version = None + self.availability = None + self.shipment_types = None + + +class DataBoxEdgeSkuList(msrest.serialization.Model): + """List of SKU Information objects. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar value: List of ResourceType Sku. + :vartype value: list[~azure.mgmt.databoxedge.v2020_09_01.models.DataBoxEdgeSku] + :ivar next_link: Links to the next set of results. + :vartype next_link: str + """ + + _validation = { + 'value': {'readonly': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[DataBoxEdgeSku]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(DataBoxEdgeSkuList, self).__init__(**kwargs) + self.value = None + self.next_link = None + + +class DCAccessCode(msrest.serialization.Model): + """DC Access code in the case of Self Managed Shipping. + + :param auth_code: DCAccess Code for the Self Managed shipment. + :type auth_code: str + """ + + _attribute_map = { + 'auth_code': {'key': 'properties.authCode', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(DCAccessCode, self).__init__(**kwargs) + self.auth_code = kwargs.get('auth_code', None) + + +class EdgeProfile(msrest.serialization.Model): + """Details about Edge Profile for the resource. + + :param subscription: Edge Profile Subscription. + :type subscription: ~azure.mgmt.databoxedge.v2020_09_01.models.EdgeProfileSubscription + """ + + _attribute_map = { + 'subscription': {'key': 'subscription', 'type': 'EdgeProfileSubscription'}, + } + + def __init__( + self, + **kwargs + ): + super(EdgeProfile, self).__init__(**kwargs) + self.subscription = kwargs.get('subscription', None) + + +class EdgeProfilePatch(msrest.serialization.Model): + """The Data Box Edge/Gateway Edge Profile patch. + + :param subscription: The Data Box Edge/Gateway Edge Profile Subscription patch. + :type subscription: ~azure.mgmt.databoxedge.v2020_09_01.models.EdgeProfileSubscriptionPatch + """ + + _attribute_map = { + 'subscription': {'key': 'subscription', 'type': 'EdgeProfileSubscriptionPatch'}, + } + + def __init__( + self, + **kwargs + ): + super(EdgeProfilePatch, self).__init__(**kwargs) + self.subscription = kwargs.get('subscription', None) + + +class EdgeProfileSubscription(msrest.serialization.Model): + """Subscription details for the Edge Profile. + + :param registration_id: Edge Subscription Registration ID. + :type registration_id: str + :param id: ARM ID of the subscription. + :type id: str + :param state: Possible values include: "Registered", "Warned", "Suspended", "Deleted", + "Unregistered". + :type state: str or ~azure.mgmt.databoxedge.v2020_09_01.models.SubscriptionState + :param registration_date: + :type registration_date: str + :param subscription_id: + :type subscription_id: str + :param tenant_id: + :type tenant_id: str + :param location_placement_id: + :type location_placement_id: str + :param quota_id: + :type quota_id: str + :param serialized_details: + :type serialized_details: str + :param registered_features: + :type registered_features: + list[~azure.mgmt.databoxedge.v2020_09_01.models.SubscriptionRegisteredFeatures] + """ + + _attribute_map = { + 'registration_id': {'key': 'registrationId', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + 'state': {'key': 'state', 'type': 'str'}, + 'registration_date': {'key': 'registrationDate', 'type': 'str'}, + 'subscription_id': {'key': 'subscriptionId', 'type': 'str'}, + 'tenant_id': {'key': 'properties.tenantId', 'type': 'str'}, + 'location_placement_id': {'key': 'properties.locationPlacementId', 'type': 'str'}, + 'quota_id': {'key': 'properties.quotaId', 'type': 'str'}, + 'serialized_details': {'key': 'properties.serializedDetails', 'type': 'str'}, + 'registered_features': {'key': 'properties.registeredFeatures', 'type': '[SubscriptionRegisteredFeatures]'}, + } + + def __init__( + self, + **kwargs + ): + super(EdgeProfileSubscription, self).__init__(**kwargs) + self.registration_id = kwargs.get('registration_id', None) + self.id = kwargs.get('id', None) + self.state = kwargs.get('state', None) + self.registration_date = kwargs.get('registration_date', None) + self.subscription_id = kwargs.get('subscription_id', None) + self.tenant_id = kwargs.get('tenant_id', None) + self.location_placement_id = kwargs.get('location_placement_id', None) + self.quota_id = kwargs.get('quota_id', None) + self.serialized_details = kwargs.get('serialized_details', None) + self.registered_features = kwargs.get('registered_features', None) + + +class EdgeProfileSubscriptionPatch(msrest.serialization.Model): + """The Data Box Edge/Gateway Edge Profile Subscription patch. + + :param id: The path ID that uniquely identifies the subscription of the edge profile. + :type id: str + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(EdgeProfileSubscriptionPatch, self).__init__(**kwargs) + self.id = kwargs.get('id', None) + + +class EtcdInfo(msrest.serialization.Model): + """Etcd configuration. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar type: Etcd type. + :vartype type: str + :ivar version: Etcd version. + :vartype version: str + """ + + _validation = { + 'type': {'readonly': True}, + 'version': {'readonly': True}, + } + + _attribute_map = { + 'type': {'key': 'type', 'type': 'str'}, + 'version': {'key': 'version', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(EtcdInfo, self).__init__(**kwargs) + self.type = None + self.version = None + + +class Trigger(ARMBaseModel): + """Trigger details. + + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: FileEventTrigger, PeriodicTimerEventTrigger. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: The path ID that uniquely identifies the object. + :vartype id: str + :ivar name: The object name. + :vartype name: str + :ivar type: The hierarchical type of the object. + :vartype type: str + :ivar system_data: Trigger in DataBoxEdge Resource. + :vartype system_data: ~azure.mgmt.databoxedge.v2020_09_01.models.SystemData + :param kind: Required. Trigger Kind.Constant filled by server. Possible values include: + "FileEvent", "PeriodicTimerEvent". + :type kind: str or ~azure.mgmt.databoxedge.v2020_09_01.models.TriggerEventType + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'system_data': {'readonly': True}, + 'kind': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'kind': {'key': 'kind', 'type': 'str'}, + } + + _subtype_map = { + 'kind': {'FileEvent': 'FileEventTrigger', 'PeriodicTimerEvent': 'PeriodicTimerEventTrigger'} + } + + def __init__( + self, + **kwargs + ): + super(Trigger, self).__init__(**kwargs) + self.system_data = None + self.kind = 'Trigger' # type: str + + +class FileEventTrigger(Trigger): + """Trigger details. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: The path ID that uniquely identifies the object. + :vartype id: str + :ivar name: The object name. + :vartype name: str + :ivar type: The hierarchical type of the object. + :vartype type: str + :ivar system_data: Trigger in DataBoxEdge Resource. + :vartype system_data: ~azure.mgmt.databoxedge.v2020_09_01.models.SystemData + :param kind: Required. Trigger Kind.Constant filled by server. Possible values include: + "FileEvent", "PeriodicTimerEvent". + :type kind: str or ~azure.mgmt.databoxedge.v2020_09_01.models.TriggerEventType + :param source_info: Required. File event source details. + :type source_info: ~azure.mgmt.databoxedge.v2020_09_01.models.FileSourceInfo + :param sink_info: Required. Role sink info. + :type sink_info: ~azure.mgmt.databoxedge.v2020_09_01.models.RoleSinkInfo + :param custom_context_tag: A custom context tag typically used to correlate the trigger against + its usage. For example, if a periodic timer trigger is intended for certain specific IoT + modules in the device, the tag can be the name or the image URL of the module. + :type custom_context_tag: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'system_data': {'readonly': True}, + 'kind': {'required': True}, + 'source_info': {'required': True}, + 'sink_info': {'required': True}, + 'custom_context_tag': {'max_length': 192, 'min_length': 0}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'source_info': {'key': 'properties.sourceInfo', 'type': 'FileSourceInfo'}, + 'sink_info': {'key': 'properties.sinkInfo', 'type': 'RoleSinkInfo'}, + 'custom_context_tag': {'key': 'properties.customContextTag', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(FileEventTrigger, self).__init__(**kwargs) + self.kind = 'FileEvent' # type: str + self.source_info = kwargs['source_info'] + self.sink_info = kwargs['sink_info'] + self.custom_context_tag = kwargs.get('custom_context_tag', None) + + +class FileSourceInfo(msrest.serialization.Model): + """File source details. + + All required parameters must be populated in order to send to Azure. + + :param share_id: Required. File share ID. + :type share_id: str + """ + + _validation = { + 'share_id': {'required': True}, + } + + _attribute_map = { + 'share_id': {'key': 'shareId', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(FileSourceInfo, self).__init__(**kwargs) + self.share_id = kwargs['share_id'] + + +class GenerateCertResponse(msrest.serialization.Model): + """Used in activation key generation flow. + + :param public_key: Gets or sets base64 encoded certificate raw data, + this is the public part needed to be uploaded to cert vault. + :type public_key: str + :param private_key: Gets or sets base64 encoded private part of the certificate, + needed to form the activation key. + :type private_key: str + :param expiry_time_in_utc: Gets or sets expiry time in UTC. + :type expiry_time_in_utc: str + """ + + _attribute_map = { + 'public_key': {'key': 'publicKey', 'type': 'str'}, + 'private_key': {'key': 'privateKey', 'type': 'str'}, + 'expiry_time_in_utc': {'key': 'expiryTimeInUTC', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(GenerateCertResponse, self).__init__(**kwargs) + self.public_key = kwargs.get('public_key', None) + self.private_key = kwargs.get('private_key', None) + self.expiry_time_in_utc = kwargs.get('expiry_time_in_utc', None) + + +class ImageRepositoryCredential(msrest.serialization.Model): + """Image repository credential. + + All required parameters must be populated in order to send to Azure. + + :param image_repository_url: Required. Image repository url (e.g.: mcr.microsoft.com). + :type image_repository_url: str + :param user_name: Required. Repository user name. + :type user_name: str + :param password: Repository user password. + :type password: ~azure.mgmt.databoxedge.v2020_09_01.models.AsymmetricEncryptedSecret + """ + + _validation = { + 'image_repository_url': {'required': True}, + 'user_name': {'required': True}, + } + + _attribute_map = { + 'image_repository_url': {'key': 'imageRepositoryUrl', 'type': 'str'}, + 'user_name': {'key': 'userName', 'type': 'str'}, + 'password': {'key': 'password', 'type': 'AsymmetricEncryptedSecret'}, + } + + def __init__( + self, + **kwargs + ): + super(ImageRepositoryCredential, self).__init__(**kwargs) + self.image_repository_url = kwargs['image_repository_url'] + self.user_name = kwargs['user_name'] + self.password = kwargs.get('password', None) + + +class IoTAddon(Addon): + """IoT Addon. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: The path ID that uniquely identifies the object. + :vartype id: str + :ivar name: The object name. + :vartype name: str + :ivar type: The hierarchical type of the object. + :vartype type: str + :param kind: Required. Addon type.Constant filled by server. Possible values include: + "IotEdge", "ArcForKubernetes". + :type kind: str or ~azure.mgmt.databoxedge.v2020_09_01.models.AddonType + :ivar system_data: Addon type. + :vartype system_data: ~azure.mgmt.databoxedge.v2020_09_01.models.SystemData + :param io_t_device_details: Required. IoT device metadata to which appliance needs to be + connected. + :type io_t_device_details: ~azure.mgmt.databoxedge.v2020_09_01.models.IoTDeviceInfo + :param io_t_edge_device_details: Required. IoT edge device to which the IoT Addon needs to be + configured. + :type io_t_edge_device_details: ~azure.mgmt.databoxedge.v2020_09_01.models.IoTDeviceInfo + :ivar version: Version of IoT running on the appliance. + :vartype version: str + :ivar host_platform: Host OS supported by the IoT addon. Possible values include: "Windows", + "Linux". + :vartype host_platform: str or ~azure.mgmt.databoxedge.v2020_09_01.models.PlatformType + :ivar host_platform_type: Platform where the runtime is hosted. Possible values include: + "KubernetesCluster", "LinuxVM". + :vartype host_platform_type: str or ~azure.mgmt.databoxedge.v2020_09_01.models.HostPlatformType + :ivar provisioning_state: Addon Provisioning State. Possible values include: "Invalid", + "Creating", "Created", "Updating", "Reconfiguring", "Failed", "Deleting". + :vartype provisioning_state: str or ~azure.mgmt.databoxedge.v2020_09_01.models.AddonState + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'kind': {'required': True}, + 'system_data': {'readonly': True}, + 'io_t_device_details': {'required': True}, + 'io_t_edge_device_details': {'required': True}, + 'version': {'readonly': True}, + 'host_platform': {'readonly': True}, + 'host_platform_type': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'io_t_device_details': {'key': 'properties.ioTDeviceDetails', 'type': 'IoTDeviceInfo'}, + 'io_t_edge_device_details': {'key': 'properties.ioTEdgeDeviceDetails', 'type': 'IoTDeviceInfo'}, + 'version': {'key': 'properties.version', 'type': 'str'}, + 'host_platform': {'key': 'properties.hostPlatform', 'type': 'str'}, + 'host_platform_type': {'key': 'properties.hostPlatformType', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(IoTAddon, self).__init__(**kwargs) + self.kind = 'IotEdge' # type: str + self.io_t_device_details = kwargs['io_t_device_details'] + self.io_t_edge_device_details = kwargs['io_t_edge_device_details'] + self.version = None + self.host_platform = None + self.host_platform_type = None + self.provisioning_state = None + + +class IoTDeviceInfo(msrest.serialization.Model): + """Metadata of IoT device/IoT Edge device to be configured. + + All required parameters must be populated in order to send to Azure. + + :param device_id: Required. ID of the IoT device/edge device. + :type device_id: str + :param io_t_host_hub: Required. Host name for the IoT hub associated to the device. + :type io_t_host_hub: str + :param io_t_host_hub_id: Id for the IoT hub associated to the device. + :type io_t_host_hub_id: str + :param authentication: Encrypted IoT device/IoT edge device connection string. + :type authentication: ~azure.mgmt.databoxedge.v2020_09_01.models.Authentication + """ + + _validation = { + 'device_id': {'required': True}, + 'io_t_host_hub': {'required': True}, + } + + _attribute_map = { + 'device_id': {'key': 'deviceId', 'type': 'str'}, + 'io_t_host_hub': {'key': 'ioTHostHub', 'type': 'str'}, + 'io_t_host_hub_id': {'key': 'ioTHostHubId', 'type': 'str'}, + 'authentication': {'key': 'authentication', 'type': 'Authentication'}, + } + + def __init__( + self, + **kwargs + ): + super(IoTDeviceInfo, self).__init__(**kwargs) + self.device_id = kwargs['device_id'] + self.io_t_host_hub = kwargs['io_t_host_hub'] + self.io_t_host_hub_id = kwargs.get('io_t_host_hub_id', None) + self.authentication = kwargs.get('authentication', None) + + +class IoTEdgeAgentInfo(msrest.serialization.Model): + """IoT edge agent details is optional, this will be used for download system Agent module while bootstrapping IoT Role if specified. + + All required parameters must be populated in order to send to Azure. + + :param image_name: Required. Name of the IoT edge agent image. + :type image_name: str + :param tag: Required. Image Tag. + :type tag: str + :param image_repository: Image repository details. + :type image_repository: ~azure.mgmt.databoxedge.v2020_09_01.models.ImageRepositoryCredential + """ + + _validation = { + 'image_name': {'required': True}, + 'tag': {'required': True}, + } + + _attribute_map = { + 'image_name': {'key': 'imageName', 'type': 'str'}, + 'tag': {'key': 'tag', 'type': 'str'}, + 'image_repository': {'key': 'imageRepository', 'type': 'ImageRepositoryCredential'}, + } + + def __init__( + self, + **kwargs + ): + super(IoTEdgeAgentInfo, self).__init__(**kwargs) + self.image_name = kwargs['image_name'] + self.tag = kwargs['tag'] + self.image_repository = kwargs.get('image_repository', None) + + +class IoTRole(Role): + """Compute role. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: The path ID that uniquely identifies the object. + :vartype id: str + :ivar name: The object name. + :vartype name: str + :ivar type: The hierarchical type of the object. + :vartype type: str + :param kind: Required. Role type.Constant filled by server. Possible values include: "IOT", + "ASA", "Functions", "Cognitive", "MEC", "CloudEdgeManagement", "Kubernetes". + :type kind: str or ~azure.mgmt.databoxedge.v2020_09_01.models.RoleTypes + :ivar system_data: Role configured on ASE resource. + :vartype system_data: ~azure.mgmt.databoxedge.v2020_09_01.models.SystemData + :param host_platform: Host OS supported by the IoT role. Possible values include: "Windows", + "Linux". + :type host_platform: str or ~azure.mgmt.databoxedge.v2020_09_01.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: ~azure.mgmt.databoxedge.v2020_09_01.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: ~azure.mgmt.databoxedge.v2020_09_01.models.IoTDeviceInfo + :param share_mappings: Mount points of shares in role(s). + :type share_mappings: list[~azure.mgmt.databoxedge.v2020_09_01.models.MountPointMap] + :param io_t_edge_agent_info: Iot edge agent details to download the agent and bootstrap iot + runtime. + :type io_t_edge_agent_info: ~azure.mgmt.databoxedge.v2020_09_01.models.IoTEdgeAgentInfo + :ivar host_platform_type: Platform where the Iot runtime is hosted. Possible values include: + "KubernetesCluster", "LinuxVM". + :vartype host_platform_type: str or ~azure.mgmt.databoxedge.v2020_09_01.models.HostPlatformType + :param compute_resource: Resource allocation. + :type compute_resource: ~azure.mgmt.databoxedge.v2020_09_01.models.ComputeResource + :param role_status: Role status. Possible values include: "Enabled", "Disabled". + :type role_status: str or ~azure.mgmt.databoxedge.v2020_09_01.models.RoleStatus + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'kind': {'required': True}, + 'system_data': {'readonly': True}, + 'host_platform_type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'host_platform': {'key': 'properties.hostPlatform', 'type': 'str'}, + 'io_t_device_details': {'key': 'properties.ioTDeviceDetails', 'type': 'IoTDeviceInfo'}, + 'io_t_edge_device_details': {'key': 'properties.ioTEdgeDeviceDetails', 'type': 'IoTDeviceInfo'}, + 'share_mappings': {'key': 'properties.shareMappings', 'type': '[MountPointMap]'}, + 'io_t_edge_agent_info': {'key': 'properties.ioTEdgeAgentInfo', 'type': 'IoTEdgeAgentInfo'}, + 'host_platform_type': {'key': 'properties.hostPlatformType', 'type': 'str'}, + 'compute_resource': {'key': 'properties.computeResource', 'type': 'ComputeResource'}, + 'role_status': {'key': 'properties.roleStatus', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(IoTRole, self).__init__(**kwargs) + self.kind = 'IOT' # type: str + self.host_platform = kwargs.get('host_platform', None) + self.io_t_device_details = kwargs.get('io_t_device_details', None) + self.io_t_edge_device_details = kwargs.get('io_t_edge_device_details', None) + self.share_mappings = kwargs.get('share_mappings', None) + self.io_t_edge_agent_info = kwargs.get('io_t_edge_agent_info', None) + self.host_platform_type = None + self.compute_resource = kwargs.get('compute_resource', None) + self.role_status = kwargs.get('role_status', None) + + +class Ipv4Config(msrest.serialization.Model): + """Details related to the IPv4 address configuration. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar ip_address: The IPv4 address of the network adapter. + :vartype ip_address: str + :ivar subnet: The IPv4 subnet of the network adapter. + :vartype subnet: str + :ivar gateway: The IPv4 gateway of the network adapter. + :vartype gateway: str + """ + + _validation = { + 'ip_address': {'readonly': True}, + 'subnet': {'readonly': True}, + 'gateway': {'readonly': True}, + } + + _attribute_map = { + 'ip_address': {'key': 'ipAddress', 'type': 'str'}, + 'subnet': {'key': 'subnet', 'type': 'str'}, + 'gateway': {'key': 'gateway', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(Ipv4Config, self).__init__(**kwargs) + self.ip_address = None + self.subnet = None + self.gateway = None + + +class Ipv6Config(msrest.serialization.Model): + """Details related to the IPv6 address configuration. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar ip_address: The IPv6 address of the network adapter. + :vartype ip_address: str + :ivar prefix_length: The IPv6 prefix of the network adapter. + :vartype prefix_length: int + :ivar gateway: The IPv6 gateway of the network adapter. + :vartype gateway: str + """ + + _validation = { + 'ip_address': {'readonly': True}, + 'prefix_length': {'readonly': True}, + 'gateway': {'readonly': True}, + } + + _attribute_map = { + 'ip_address': {'key': 'ipAddress', 'type': 'str'}, + 'prefix_length': {'key': 'prefixLength', 'type': 'int'}, + 'gateway': {'key': 'gateway', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(Ipv6Config, self).__init__(**kwargs) + self.ip_address = None + self.prefix_length = None + self.gateway = None + + +class Job(msrest.serialization.Model): + """A device job. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: The path ID that uniquely identifies the object. + :vartype id: str + :ivar name: The name of the object. + :vartype name: str + :ivar type: The hierarchical type of the object. + :vartype type: str + :ivar status: The current status of the job. Possible values include: "Invalid", "Running", + "Succeeded", "Failed", "Canceled", "Paused", "Scheduled". + :vartype status: str or ~azure.mgmt.databoxedge.v2020_09_01.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: ~azure.mgmt.databoxedge.v2020_09_01.models.JobErrorDetails + :ivar job_type: The type of the job. Possible values include: "Invalid", "ScanForUpdates", + "DownloadUpdates", "InstallUpdates", "RefreshShare", "RefreshContainer", "Backup", "Restore", + "TriggerSupportPackage". + :vartype job_type: str or ~azure.mgmt.databoxedge.v2020_09_01.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 ~azure.mgmt.databoxedge.v2020_09_01.models.UpdateOperationStage + :ivar download_progress: The download progress. + :vartype download_progress: ~azure.mgmt.databoxedge.v2020_09_01.models.UpdateDownloadProgress + :ivar install_progress: The install progress. + :vartype install_progress: ~azure.mgmt.databoxedge.v2020_09_01.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[~azure.mgmt.databoxedge.v2020_09_01.models.JobErrorItem] + :ivar code: The code intended for programmatic access. + :vartype code: str + :ivar message: The message that describes the error in detail. + :vartype message: str + """ + + _validation = { + 'error_details': {'readonly': True}, + 'code': {'readonly': True}, + 'message': {'readonly': True}, + } + + _attribute_map = { + 'error_details': {'key': 'errorDetails', 'type': '[JobErrorItem]'}, + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(JobErrorDetails, self).__init__(**kwargs) + self.error_details = None + self.code = None + self.message = None + + +class JobErrorItem(msrest.serialization.Model): + """The job error items. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar recommendations: The recommended actions. + :vartype recommendations: list[str] + :ivar code: The code intended for programmatic access. + :vartype code: str + :ivar message: The message that describes the error in detail. + :vartype message: str + """ + + _validation = { + 'recommendations': {'readonly': True}, + 'code': {'readonly': True}, + 'message': {'readonly': True}, + } + + _attribute_map = { + 'recommendations': {'key': 'recommendations', 'type': '[str]'}, + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(JobErrorItem, self).__init__(**kwargs) + self.recommendations = None + self.code = None + self.message = None + + +class KubernetesClusterInfo(msrest.serialization.Model): + """Kubernetes cluster configuration. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar etcd_info: Etcd configuration. + :vartype etcd_info: ~azure.mgmt.databoxedge.v2020_09_01.models.EtcdInfo + :ivar nodes: Kubernetes cluster nodes. + :vartype nodes: list[~azure.mgmt.databoxedge.v2020_09_01.models.NodeInfo] + :param version: Required. Kubernetes cluster version. + :type version: str + """ + + _validation = { + 'etcd_info': {'readonly': True}, + 'nodes': {'readonly': True}, + 'version': {'required': True}, + } + + _attribute_map = { + 'etcd_info': {'key': 'etcdInfo', 'type': 'EtcdInfo'}, + 'nodes': {'key': 'nodes', 'type': '[NodeInfo]'}, + 'version': {'key': 'version', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(KubernetesClusterInfo, self).__init__(**kwargs) + self.etcd_info = None + self.nodes = None + self.version = kwargs['version'] + + +class KubernetesIPConfiguration(msrest.serialization.Model): + """Kubernetes node IP configuration. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar port: Port of the Kubernetes node. + :vartype port: str + :param ip_address: IP address of the Kubernetes node. + :type ip_address: str + """ + + _validation = { + 'port': {'readonly': True}, + } + + _attribute_map = { + 'port': {'key': 'port', 'type': 'str'}, + 'ip_address': {'key': 'ipAddress', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(KubernetesIPConfiguration, self).__init__(**kwargs) + self.port = None + self.ip_address = kwargs.get('ip_address', None) + + +class KubernetesRole(Role): + """Kubernetes role. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: The path ID that uniquely identifies the object. + :vartype id: str + :ivar name: The object name. + :vartype name: str + :ivar type: The hierarchical type of the object. + :vartype type: str + :param kind: Required. Role type.Constant filled by server. Possible values include: "IOT", + "ASA", "Functions", "Cognitive", "MEC", "CloudEdgeManagement", "Kubernetes". + :type kind: str or ~azure.mgmt.databoxedge.v2020_09_01.models.RoleTypes + :ivar system_data: Role configured on ASE resource. + :vartype system_data: ~azure.mgmt.databoxedge.v2020_09_01.models.SystemData + :param host_platform: Host OS supported by the Kubernetes role. Possible values include: + "Windows", "Linux". + :type host_platform: str or ~azure.mgmt.databoxedge.v2020_09_01.models.PlatformType + :ivar provisioning_state: State of Kubernetes deployment. Possible values include: "Invalid", + "Creating", "Created", "Updating", "Reconfiguring", "Failed", "Deleting". + :vartype provisioning_state: str or ~azure.mgmt.databoxedge.v2020_09_01.models.KubernetesState + :ivar host_platform_type: Platform where the runtime is hosted. Possible values include: + "KubernetesCluster", "LinuxVM". + :vartype host_platform_type: str or ~azure.mgmt.databoxedge.v2020_09_01.models.HostPlatformType + :param kubernetes_cluster_info: Kubernetes cluster configuration. + :type kubernetes_cluster_info: ~azure.mgmt.databoxedge.v2020_09_01.models.KubernetesClusterInfo + :param kubernetes_role_resources: Kubernetes role resources. + :type kubernetes_role_resources: + ~azure.mgmt.databoxedge.v2020_09_01.models.KubernetesRoleResources + :param role_status: Role status. Possible values include: "Enabled", "Disabled". + :type role_status: str or ~azure.mgmt.databoxedge.v2020_09_01.models.RoleStatus + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'kind': {'required': True}, + 'system_data': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + 'host_platform_type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'host_platform': {'key': 'properties.hostPlatform', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'host_platform_type': {'key': 'properties.hostPlatformType', 'type': 'str'}, + 'kubernetes_cluster_info': {'key': 'properties.kubernetesClusterInfo', 'type': 'KubernetesClusterInfo'}, + 'kubernetes_role_resources': {'key': 'properties.kubernetesRoleResources', 'type': 'KubernetesRoleResources'}, + 'role_status': {'key': 'properties.roleStatus', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(KubernetesRole, self).__init__(**kwargs) + self.kind = 'Kubernetes' # type: str + self.host_platform = kwargs.get('host_platform', None) + self.provisioning_state = None + self.host_platform_type = None + self.kubernetes_cluster_info = kwargs.get('kubernetes_cluster_info', None) + self.kubernetes_role_resources = kwargs.get('kubernetes_role_resources', None) + self.role_status = kwargs.get('role_status', None) + + +class KubernetesRoleCompute(msrest.serialization.Model): + """Kubernetes role compute resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :param vm_profile: Required. VM profile. + :type vm_profile: str + :ivar memory_in_bytes: Memory in bytes. + :vartype memory_in_bytes: long + :ivar processor_count: Processor count. + :vartype processor_count: int + """ + + _validation = { + 'vm_profile': {'required': True}, + 'memory_in_bytes': {'readonly': True}, + 'processor_count': {'readonly': True}, + } + + _attribute_map = { + 'vm_profile': {'key': 'vmProfile', 'type': 'str'}, + 'memory_in_bytes': {'key': 'memoryInBytes', 'type': 'long'}, + 'processor_count': {'key': 'processorCount', 'type': 'int'}, + } + + def __init__( + self, + **kwargs + ): + super(KubernetesRoleCompute, self).__init__(**kwargs) + self.vm_profile = kwargs['vm_profile'] + self.memory_in_bytes = None + self.processor_count = None + + +class KubernetesRoleNetwork(msrest.serialization.Model): + """Kubernetes role network resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar cni_config: Cni configuration. + :vartype cni_config: ~azure.mgmt.databoxedge.v2020_09_01.models.CniConfig + :ivar load_balancer_config: Load balancer configuration. + :vartype load_balancer_config: ~azure.mgmt.databoxedge.v2020_09_01.models.LoadBalancerConfig + """ + + _validation = { + 'cni_config': {'readonly': True}, + 'load_balancer_config': {'readonly': True}, + } + + _attribute_map = { + 'cni_config': {'key': 'cniConfig', 'type': 'CniConfig'}, + 'load_balancer_config': {'key': 'loadBalancerConfig', 'type': 'LoadBalancerConfig'}, + } + + def __init__( + self, + **kwargs + ): + super(KubernetesRoleNetwork, self).__init__(**kwargs) + self.cni_config = None + self.load_balancer_config = None + + +class KubernetesRoleResources(msrest.serialization.Model): + """Kubernetes role resources. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :param storage: Kubernetes role storage resource. + :type storage: ~azure.mgmt.databoxedge.v2020_09_01.models.KubernetesRoleStorage + :param compute: Required. Kubernetes role compute resource. + :type compute: ~azure.mgmt.databoxedge.v2020_09_01.models.KubernetesRoleCompute + :ivar network: Kubernetes role network resource. + :vartype network: ~azure.mgmt.databoxedge.v2020_09_01.models.KubernetesRoleNetwork + """ + + _validation = { + 'compute': {'required': True}, + 'network': {'readonly': True}, + } + + _attribute_map = { + 'storage': {'key': 'storage', 'type': 'KubernetesRoleStorage'}, + 'compute': {'key': 'compute', 'type': 'KubernetesRoleCompute'}, + 'network': {'key': 'network', 'type': 'KubernetesRoleNetwork'}, + } + + def __init__( + self, + **kwargs + ): + super(KubernetesRoleResources, self).__init__(**kwargs) + self.storage = kwargs.get('storage', None) + self.compute = kwargs['compute'] + self.network = None + + +class KubernetesRoleStorage(msrest.serialization.Model): + """Kubernetes role storage resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar storage_classes: Kubernetes storage class info. + :vartype storage_classes: + list[~azure.mgmt.databoxedge.v2020_09_01.models.KubernetesRoleStorageClassInfo] + :param endpoints: Mount points of shares in role(s). + :type endpoints: list[~azure.mgmt.databoxedge.v2020_09_01.models.MountPointMap] + """ + + _validation = { + 'storage_classes': {'readonly': True}, + } + + _attribute_map = { + 'storage_classes': {'key': 'storageClasses', 'type': '[KubernetesRoleStorageClassInfo]'}, + 'endpoints': {'key': 'endpoints', 'type': '[MountPointMap]'}, + } + + def __init__( + self, + **kwargs + ): + super(KubernetesRoleStorage, self).__init__(**kwargs) + self.storage_classes = None + self.endpoints = kwargs.get('endpoints', None) + + +class KubernetesRoleStorageClassInfo(msrest.serialization.Model): + """Kubernetes storage class info. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar name: Storage class name. + :vartype name: str + :ivar type: Storage class type. + :vartype type: str + :ivar posix_compliant: If provisioned storage is posix compliant. Possible values include: + "Invalid", "Enabled", "Disabled". + :vartype posix_compliant: str or + ~azure.mgmt.databoxedge.v2020_09_01.models.PosixComplianceStatus + """ + + _validation = { + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'posix_compliant': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'posix_compliant': {'key': 'posixCompliant', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(KubernetesRoleStorageClassInfo, self).__init__(**kwargs) + self.name = None + self.type = None + self.posix_compliant = None + + +class LoadBalancerConfig(msrest.serialization.Model): + """Load balancer configuration. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar type: Load balancer type. + :vartype type: str + :ivar version: Load balancer version. + :vartype version: str + """ + + _validation = { + 'type': {'readonly': True}, + 'version': {'readonly': True}, + } + + _attribute_map = { + 'type': {'key': 'type', 'type': 'str'}, + 'version': {'key': 'version', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(LoadBalancerConfig, self).__init__(**kwargs) + self.type = None + self.version = None + + +class MECRole(Role): + """MEC role. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: The path ID that uniquely identifies the object. + :vartype id: str + :ivar name: The object name. + :vartype name: str + :ivar type: The hierarchical type of the object. + :vartype type: str + :param kind: Required. Role type.Constant filled by server. Possible values include: "IOT", + "ASA", "Functions", "Cognitive", "MEC", "CloudEdgeManagement", "Kubernetes". + :type kind: str or ~azure.mgmt.databoxedge.v2020_09_01.models.RoleTypes + :ivar system_data: Role configured on ASE resource. + :vartype system_data: ~azure.mgmt.databoxedge.v2020_09_01.models.SystemData + :param connection_string: Activation key of the MEC. + :type connection_string: ~azure.mgmt.databoxedge.v2020_09_01.models.AsymmetricEncryptedSecret + :param role_status: Role status. Possible values include: "Enabled", "Disabled". + :type role_status: str or ~azure.mgmt.databoxedge.v2020_09_01.models.RoleStatus + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'kind': {'required': True}, + 'system_data': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'connection_string': {'key': 'properties.connectionString', 'type': 'AsymmetricEncryptedSecret'}, + 'role_status': {'key': 'properties.roleStatus', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(MECRole, self).__init__(**kwargs) + self.kind = 'MEC' # type: str + self.connection_string = kwargs.get('connection_string', None) + self.role_status = kwargs.get('role_status', None) + + +class MetricConfiguration(msrest.serialization.Model): + """Metric configuration. + + All required parameters must be populated in order to send to Azure. + + :param resource_id: Required. The Resource ID on which the metrics should be pushed. + :type resource_id: str + :param mdm_account: The MDM account to which the counters should be pushed. + :type mdm_account: str + :param metric_name_space: The MDM namespace to which the counters should be pushed. This is + required if MDMAccount is specified. + :type metric_name_space: str + :param counter_sets: Required. Host name for the IoT hub associated to the device. + :type counter_sets: list[~azure.mgmt.databoxedge.v2020_09_01.models.MetricCounterSet] + """ + + _validation = { + 'resource_id': {'required': True}, + 'counter_sets': {'required': True}, + } + + _attribute_map = { + 'resource_id': {'key': 'resourceId', 'type': 'str'}, + 'mdm_account': {'key': 'mdmAccount', 'type': 'str'}, + 'metric_name_space': {'key': 'metricNameSpace', 'type': 'str'}, + 'counter_sets': {'key': 'counterSets', 'type': '[MetricCounterSet]'}, + } + + def __init__( + self, + **kwargs + ): + super(MetricConfiguration, self).__init__(**kwargs) + self.resource_id = kwargs['resource_id'] + self.mdm_account = kwargs.get('mdm_account', None) + self.metric_name_space = kwargs.get('metric_name_space', None) + self.counter_sets = kwargs['counter_sets'] + + +class MetricCounter(msrest.serialization.Model): + """The metric counter. + + All required parameters must be populated in order to send to Azure. + + :param name: Required. The counter name. + :type name: str + :param instance: The instance from which counter should be collected. + :type instance: str + :param dimension_filter: The dimension filter. + :type dimension_filter: list[~azure.mgmt.databoxedge.v2020_09_01.models.MetricDimension] + :param additional_dimensions: The additional dimensions to be added to metric. + :type additional_dimensions: list[~azure.mgmt.databoxedge.v2020_09_01.models.MetricDimension] + """ + + _validation = { + 'name': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'instance': {'key': 'instance', 'type': 'str'}, + 'dimension_filter': {'key': 'dimensionFilter', 'type': '[MetricDimension]'}, + 'additional_dimensions': {'key': 'additionalDimensions', 'type': '[MetricDimension]'}, + } + + def __init__( + self, + **kwargs + ): + super(MetricCounter, self).__init__(**kwargs) + self.name = kwargs['name'] + self.instance = kwargs.get('instance', None) + self.dimension_filter = kwargs.get('dimension_filter', None) + self.additional_dimensions = kwargs.get('additional_dimensions', None) + + +class MetricCounterSet(msrest.serialization.Model): + """The metric counter set. + + All required parameters must be populated in order to send to Azure. + + :param counters: Required. The counters that should be collected in this set. + :type counters: list[~azure.mgmt.databoxedge.v2020_09_01.models.MetricCounter] + """ + + _validation = { + 'counters': {'required': True}, + } + + _attribute_map = { + 'counters': {'key': 'counters', 'type': '[MetricCounter]'}, + } + + def __init__( + self, + **kwargs + ): + super(MetricCounterSet, self).__init__(**kwargs) + self.counters = kwargs['counters'] + + +class MetricDimension(msrest.serialization.Model): + """The metric dimension. + + All required parameters must be populated in order to send to Azure. + + :param source_type: Required. The dimension type. + :type source_type: str + :param source_name: Required. The dimension value. + :type source_name: str + """ + + _validation = { + 'source_type': {'required': True}, + 'source_name': {'required': True}, + } + + _attribute_map = { + 'source_type': {'key': 'sourceType', 'type': 'str'}, + 'source_name': {'key': 'sourceName', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(MetricDimension, self).__init__(**kwargs) + self.source_type = kwargs['source_type'] + self.source_name = kwargs['source_name'] + + +class MetricDimensionV1(msrest.serialization.Model): + """Metric Dimension v1. + + :param name: Name of the metrics dimension. + :type name: str + :param display_name: Display name of the metrics dimension. + :type display_name: str + :param to_be_exported_for_shoebox: To be exported to shoe box. + :type to_be_exported_for_shoebox: bool + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'display_name': {'key': 'displayName', 'type': 'str'}, + 'to_be_exported_for_shoebox': {'key': 'toBeExportedForShoebox', 'type': 'bool'}, + } + + def __init__( + self, + **kwargs + ): + super(MetricDimensionV1, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.display_name = kwargs.get('display_name', None) + self.to_be_exported_for_shoebox = kwargs.get('to_be_exported_for_shoebox', None) + + +class MetricSpecificationV1(msrest.serialization.Model): + """Metric specification version 1. + + :param name: Name of the metric. + :type name: str + :param display_name: Display name of the metric. + :type display_name: str + :param display_description: Description of the metric to be displayed. + :type display_description: str + :param unit: Metric units. Possible values include: "NotSpecified", "Percent", "Count", + "Seconds", "Milliseconds", "Bytes", "BytesPerSecond", "CountPerSecond". + :type unit: str or ~azure.mgmt.databoxedge.v2020_09_01.models.MetricUnit + :param aggregation_type: Metric aggregation type. Possible values include: "NotSpecified", + "None", "Average", "Minimum", "Maximum", "Total", "Count". + :type aggregation_type: str or ~azure.mgmt.databoxedge.v2020_09_01.models.MetricAggregationType + :param dimensions: Metric dimensions, other than default dimension which is resource. + :type dimensions: list[~azure.mgmt.databoxedge.v2020_09_01.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 ~azure.mgmt.databoxedge.v2020_09_01.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 + ~azure.mgmt.databoxedge.v2020_09_01.models.TimeGrain] + :param supported_aggregation_types: Support metric aggregation type. + :type supported_aggregation_types: list[str or + ~azure.mgmt.databoxedge.v2020_09_01.models.MetricAggregationType] + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'display_name': {'key': 'displayName', 'type': 'str'}, + 'display_description': {'key': 'displayDescription', 'type': 'str'}, + 'unit': {'key': 'unit', 'type': 'str'}, + 'aggregation_type': {'key': 'aggregationType', 'type': 'str'}, + 'dimensions': {'key': 'dimensions', 'type': '[MetricDimensionV1]'}, + 'fill_gap_with_zero': {'key': 'fillGapWithZero', 'type': 'bool'}, + 'category': {'key': 'category', 'type': 'str'}, + 'resource_id_dimension_name_override': {'key': 'resourceIdDimensionNameOverride', 'type': 'str'}, + 'supported_time_grain_types': {'key': 'supportedTimeGrainTypes', 'type': '[str]'}, + 'supported_aggregation_types': {'key': 'supportedAggregationTypes', 'type': '[str]'}, + } + + def __init__( + self, + **kwargs + ): + super(MetricSpecificationV1, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.display_name = kwargs.get('display_name', None) + self.display_description = kwargs.get('display_description', None) + self.unit = kwargs.get('unit', None) + self.aggregation_type = kwargs.get('aggregation_type', None) + self.dimensions = kwargs.get('dimensions', None) + self.fill_gap_with_zero = kwargs.get('fill_gap_with_zero', None) + self.category = kwargs.get('category', None) + self.resource_id_dimension_name_override = kwargs.get('resource_id_dimension_name_override', None) + self.supported_time_grain_types = kwargs.get('supported_time_grain_types', None) + self.supported_aggregation_types = kwargs.get('supported_aggregation_types', None) + + +class MonitoringMetricConfiguration(ARMBaseModel): + """The metric setting details for the role. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: The path ID that uniquely identifies the object. + :vartype id: str + :ivar name: The object name. + :vartype name: str + :ivar type: The hierarchical type of the object. + :vartype type: str + :param metric_configurations: Required. The metrics configuration details. + :type metric_configurations: + list[~azure.mgmt.databoxedge.v2020_09_01.models.MetricConfiguration] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'metric_configurations': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'metric_configurations': {'key': 'properties.metricConfigurations', 'type': '[MetricConfiguration]'}, + } + + def __init__( + self, + **kwargs + ): + super(MonitoringMetricConfiguration, self).__init__(**kwargs) + self.metric_configurations = kwargs['metric_configurations'] + + +class MonitoringMetricConfigurationList(msrest.serialization.Model): + """Collection of metric configurations. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar value: The list of metric configurations. + :vartype value: list[~azure.mgmt.databoxedge.v2020_09_01.models.MonitoringMetricConfiguration] + :ivar next_link: Link to the next set of results. + :vartype next_link: str + """ + + _validation = { + 'value': {'readonly': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[MonitoringMetricConfiguration]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(MonitoringMetricConfigurationList, self).__init__(**kwargs) + self.value = None + self.next_link = None + + +class MountPointMap(msrest.serialization.Model): + """The share mount point. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :param share_id: Required. ID of the share mounted to the role VM. + :type share_id: str + :ivar role_id: ID of the role to which share is mounted. + :vartype role_id: str + :ivar mount_point: Mount point for the share. + :vartype mount_point: str + :ivar mount_type: Mounting type. Possible values include: "Volume", "HostPath". + :vartype mount_type: str or ~azure.mgmt.databoxedge.v2020_09_01.models.MountType + :ivar role_type: Role type. Possible values include: "IOT", "ASA", "Functions", "Cognitive", + "MEC", "CloudEdgeManagement", "Kubernetes". + :vartype role_type: str or ~azure.mgmt.databoxedge.v2020_09_01.models.RoleTypes + """ + + _validation = { + 'share_id': {'required': True}, + 'role_id': {'readonly': True}, + 'mount_point': {'readonly': True}, + 'mount_type': {'readonly': True}, + 'role_type': {'readonly': True}, + } + + _attribute_map = { + 'share_id': {'key': 'shareId', 'type': 'str'}, + 'role_id': {'key': 'roleId', 'type': 'str'}, + 'mount_point': {'key': 'mountPoint', 'type': 'str'}, + 'mount_type': {'key': 'mountType', 'type': 'str'}, + 'role_type': {'key': 'roleType', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(MountPointMap, self).__init__(**kwargs) + self.share_id = kwargs['share_id'] + self.role_id = None + self.mount_point = None + self.mount_type = None + self.role_type = None + + +class NetworkAdapter(msrest.serialization.Model): + """Represents the networkAdapter on a device. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar adapter_id: Instance ID of network adapter. + :vartype adapter_id: str + :ivar adapter_position: Hardware position of network adapter. + :vartype adapter_position: ~azure.mgmt.databoxedge.v2020_09_01.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 ~azure.mgmt.databoxedge.v2020_09_01.models.NetworkAdapterStatus + :param rdma_status: Value indicating whether this adapter is RDMA capable. Possible values + include: "Incapable", "Capable". + :type rdma_status: str or ~azure.mgmt.databoxedge.v2020_09_01.models.NetworkAdapterRDMAStatus + :param dhcp_status: Value indicating whether this adapter has DHCP enabled. Possible values + include: "Disabled", "Enabled". + :type dhcp_status: str or ~azure.mgmt.databoxedge.v2020_09_01.models.NetworkAdapterDHCPStatus + :ivar ipv4_configuration: The IPv4 configuration of the network adapter. + :vartype ipv4_configuration: ~azure.mgmt.databoxedge.v2020_09_01.models.Ipv4Config + :ivar ipv6_configuration: The IPv6 configuration of the network adapter. + :vartype ipv6_configuration: ~azure.mgmt.databoxedge.v2020_09_01.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 ~azure.mgmt.databoxedge.v2020_09_01.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[~azure.mgmt.databoxedge.v2020_09_01.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 ~azure.mgmt.databoxedge.v2020_09_01.models.NodeStatus + :ivar node_chassis_serial_number: Serial number of the Chassis. + :vartype node_chassis_serial_number: str + :ivar node_serial_number: Serial number of the individual node. + :vartype node_serial_number: str + :ivar node_display_name: Display Name of the individual node. + :vartype node_display_name: str + :ivar node_friendly_software_version: Friendly software version name that is currently + installed on the node. + :vartype node_friendly_software_version: str + :ivar node_hcs_version: HCS version that is currently installed on the node. + :vartype node_hcs_version: str + :ivar node_instance_id: Guid instance id of the node. + :vartype node_instance_id: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'node_status': {'readonly': True}, + 'node_chassis_serial_number': {'readonly': True}, + 'node_serial_number': {'readonly': True}, + 'node_display_name': {'readonly': True}, + 'node_friendly_software_version': {'readonly': True}, + 'node_hcs_version': {'readonly': True}, + 'node_instance_id': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'node_status': {'key': 'properties.nodeStatus', 'type': 'str'}, + 'node_chassis_serial_number': {'key': 'properties.nodeChassisSerialNumber', 'type': 'str'}, + 'node_serial_number': {'key': 'properties.nodeSerialNumber', 'type': 'str'}, + 'node_display_name': {'key': 'properties.nodeDisplayName', 'type': 'str'}, + 'node_friendly_software_version': {'key': 'properties.nodeFriendlySoftwareVersion', 'type': 'str'}, + 'node_hcs_version': {'key': 'properties.nodeHcsVersion', 'type': 'str'}, + 'node_instance_id': {'key': 'properties.nodeInstanceId', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(Node, self).__init__(**kwargs) + self.node_status = None + self.node_chassis_serial_number = None + self.node_serial_number = None + self.node_display_name = None + self.node_friendly_software_version = None + self.node_hcs_version = None + self.node_instance_id = None + + +class NodeInfo(msrest.serialization.Model): + """Kubernetes node info. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar name: Node name. + :vartype name: str + :ivar type: Node type - Master/Worker. Possible values include: "Invalid", "Master", "Worker". + :vartype type: str or ~azure.mgmt.databoxedge.v2020_09_01.models.KubernetesNodeType + :param ip_configuration: IP Configuration of the Kubernetes node. + :type ip_configuration: + list[~azure.mgmt.databoxedge.v2020_09_01.models.KubernetesIPConfiguration] + """ + + _validation = { + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'ip_configuration': {'key': 'ipConfiguration', 'type': '[KubernetesIPConfiguration]'}, + } + + def __init__( + self, + **kwargs + ): + super(NodeInfo, self).__init__(**kwargs) + self.name = None + self.type = None + self.ip_configuration = kwargs.get('ip_configuration', None) + + +class NodeList(msrest.serialization.Model): + """Collection of Nodes. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar value: The list of Nodes. + :vartype value: list[~azure.mgmt.databoxedge.v2020_09_01.models.Node] + :param next_link: Link to the next set of results. + :type next_link: str + """ + + _validation = { + 'value': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[Node]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(NodeList, self).__init__(**kwargs) + self.value = None + self.next_link = kwargs.get('next_link', 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: ~azure.mgmt.databoxedge.v2020_09_01.models.OperationDisplay + :param origin: Origin of the operation. + :type origin: str + :param is_data_action: Indicates whether the operation is a data action. + :type is_data_action: bool + :param service_specification: Service specification. + :type service_specification: ~azure.mgmt.databoxedge.v2020_09_01.models.ServiceSpecification + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'display': {'key': 'display', 'type': 'OperationDisplay'}, + 'origin': {'key': 'origin', 'type': 'str'}, + 'is_data_action': {'key': 'isDataAction', 'type': 'bool'}, + '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.is_data_action = kwargs.get('is_data_action', 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[~azure.mgmt.databoxedge.v2020_09_01.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: ~azure.mgmt.databoxedge.v2020_09_01.models.ContactDetails + :param shipping_address: The shipping address. + :type shipping_address: ~azure.mgmt.databoxedge.v2020_09_01.models.Address + :ivar current_status: Current status of the order. + :vartype current_status: ~azure.mgmt.databoxedge.v2020_09_01.models.OrderStatus + :ivar order_history: List of status changes in the order. + :vartype order_history: list[~azure.mgmt.databoxedge.v2020_09_01.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[~azure.mgmt.databoxedge.v2020_09_01.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[~azure.mgmt.databoxedge.v2020_09_01.models.TrackingInfo] + :param shipment_type: ShipmentType of the order. Possible values include: "NotApplicable", + "ShippedToCustomer", "SelfPickup". + :type shipment_type: str or ~azure.mgmt.databoxedge.v2020_09_01.models.ShipmentType + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'current_status': {'readonly': True}, + 'order_history': {'readonly': True}, + 'serial_number': {'readonly': True}, + 'delivery_tracking_info': {'readonly': True}, + 'return_tracking_info': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'contact_information': {'key': 'properties.contactInformation', 'type': 'ContactDetails'}, + 'shipping_address': {'key': 'properties.shippingAddress', 'type': 'Address'}, + 'current_status': {'key': 'properties.currentStatus', 'type': 'OrderStatus'}, + 'order_history': {'key': 'properties.orderHistory', 'type': '[OrderStatus]'}, + 'serial_number': {'key': 'properties.serialNumber', 'type': 'str'}, + 'delivery_tracking_info': {'key': 'properties.deliveryTrackingInfo', 'type': '[TrackingInfo]'}, + 'return_tracking_info': {'key': 'properties.returnTrackingInfo', 'type': '[TrackingInfo]'}, + 'shipment_type': {'key': 'properties.shipmentType', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(Order, self).__init__(**kwargs) + self.contact_information = kwargs.get('contact_information', None) + self.shipping_address = kwargs.get('shipping_address', None) + self.current_status = None + self.order_history = None + self.serial_number = None + self.delivery_tracking_info = None + self.return_tracking_info = None + self.shipment_type = kwargs.get('shipment_type', None) + + +class OrderList(msrest.serialization.Model): + """List of order entities. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar value: The list of orders. + :vartype value: list[~azure.mgmt.databoxedge.v2020_09_01.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", + "AwaitingPickup", "PickupCompleted", "AwaitingDrop". + :type status: str or ~azure.mgmt.databoxedge.v2020_09_01.models.OrderState + :ivar update_date_time: Time of status update. + :vartype update_date_time: ~datetime.datetime + :param comments: Comments related to this status change. + :type comments: str + :ivar tracking_information: Tracking information related to the state in the ordering flow. + :vartype tracking_information: ~azure.mgmt.databoxedge.v2020_09_01.models.TrackingInfo + :ivar additional_order_details: Dictionary to hold generic information which is not stored + by the already existing properties. + :vartype additional_order_details: dict[str, str] + """ + + _validation = { + 'status': {'required': True}, + 'update_date_time': {'readonly': True}, + 'tracking_information': {'readonly': True}, + 'additional_order_details': {'readonly': True}, + } + + _attribute_map = { + 'status': {'key': 'status', 'type': 'str'}, + 'update_date_time': {'key': 'updateDateTime', 'type': 'iso-8601'}, + 'comments': {'key': 'comments', 'type': 'str'}, + 'tracking_information': {'key': 'trackingInformation', 'type': 'TrackingInfo'}, + 'additional_order_details': {'key': 'additionalOrderDetails', 'type': '{str}'}, + } + + def __init__( + self, + **kwargs + ): + super(OrderStatus, self).__init__(**kwargs) + self.status = kwargs['status'] + self.update_date_time = None + self.comments = kwargs.get('comments', None) + self.tracking_information = None + self.additional_order_details = None + + +class PeriodicTimerEventTrigger(Trigger): + """Trigger details. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: The path ID that uniquely identifies the object. + :vartype id: str + :ivar name: The object name. + :vartype name: str + :ivar type: The hierarchical type of the object. + :vartype type: str + :ivar system_data: Trigger in DataBoxEdge Resource. + :vartype system_data: ~azure.mgmt.databoxedge.v2020_09_01.models.SystemData + :param kind: Required. Trigger Kind.Constant filled by server. Possible values include: + "FileEvent", "PeriodicTimerEvent". + :type kind: str or ~azure.mgmt.databoxedge.v2020_09_01.models.TriggerEventType + :param source_info: Required. Periodic timer details. + :type source_info: ~azure.mgmt.databoxedge.v2020_09_01.models.PeriodicTimerSourceInfo + :param sink_info: Required. Role Sink information. + :type sink_info: ~azure.mgmt.databoxedge.v2020_09_01.models.RoleSinkInfo + :param custom_context_tag: A custom context tag typically used to correlate the trigger against + its usage. For example, if a periodic timer trigger is intended for certain specific IoT + modules in the device, the tag can be the name or the image URL of the module. + :type custom_context_tag: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'system_data': {'readonly': True}, + 'kind': {'required': True}, + 'source_info': {'required': True}, + 'sink_info': {'required': True}, + 'custom_context_tag': {'max_length': 192, 'min_length': 0}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'source_info': {'key': 'properties.sourceInfo', 'type': 'PeriodicTimerSourceInfo'}, + 'sink_info': {'key': 'properties.sinkInfo', 'type': 'RoleSinkInfo'}, + 'custom_context_tag': {'key': 'properties.customContextTag', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(PeriodicTimerEventTrigger, self).__init__(**kwargs) + self.kind = 'PeriodicTimerEvent' # type: str + self.source_info = kwargs['source_info'] + self.sink_info = kwargs['sink_info'] + self.custom_context_tag = kwargs.get('custom_context_tag', None) + + +class PeriodicTimerSourceInfo(msrest.serialization.Model): + """Periodic timer event source. + + All required parameters must be populated in order to send to Azure. + + :param start_time: Required. The time of the day that results in a valid trigger. Schedule is + computed with reference to the time specified upto seconds. If timezone is not specified the + time will considered to be in device timezone. The value will always be returned as UTC time. + :type start_time: ~datetime.datetime + :param schedule: Required. Periodic frequency at which timer event needs to be raised. Supports + daily, hourly, minutes, and seconds. + :type schedule: str + :param topic: Topic where periodic events are published to IoT device. + :type topic: str + """ + + _validation = { + 'start_time': {'required': True}, + 'schedule': {'required': True}, + } + + _attribute_map = { + 'start_time': {'key': 'startTime', 'type': 'iso-8601'}, + 'schedule': {'key': 'schedule', 'type': 'str'}, + 'topic': {'key': 'topic', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(PeriodicTimerSourceInfo, self).__init__(**kwargs) + self.start_time = kwargs['start_time'] + self.schedule = kwargs['schedule'] + self.topic = kwargs.get('topic', None) + + +class RefreshDetails(msrest.serialization.Model): + """Fields for tracking refresh job on the share or container. + + :param in_progress_refresh_job_id: If a refresh job is currently in progress on this share or + container, this field indicates the ARM resource ID of that job. The field is empty if no job + is in progress. + :type in_progress_refresh_job_id: str + :param last_completed_refresh_job_time_in_utc: Indicates the completed time for the last + refresh job on this particular share or container, if any.This could be a failed job or a + successful job. + :type last_completed_refresh_job_time_in_utc: ~datetime.datetime + :param error_manifest_file: Indicates the relative path of the error xml for the last refresh + job on this particular share or container, if any. This could be a failed job or a successful + job. + :type error_manifest_file: str + :param last_job: Indicates the id of the last refresh job on this particular share or + container,if any. This could be a failed job or a successful job. + :type last_job: str + """ + + _attribute_map = { + 'in_progress_refresh_job_id': {'key': 'inProgressRefreshJobId', 'type': 'str'}, + 'last_completed_refresh_job_time_in_utc': {'key': 'lastCompletedRefreshJobTimeInUTC', 'type': 'iso-8601'}, + 'error_manifest_file': {'key': 'errorManifestFile', 'type': 'str'}, + 'last_job': {'key': 'lastJob', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(RefreshDetails, self).__init__(**kwargs) + self.in_progress_refresh_job_id = kwargs.get('in_progress_refresh_job_id', None) + self.last_completed_refresh_job_time_in_utc = kwargs.get('last_completed_refresh_job_time_in_utc', None) + self.error_manifest_file = kwargs.get('error_manifest_file', None) + self.last_job = kwargs.get('last_job', None) + + +class ResourceIdentity(msrest.serialization.Model): + """Msi identity details of the resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param type: Identity type. Possible values include: "None", "SystemAssigned", "UserAssigned". + :type type: str or ~azure.mgmt.databoxedge.v2020_09_01.models.MsiIdentityType + :ivar principal_id: Service Principal Id backing the Msi. + :vartype principal_id: str + :ivar tenant_id: Home Tenant Id. + :vartype tenant_id: str + """ + + _validation = { + 'principal_id': {'readonly': True}, + 'tenant_id': {'readonly': True}, + } + + _attribute_map = { + 'type': {'key': 'type', 'type': 'str'}, + 'principal_id': {'key': 'principalId', 'type': 'str'}, + 'tenant_id': {'key': 'tenantId', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ResourceIdentity, self).__init__(**kwargs) + self.type = kwargs.get('type', None) + self.principal_id = None + self.tenant_id = None + + +class ResourceMoveDetails(msrest.serialization.Model): + """Fields for tracking resource move. + + :param operation_in_progress: Denotes whether move operation is in progress. Possible values + include: "None", "ResourceMoveInProgress", "ResourceMoveFailed". + :type operation_in_progress: str or + ~azure.mgmt.databoxedge.v2020_09_01.models.ResourceMoveStatus + :param operation_in_progress_lock_timeout_in_utc: Denotes the timeout of the operation to + finish. + :type operation_in_progress_lock_timeout_in_utc: ~datetime.datetime + """ + + _attribute_map = { + 'operation_in_progress': {'key': 'operationInProgress', 'type': 'str'}, + 'operation_in_progress_lock_timeout_in_utc': {'key': 'operationInProgressLockTimeoutInUTC', 'type': 'iso-8601'}, + } + + def __init__( + self, + **kwargs + ): + super(ResourceMoveDetails, self).__init__(**kwargs) + self.operation_in_progress = kwargs.get('operation_in_progress', None) + self.operation_in_progress_lock_timeout_in_utc = kwargs.get('operation_in_progress_lock_timeout_in_utc', None) + + +class ResourceTypeSku(msrest.serialization.Model): + """Resource type Sku object. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar resource_type: The resource type. + :vartype resource_type: str + :ivar skus: The skus. + :vartype skus: list[~azure.mgmt.databoxedge.v2020_09_01.models.SkuInformation] + """ + + _validation = { + 'resource_type': {'readonly': True}, + 'skus': {'readonly': True}, + } + + _attribute_map = { + 'resource_type': {'key': 'resourceType', 'type': 'str'}, + 'skus': {'key': 'skus', 'type': '[SkuInformation]'}, + } + + def __init__( + self, + **kwargs + ): + super(ResourceTypeSku, self).__init__(**kwargs) + self.resource_type = None + self.skus = None + + +class RoleList(msrest.serialization.Model): + """Collection of all the roles on the Data Box Edge device. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar value: The Value. + :vartype value: list[~azure.mgmt.databoxedge.v2020_09_01.models.Role] + :ivar next_link: Link to the next set of results. + :vartype next_link: str + """ + + _validation = { + 'value': {'readonly': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[Role]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(RoleList, self).__init__(**kwargs) + self.value = None + self.next_link = None + + +class RoleSinkInfo(msrest.serialization.Model): + """Compute role against which events will be raised. + + All required parameters must be populated in order to send to Azure. + + :param role_id: Required. Compute role ID. + :type role_id: str + """ + + _validation = { + 'role_id': {'required': True}, + } + + _attribute_map = { + 'role_id': {'key': 'roleId', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(RoleSinkInfo, self).__init__(**kwargs) + self.role_id = kwargs['role_id'] + + +class 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: + ~azure.mgmt.databoxedge.v2020_09_01.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[~azure.mgmt.databoxedge.v2020_09_01.models.MetricSpecificationV1] + """ + + _attribute_map = { + 'metric_specifications': {'key': 'metricSpecifications', 'type': '[MetricSpecificationV1]'}, + } + + def __init__( + self, + **kwargs + ): + super(ServiceSpecification, self).__init__(**kwargs) + self.metric_specifications = kwargs.get('metric_specifications', None) + + +class Share(ARMBaseModel): + """Represents a share on the Data Box Edge/Gateway device. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: The path ID that uniquely identifies the object. + :vartype id: str + :ivar name: The object name. + :vartype name: str + :ivar type: The hierarchical type of the object. + :vartype type: str + :ivar system_data: Share on ASE device. + :vartype system_data: ~azure.mgmt.databoxedge.v2020_09_01.models.SystemData + :param description: Description for the share. + :type description: str + :param share_status: Required. Current status of the share. Possible values include: "Offline", + "Unknown", "OK", "Updating", "NeedsAttention". + :type share_status: str or ~azure.mgmt.databoxedge.v2020_09_01.models.ShareStatus + :param monitoring_status: Required. Current monitoring status of the share. Possible values + include: "Enabled", "Disabled". + :type monitoring_status: str or ~azure.mgmt.databoxedge.v2020_09_01.models.MonitoringStatus + :param azure_container_info: Azure container mapping for the share. + :type azure_container_info: ~azure.mgmt.databoxedge.v2020_09_01.models.AzureContainerInfo + :param access_protocol: Required. Access protocol to be used by the share. Possible values + include: "SMB", "NFS". + :type access_protocol: str or ~azure.mgmt.databoxedge.v2020_09_01.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[~azure.mgmt.databoxedge.v2020_09_01.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[~azure.mgmt.databoxedge.v2020_09_01.models.ClientAccessRight] + :param refresh_details: Details of the refresh job on this share. + :type refresh_details: ~azure.mgmt.databoxedge.v2020_09_01.models.RefreshDetails + :ivar share_mappings: Share mount point to the role. + :vartype share_mappings: list[~azure.mgmt.databoxedge.v2020_09_01.models.MountPointMap] + :param data_policy: Data policy of the share. Possible values include: "Cloud", "Local". + :type data_policy: str or ~azure.mgmt.databoxedge.v2020_09_01.models.DataPolicy + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'system_data': {'readonly': True}, + 'share_status': {'required': True}, + 'monitoring_status': {'required': True}, + 'access_protocol': {'required': True}, + 'share_mappings': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + 'share_status': {'key': 'properties.shareStatus', 'type': 'str'}, + 'monitoring_status': {'key': 'properties.monitoringStatus', 'type': 'str'}, + 'azure_container_info': {'key': 'properties.azureContainerInfo', 'type': 'AzureContainerInfo'}, + 'access_protocol': {'key': 'properties.accessProtocol', 'type': 'str'}, + 'user_access_rights': {'key': 'properties.userAccessRights', 'type': '[UserAccessRight]'}, + 'client_access_rights': {'key': 'properties.clientAccessRights', 'type': '[ClientAccessRight]'}, + 'refresh_details': {'key': 'properties.refreshDetails', 'type': 'RefreshDetails'}, + 'share_mappings': {'key': 'properties.shareMappings', 'type': '[MountPointMap]'}, + 'data_policy': {'key': 'properties.dataPolicy', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(Share, self).__init__(**kwargs) + self.system_data = None + self.description = kwargs.get('description', None) + self.share_status = kwargs['share_status'] + self.monitoring_status = kwargs['monitoring_status'] + self.azure_container_info = kwargs.get('azure_container_info', None) + self.access_protocol = kwargs['access_protocol'] + self.user_access_rights = kwargs.get('user_access_rights', None) + self.client_access_rights = kwargs.get('client_access_rights', None) + self.refresh_details = kwargs.get('refresh_details', None) + self.share_mappings = None + self.data_policy = kwargs.get('data_policy', None) + + +class ShareAccessRight(msrest.serialization.Model): + """Specifies the mapping between this particular user and the type of access he has on shares on this device. + + All required parameters must be populated in order to send to Azure. + + :param share_id: Required. The share ID. + :type share_id: str + :param access_type: Required. Type of access to be allowed on the share for this user. Possible + values include: "Change", "Read", "Custom". + :type access_type: str or ~azure.mgmt.databoxedge.v2020_09_01.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[~azure.mgmt.databoxedge.v2020_09_01.models.Share] + :ivar next_link: Link to the next set of results. + :vartype next_link: str + """ + + _validation = { + 'value': {'readonly': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[Share]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ShareList, self).__init__(**kwargs) + self.value = None + self.next_link = None + + +class Sku(msrest.serialization.Model): + """The SKU type. + + :param name: SKU name. Possible values include: "Gateway", "Edge", "TEA_1Node", + "TEA_1Node_UPS", "TEA_1Node_Heater", "TEA_1Node_UPS_Heater", "TEA_4Node_Heater", + "TEA_4Node_UPS_Heater", "TMA", "TDC", "TCA_Small", "GPU", "TCA_Large", "EdgeP_Base", + "EdgeP_High", "EdgePR_Base", "EdgePR_Base_UPS", "EdgeMR_Mini", "RCA_Small", "RCA_Large", "RDC". + :type name: str or ~azure.mgmt.databoxedge.v2020_09_01.models.SkuName + :param tier: The SKU tier. This is based on the SKU name. Possible values include: "Standard". + :type tier: str or ~azure.mgmt.databoxedge.v2020_09_01.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: The extended unit. + :vartype extended_unit: str + """ + + _validation = { + 'meter_id': {'readonly': True}, + 'quantity': {'readonly': True}, + 'extended_unit': {'readonly': True}, + } + + _attribute_map = { + 'meter_id': {'key': 'meterId', 'type': 'str'}, + 'quantity': {'key': 'quantity', 'type': 'long'}, + 'extended_unit': {'key': 'extendedUnit', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(SkuCost, self).__init__(**kwargs) + self.meter_id = None + self.quantity = None + self.extended_unit = None + + +class SkuInformation(msrest.serialization.Model): + """Sku information. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar name: The sku name. + :vartype name: str + :ivar tier: The sku tier. + :vartype tier: str + :ivar kind: The sku kind. + :vartype kind: str + :ivar family: The Sku family. + :vartype family: str + :ivar costs: The pricing info of the Sku. + :vartype costs: list[~azure.mgmt.databoxedge.v2020_09_01.models.SkuCost] + :ivar locations: The locations where Sku is available. + :vartype locations: list[str] + :ivar location_info: The locations where Sku is available with zones and sites info. + :vartype location_info: list[~azure.mgmt.databoxedge.v2020_09_01.models.SkuLocationInfo] + :ivar required_quota_ids: The required quotaIds for the sku to be available. + :vartype required_quota_ids: list[str] + :ivar required_features: The required features for the sku to be available. + :vartype required_features: list[str] + """ + + _validation = { + 'name': {'readonly': True}, + 'tier': {'readonly': True}, + 'kind': {'readonly': True}, + 'family': {'readonly': True}, + 'costs': {'readonly': True}, + 'locations': {'readonly': True}, + 'location_info': {'readonly': True}, + 'required_quota_ids': {'readonly': True}, + 'required_features': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'tier': {'key': 'tier', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'family': {'key': 'family', 'type': 'str'}, + 'costs': {'key': 'costs', 'type': '[SkuCost]'}, + 'locations': {'key': 'locations', 'type': '[str]'}, + 'location_info': {'key': 'locationInfo', 'type': '[SkuLocationInfo]'}, + 'required_quota_ids': {'key': 'requiredQuotaIds', 'type': '[str]'}, + 'required_features': {'key': 'requiredFeatures', 'type': '[str]'}, + } + + def __init__( + self, + **kwargs + ): + super(SkuInformation, self).__init__(**kwargs) + self.name = None + self.tier = None + self.kind = None + self.family = None + self.costs = None + self.locations = None + self.location_info = None + self.required_quota_ids = None + self.required_features = None + + +class SkuInformationList(msrest.serialization.Model): + """List of SKU Information objects. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar value: List of ResourceTypeSku objects. + :vartype value: list[~azure.mgmt.databoxedge.v2020_09_01.models.ResourceTypeSku] + :ivar next_link: Links to the next set of results. + :vartype next_link: str + """ + + _validation = { + 'value': {'readonly': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[ResourceTypeSku]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(SkuInformationList, self).__init__(**kwargs) + self.value = None + self.next_link = None + + +class SkuLocationInfo(msrest.serialization.Model): + """The location info. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar location: The location. + :vartype location: str + :ivar zones: The zones. + :vartype zones: list[str] + :ivar sites: The sites. + :vartype sites: list[str] + """ + + _validation = { + 'location': {'readonly': True}, + 'zones': {'readonly': True}, + 'sites': {'readonly': True}, + } + + _attribute_map = { + 'location': {'key': 'location', 'type': 'str'}, + 'zones': {'key': 'zones', 'type': '[str]'}, + 'sites': {'key': 'sites', 'type': '[str]'}, + } + + def __init__( + self, + **kwargs + ): + super(SkuLocationInfo, self).__init__(**kwargs) + self.location = None + self.zones = None + self.sites = None + + +class StorageAccount(ARMBaseModel): + """Represents a Storage Account on the Data Box Edge/Gateway device. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: The path ID that uniquely identifies the object. + :vartype id: str + :ivar name: The object name. + :vartype name: str + :ivar type: The hierarchical type of the object. + :vartype type: str + :ivar system_data: StorageAccount object on ASE device. + :vartype system_data: ~azure.mgmt.databoxedge.v2020_09_01.models.SystemData + :param description: Description for the storage Account. + :type description: str + :param storage_account_status: Current status of the storage account. Possible values include: + "OK", "Offline", "Unknown", "Updating", "NeedsAttention". + :type storage_account_status: str or + ~azure.mgmt.databoxedge.v2020_09_01.models.StorageAccountStatus + :param data_policy: Required. Data policy of the storage Account. Possible values include: + "Cloud", "Local". + :type data_policy: str or ~azure.mgmt.databoxedge.v2020_09_01.models.DataPolicy + :param storage_account_credential_id: Storage Account Credential Id. + :type storage_account_credential_id: str + :ivar blob_endpoint: BlobEndpoint of Storage Account. + :vartype blob_endpoint: str + :ivar container_count: The Container Count. Present only for Storage Accounts with DataPolicy + set to Cloud. + :vartype container_count: int + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'system_data': {'readonly': True}, + 'data_policy': {'required': True}, + 'blob_endpoint': {'readonly': True}, + 'container_count': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + 'storage_account_status': {'key': 'properties.storageAccountStatus', 'type': 'str'}, + 'data_policy': {'key': 'properties.dataPolicy', 'type': 'str'}, + 'storage_account_credential_id': {'key': 'properties.storageAccountCredentialId', 'type': 'str'}, + 'blob_endpoint': {'key': 'properties.blobEndpoint', 'type': 'str'}, + 'container_count': {'key': 'properties.containerCount', 'type': 'int'}, + } + + def __init__( + self, + **kwargs + ): + super(StorageAccount, self).__init__(**kwargs) + self.system_data = None + self.description = kwargs.get('description', None) + self.storage_account_status = kwargs.get('storage_account_status', None) + self.data_policy = kwargs['data_policy'] + self.storage_account_credential_id = kwargs.get('storage_account_credential_id', None) + self.blob_endpoint = None + self.container_count = None + + +class StorageAccountCredential(ARMBaseModel): + """The storage account credential. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: The path ID that uniquely identifies the object. + :vartype id: str + :ivar name: The object name. + :vartype name: str + :ivar type: The hierarchical type of the object. + :vartype type: str + :ivar system_data: StorageAccountCredential object. + :vartype system_data: ~azure.mgmt.databoxedge.v2020_09_01.models.SystemData + :param alias: Required. Alias for the storage account. + :type alias: str + :param user_name: Username for the storage account. + :type user_name: str + :param account_key: Encrypted storage key. + :type account_key: ~azure.mgmt.databoxedge.v2020_09_01.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 ~azure.mgmt.databoxedge.v2020_09_01.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 ~azure.mgmt.databoxedge.v2020_09_01.models.AccountType + :param storage_account_id: Id of the storage account. + :type storage_account_id: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'system_data': {'readonly': True}, + 'alias': {'required': True}, + 'ssl_status': {'required': True}, + 'account_type': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'alias': {'key': 'properties.alias', 'type': 'str'}, + 'user_name': {'key': 'properties.userName', 'type': 'str'}, + 'account_key': {'key': 'properties.accountKey', 'type': 'AsymmetricEncryptedSecret'}, + 'connection_string': {'key': 'properties.connectionString', 'type': 'str'}, + 'ssl_status': {'key': 'properties.sslStatus', 'type': 'str'}, + 'blob_domain_name': {'key': 'properties.blobDomainName', 'type': 'str'}, + 'account_type': {'key': 'properties.accountType', 'type': 'str'}, + 'storage_account_id': {'key': 'properties.storageAccountId', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(StorageAccountCredential, self).__init__(**kwargs) + self.system_data = None + self.alias = kwargs['alias'] + self.user_name = kwargs.get('user_name', None) + self.account_key = kwargs.get('account_key', None) + self.connection_string = kwargs.get('connection_string', None) + self.ssl_status = kwargs['ssl_status'] + self.blob_domain_name = kwargs.get('blob_domain_name', None) + self.account_type = kwargs['account_type'] + self.storage_account_id = kwargs.get('storage_account_id', None) + + +class StorageAccountCredentialList(msrest.serialization.Model): + """The collection of storage account credentials. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar value: The value. + :vartype value: list[~azure.mgmt.databoxedge.v2020_09_01.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[~azure.mgmt.databoxedge.v2020_09_01.models.StorageAccount] + :ivar next_link: Link to the next set of results. + :vartype next_link: str + """ + + _validation = { + 'value': {'readonly': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[StorageAccount]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(StorageAccountList, self).__init__(**kwargs) + self.value = None + self.next_link = None + + +class SubscriptionRegisteredFeatures(msrest.serialization.Model): + """SubscriptionRegisteredFeatures. + + :param name: + :type name: str + :param state: + :type state: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'state': {'key': 'state', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(SubscriptionRegisteredFeatures, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.state = kwargs.get('state', None) + + +class SymmetricKey(msrest.serialization.Model): + """Symmetric key for authentication. + + :param connection_string: Connection string based on the symmetric key. + :type connection_string: ~azure.mgmt.databoxedge.v2020_09_01.models.AsymmetricEncryptedSecret + """ + + _attribute_map = { + 'connection_string': {'key': 'connectionString', 'type': 'AsymmetricEncryptedSecret'}, + } + + def __init__( + self, + **kwargs + ): + super(SymmetricKey, self).__init__(**kwargs) + self.connection_string = kwargs.get('connection_string', None) + + +class SystemData(msrest.serialization.Model): + """Metadata pertaining to creation and last modification of the resource. + + :param created_by: The identity that created the resource. + :type created_by: str + :param created_by_type: The type of identity that created the resource. Possible values + include: "User", "Application", "ManagedIdentity", "Key". + :type created_by_type: str or ~azure.mgmt.databoxedge.v2020_09_01.models.CreatedByType + :param created_at: The timestamp of resource creation (UTC). + :type created_at: ~datetime.datetime + :param last_modified_by: The identity that last modified the resource. + :type last_modified_by: str + :param last_modified_by_type: The type of identity that last modified the resource. Possible + values include: "User", "Application", "ManagedIdentity", "Key". + :type last_modified_by_type: str or ~azure.mgmt.databoxedge.v2020_09_01.models.CreatedByType + :param last_modified_at: The type of identity that last modified the resource. + :type last_modified_at: ~datetime.datetime + """ + + _attribute_map = { + 'created_by': {'key': 'createdBy', 'type': 'str'}, + 'created_by_type': {'key': 'createdByType', 'type': 'str'}, + 'created_at': {'key': 'createdAt', 'type': 'iso-8601'}, + 'last_modified_by': {'key': 'lastModifiedBy', 'type': 'str'}, + 'last_modified_by_type': {'key': 'lastModifiedByType', 'type': 'str'}, + 'last_modified_at': {'key': 'lastModifiedAt', 'type': 'iso-8601'}, + } + + def __init__( + self, + **kwargs + ): + super(SystemData, self).__init__(**kwargs) + self.created_by = kwargs.get('created_by', None) + self.created_by_type = kwargs.get('created_by_type', None) + self.created_at = kwargs.get('created_at', None) + self.last_modified_by = kwargs.get('last_modified_by', None) + self.last_modified_by_type = kwargs.get('last_modified_by_type', None) + self.last_modified_at = kwargs.get('last_modified_at', None) + + +class TrackingInfo(msrest.serialization.Model): + """Tracking courier information. + + :param serial_number: Serial number of the device being tracked. + :type serial_number: str + :param carrier_name: Name of the carrier used in the delivery. + :type carrier_name: str + :param tracking_id: Tracking ID of the shipment. + :type tracking_id: str + :param tracking_url: Tracking URL of the shipment. + :type tracking_url: str + """ + + _attribute_map = { + 'serial_number': {'key': 'serialNumber', 'type': 'str'}, + 'carrier_name': {'key': 'carrierName', 'type': 'str'}, + 'tracking_id': {'key': 'trackingId', 'type': 'str'}, + 'tracking_url': {'key': 'trackingUrl', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(TrackingInfo, self).__init__(**kwargs) + self.serial_number = kwargs.get('serial_number', None) + self.carrier_name = kwargs.get('carrier_name', None) + self.tracking_id = kwargs.get('tracking_id', None) + self.tracking_url = kwargs.get('tracking_url', None) + + +class TriggerList(msrest.serialization.Model): + """Collection of all trigger on the data box edge device. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar value: The list of triggers. + :vartype value: list[~azure.mgmt.databoxedge.v2020_09_01.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 ~azure.mgmt.databoxedge.v2020_09_01.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 + ~azure.mgmt.databoxedge.v2020_09_01.models.InstallRebootBehavior + :ivar ongoing_update_operation: The current update operation. Possible values include: "None", + "Scan", "Download", "Install". + :vartype ongoing_update_operation: str or + ~azure.mgmt.databoxedge.v2020_09_01.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 ~azure.mgmt.databoxedge.v2020_09_01.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 ~azure.mgmt.databoxedge.v2020_09_01.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. + + :ivar id: The path ID that uniquely identifies the object. + :vartype id: str + :ivar name: The object name. + :vartype name: str + :ivar type: The hierarchical type of the object. + :vartype type: str + :ivar system_data: User in DataBoxEdge Resource. + :vartype system_data: ~azure.mgmt.databoxedge.v2020_09_01.models.SystemData + :param encrypted_password: The password details. + :type encrypted_password: ~azure.mgmt.databoxedge.v2020_09_01.models.AsymmetricEncryptedSecret + :ivar share_access_rights: List of shares that the user has rights on. This field should not be + specified during user creation. + :vartype share_access_rights: list[~azure.mgmt.databoxedge.v2020_09_01.models.ShareAccessRight] + :param user_type: Type of the user. Possible values include: "Share", "LocalManagement", "ARM". + :type user_type: str or ~azure.mgmt.databoxedge.v2020_09_01.models.UserType + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'system_data': {'readonly': True}, + 'share_access_rights': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'encrypted_password': {'key': 'properties.encryptedPassword', 'type': 'AsymmetricEncryptedSecret'}, + 'share_access_rights': {'key': 'properties.shareAccessRights', 'type': '[ShareAccessRight]'}, + 'user_type': {'key': 'properties.userType', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(User, self).__init__(**kwargs) + self.system_data = None + self.encrypted_password = kwargs.get('encrypted_password', None) + self.share_access_rights = None + self.user_type = kwargs.get('user_type', None) + + +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 ~azure.mgmt.databoxedge.v2020_09_01.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[~azure.mgmt.databoxedge.v2020_09_01.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/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_09_01/models/_models_py3.py b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_09_01/models/_models_py3.py new file mode 100644 index 000000000000..3940676b4046 --- /dev/null +++ b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_09_01/models/_models_py3.py @@ -0,0 +1,5288 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +import datetime +from typing import Dict, List, Optional, Union + +import msrest.serialization + +from ._data_box_edge_management_client_enums import * + + +class ARMBaseModel(msrest.serialization.Model): + """Represents the base class for all object models. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: The path ID that uniquely identifies the object. + :vartype id: str + :ivar name: The object name. + :vartype name: str + :ivar type: The hierarchical type of the object. + :vartype type: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ARMBaseModel, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None + + +class Addon(ARMBaseModel): + """Role Addon. + + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: ArcAddon, IoTAddon. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: The path ID that uniquely identifies the object. + :vartype id: str + :ivar name: The object name. + :vartype name: str + :ivar type: The hierarchical type of the object. + :vartype type: str + :param kind: Required. Addon type.Constant filled by server. Possible values include: + "IotEdge", "ArcForKubernetes". + :type kind: str or ~azure.mgmt.databoxedge.v2020_09_01.models.AddonType + :ivar system_data: Addon type. + :vartype system_data: ~azure.mgmt.databoxedge.v2020_09_01.models.SystemData + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'kind': {'required': True}, + 'system_data': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + } + + _subtype_map = { + 'kind': {'ArcForKubernetes': 'ArcAddon', 'IotEdge': 'IoTAddon'} + } + + def __init__( + self, + **kwargs + ): + super(Addon, self).__init__(**kwargs) + self.kind = 'Addon' # type: str + self.system_data = None + + +class AddonList(msrest.serialization.Model): + """Collection of all the Role addon on the Azure Stack Edge device. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar value: The Value. + :vartype value: list[~azure.mgmt.databoxedge.v2020_09_01.models.Addon] + :ivar next_link: Link to the next set of results. + :vartype next_link: str + """ + + _validation = { + 'value': {'readonly': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[Addon]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(AddonList, self).__init__(**kwargs) + self.value = None + self.next_link = None + + +class Address(msrest.serialization.Model): + """The shipping address of the customer. + + All required parameters must be populated in order to send to Azure. + + :param address_line1: The address line1. + :type address_line1: str + :param address_line2: The address line2. + :type address_line2: str + :param address_line3: The address line3. + :type address_line3: str + :param postal_code: The postal code. + :type postal_code: str + :param city: The city name. + :type city: str + :param state: The state name. + :type state: str + :param country: Required. The country name. + :type country: str + """ + + _validation = { + 'country': {'required': True}, + } + + _attribute_map = { + 'address_line1': {'key': 'addressLine1', 'type': 'str'}, + 'address_line2': {'key': 'addressLine2', 'type': 'str'}, + 'address_line3': {'key': 'addressLine3', 'type': 'str'}, + 'postal_code': {'key': 'postalCode', 'type': 'str'}, + 'city': {'key': 'city', 'type': 'str'}, + 'state': {'key': 'state', 'type': 'str'}, + 'country': {'key': 'country', 'type': 'str'}, + } + + def __init__( + self, + *, + country: str, + address_line1: Optional[str] = None, + address_line2: Optional[str] = None, + address_line3: Optional[str] = None, + postal_code: Optional[str] = None, + city: Optional[str] = None, + state: Optional[str] = None, + **kwargs + ): + super(Address, self).__init__(**kwargs) + self.address_line1 = address_line1 + self.address_line2 = address_line2 + self.address_line3 = address_line3 + self.postal_code = postal_code + self.city = city + self.state = state + self.country = country + + +class Alert(ARMBaseModel): + """Alert on the data box edge/gateway device. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: The path ID that uniquely identifies the object. + :vartype id: str + :ivar name: The object name. + :vartype name: str + :ivar type: The hierarchical type of the object. + :vartype type: str + :ivar system_data: Alert generated in the resource. + :vartype system_data: ~azure.mgmt.databoxedge.v2020_09_01.models.SystemData + :ivar title: Alert title. + :vartype title: str + :ivar alert_type: Alert type. + :vartype alert_type: str + :ivar appeared_at_date_time: UTC time when the alert appeared. + :vartype appeared_at_date_time: ~datetime.datetime + :ivar recommendation: Alert recommendation. + :vartype recommendation: str + :ivar severity: Severity of the alert. Possible values include: "Informational", "Warning", + "Critical". + :vartype severity: str or ~azure.mgmt.databoxedge.v2020_09_01.models.AlertSeverity + :ivar error_details: Error details of the alert. + :vartype error_details: ~azure.mgmt.databoxedge.v2020_09_01.models.AlertErrorDetails + :ivar detailed_information: Alert details. + :vartype detailed_information: dict[str, str] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'system_data': {'readonly': True}, + 'title': {'readonly': True}, + 'alert_type': {'readonly': True}, + 'appeared_at_date_time': {'readonly': True}, + 'recommendation': {'readonly': True}, + 'severity': {'readonly': True}, + 'error_details': {'readonly': True}, + 'detailed_information': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'title': {'key': 'properties.title', 'type': 'str'}, + 'alert_type': {'key': 'properties.alertType', 'type': 'str'}, + 'appeared_at_date_time': {'key': 'properties.appearedAtDateTime', 'type': 'iso-8601'}, + 'recommendation': {'key': 'properties.recommendation', 'type': 'str'}, + 'severity': {'key': 'properties.severity', 'type': 'str'}, + 'error_details': {'key': 'properties.errorDetails', 'type': 'AlertErrorDetails'}, + 'detailed_information': {'key': 'properties.detailedInformation', 'type': '{str}'}, + } + + def __init__( + self, + **kwargs + ): + super(Alert, self).__init__(**kwargs) + self.system_data = None + self.title = None + self.alert_type = None + self.appeared_at_date_time = None + self.recommendation = None + self.severity = None + self.error_details = None + self.detailed_information = None + + +class AlertErrorDetails(msrest.serialization.Model): + """Error details for the alert. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar error_code: Error code. + :vartype error_code: str + :ivar error_message: Error Message. + :vartype error_message: str + :ivar occurrences: Number of occurrences. + :vartype occurrences: int + """ + + _validation = { + 'error_code': {'readonly': True}, + 'error_message': {'readonly': True}, + 'occurrences': {'readonly': True}, + } + + _attribute_map = { + 'error_code': {'key': 'errorCode', 'type': 'str'}, + 'error_message': {'key': 'errorMessage', 'type': 'str'}, + 'occurrences': {'key': 'occurrences', 'type': 'int'}, + } + + def __init__( + self, + **kwargs + ): + super(AlertErrorDetails, self).__init__(**kwargs) + self.error_code = None + self.error_message = None + self.occurrences = None + + +class AlertList(msrest.serialization.Model): + """Collection of alerts. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar value: The value. + :vartype value: list[~azure.mgmt.databoxedge.v2020_09_01.models.Alert] + :ivar next_link: Link to the next set of results. + :vartype next_link: str + """ + + _validation = { + 'value': {'readonly': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[Alert]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(AlertList, self).__init__(**kwargs) + self.value = None + self.next_link = None + + +class ArcAddon(Addon): + """Arc Addon. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: The path ID that uniquely identifies the object. + :vartype id: str + :ivar name: The object name. + :vartype name: str + :ivar type: The hierarchical type of the object. + :vartype type: str + :param kind: Required. Addon type.Constant filled by server. Possible values include: + "IotEdge", "ArcForKubernetes". + :type kind: str or ~azure.mgmt.databoxedge.v2020_09_01.models.AddonType + :ivar system_data: Addon type. + :vartype system_data: ~azure.mgmt.databoxedge.v2020_09_01.models.SystemData + :param subscription_id: Required. Arc resource subscription Id. + :type subscription_id: str + :param resource_group_name: Required. Arc resource group name. + :type resource_group_name: str + :param resource_name: Required. Arc resource Name. + :type resource_name: str + :param resource_location: Required. Arc resource location. + :type resource_location: str + :ivar version: Arc resource version. + :vartype version: str + :ivar host_platform: Host OS supported by the Arc addon. Possible values include: "Windows", + "Linux". + :vartype host_platform: str or ~azure.mgmt.databoxedge.v2020_09_01.models.PlatformType + :ivar host_platform_type: Platform where the runtime is hosted. Possible values include: + "KubernetesCluster", "LinuxVM". + :vartype host_platform_type: str or ~azure.mgmt.databoxedge.v2020_09_01.models.HostPlatformType + :ivar provisioning_state: Addon Provisioning State. Possible values include: "Invalid", + "Creating", "Created", "Updating", "Reconfiguring", "Failed", "Deleting". + :vartype provisioning_state: str or ~azure.mgmt.databoxedge.v2020_09_01.models.AddonState + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'kind': {'required': True}, + 'system_data': {'readonly': True}, + 'subscription_id': {'required': True}, + 'resource_group_name': {'required': True}, + 'resource_name': {'required': True}, + 'resource_location': {'required': True}, + 'version': {'readonly': True}, + 'host_platform': {'readonly': True}, + 'host_platform_type': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'subscription_id': {'key': 'properties.subscriptionId', 'type': 'str'}, + 'resource_group_name': {'key': 'properties.resourceGroupName', 'type': 'str'}, + 'resource_name': {'key': 'properties.resourceName', 'type': 'str'}, + 'resource_location': {'key': 'properties.resourceLocation', 'type': 'str'}, + 'version': {'key': 'properties.version', 'type': 'str'}, + 'host_platform': {'key': 'properties.hostPlatform', 'type': 'str'}, + 'host_platform_type': {'key': 'properties.hostPlatformType', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + } + + def __init__( + self, + *, + subscription_id: str, + resource_group_name: str, + resource_name: str, + resource_location: str, + **kwargs + ): + super(ArcAddon, self).__init__(**kwargs) + self.kind = 'ArcForKubernetes' # type: str + self.subscription_id = subscription_id + self.resource_group_name = resource_group_name + self.resource_name = resource_name + self.resource_location = resource_location + self.version = None + self.host_platform = None + self.host_platform_type = None + self.provisioning_state = None + + +class AsymmetricEncryptedSecret(msrest.serialization.Model): + """Represent the secrets intended for encryption with asymmetric key pair. + + All required parameters must be populated in order to send to Azure. + + :param value: Required. The value of the secret. + :type value: str + :param encryption_cert_thumbprint: Thumbprint certificate used to encrypt \"Value\". If the + value is unencrypted, it will be null. + :type encryption_cert_thumbprint: str + :param encryption_algorithm: Required. The algorithm used to encrypt "Value". Possible values + include: "None", "AES256", "RSAES_PKCS1_v_1_5". + :type encryption_algorithm: str or + ~azure.mgmt.databoxedge.v2020_09_01.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: ~azure.mgmt.databoxedge.v2020_09_01.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 ~azure.mgmt.databoxedge.v2020_09_01.models.AzureContainerDataFormat + """ + + _validation = { + 'storage_account_credential_id': {'required': True}, + 'container_name': {'required': True}, + 'data_format': {'required': True}, + } + + _attribute_map = { + 'storage_account_credential_id': {'key': 'storageAccountCredentialId', 'type': 'str'}, + 'container_name': {'key': 'containerName', 'type': 'str'}, + 'data_format': {'key': 'dataFormat', 'type': 'str'}, + } + + def __init__( + self, + *, + storage_account_credential_id: str, + container_name: str, + data_format: Union[str, "AzureContainerDataFormat"], + **kwargs + ): + super(AzureContainerInfo, self).__init__(**kwargs) + self.storage_account_credential_id = storage_account_credential_id + self.container_name = container_name + self.data_format = data_format + + +class BandwidthSchedule(ARMBaseModel): + """The bandwidth schedule details. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: The path ID that uniquely identifies the object. + :vartype id: str + :ivar name: The object name. + :vartype name: str + :ivar type: The hierarchical type of the object. + :vartype type: str + :ivar system_data: Bandwidth object related to ASE resource. + :vartype system_data: ~azure.mgmt.databoxedge.v2020_09_01.models.SystemData + :param start: Required. The start time of the schedule in UTC. + :type start: str + :param stop: Required. The stop time of the schedule in UTC. + :type stop: str + :param rate_in_mbps: Required. The bandwidth rate in Mbps. + :type rate_in_mbps: int + :param days: Required. The days of the week when this schedule is applicable. + :type days: list[str or ~azure.mgmt.databoxedge.v2020_09_01.models.DayOfWeek] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'system_data': {'readonly': True}, + 'start': {'required': True}, + 'stop': {'required': True}, + 'rate_in_mbps': {'required': True}, + 'days': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'start': {'key': 'properties.start', 'type': 'str'}, + 'stop': {'key': 'properties.stop', 'type': 'str'}, + 'rate_in_mbps': {'key': 'properties.rateInMbps', 'type': 'int'}, + 'days': {'key': 'properties.days', 'type': '[str]'}, + } + + def __init__( + self, + *, + start: str, + stop: str, + rate_in_mbps: int, + days: List[Union[str, "DayOfWeek"]], + **kwargs + ): + super(BandwidthSchedule, self).__init__(**kwargs) + self.system_data = None + self.start = start + self.stop = stop + self.rate_in_mbps = rate_in_mbps + self.days = days + + +class BandwidthSchedulesList(msrest.serialization.Model): + """The collection of bandwidth schedules. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar value: The list of bandwidth schedules. + :vartype value: list[~azure.mgmt.databoxedge.v2020_09_01.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 ~azure.mgmt.databoxedge.v2020_09_01.models.ClientPermissionType + """ + + _validation = { + 'client': {'required': True}, + 'access_permission': {'required': True}, + } + + _attribute_map = { + 'client': {'key': 'client', 'type': 'str'}, + 'access_permission': {'key': 'accessPermission', 'type': 'str'}, + } + + def __init__( + self, + *, + client: str, + access_permission: Union[str, "ClientPermissionType"], + **kwargs + ): + super(ClientAccessRight, self).__init__(**kwargs) + self.client = client + self.access_permission = access_permission + + +class Role(ARMBaseModel): + """Compute role. + + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: CloudEdgeManagementRole, IoTRole, KubernetesRole, MECRole. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: The path ID that uniquely identifies the object. + :vartype id: str + :ivar name: The object name. + :vartype name: str + :ivar type: The hierarchical type of the object. + :vartype type: str + :param kind: Required. Role type.Constant filled by server. Possible values include: "IOT", + "ASA", "Functions", "Cognitive", "MEC", "CloudEdgeManagement", "Kubernetes". + :type kind: str or ~azure.mgmt.databoxedge.v2020_09_01.models.RoleTypes + :ivar system_data: Role configured on ASE resource. + :vartype system_data: ~azure.mgmt.databoxedge.v2020_09_01.models.SystemData + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'kind': {'required': True}, + 'system_data': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + } + + _subtype_map = { + 'kind': {'CloudEdgeManagement': 'CloudEdgeManagementRole', 'IOT': 'IoTRole', 'Kubernetes': 'KubernetesRole', 'MEC': 'MECRole'} + } + + def __init__( + self, + **kwargs + ): + super(Role, self).__init__(**kwargs) + self.kind = 'Role' # type: str + self.system_data = None + + +class CloudEdgeManagementRole(Role): + """CloudEdgeManagementRole role. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: The path ID that uniquely identifies the object. + :vartype id: str + :ivar name: The object name. + :vartype name: str + :ivar type: The hierarchical type of the object. + :vartype type: str + :param kind: Required. Role type.Constant filled by server. Possible values include: "IOT", + "ASA", "Functions", "Cognitive", "MEC", "CloudEdgeManagement", "Kubernetes". + :type kind: str or ~azure.mgmt.databoxedge.v2020_09_01.models.RoleTypes + :ivar system_data: Role configured on ASE resource. + :vartype system_data: ~azure.mgmt.databoxedge.v2020_09_01.models.SystemData + :ivar local_management_status: Local Edge Management Status. Possible values include: + "Enabled", "Disabled". + :vartype local_management_status: str or ~azure.mgmt.databoxedge.v2020_09_01.models.RoleStatus + :ivar edge_profile: Edge Profile of the resource. + :vartype edge_profile: ~azure.mgmt.databoxedge.v2020_09_01.models.EdgeProfile + :param role_status: Role status. Possible values include: "Enabled", "Disabled". + :type role_status: str or ~azure.mgmt.databoxedge.v2020_09_01.models.RoleStatus + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'kind': {'required': True}, + 'system_data': {'readonly': True}, + 'local_management_status': {'readonly': True}, + 'edge_profile': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'local_management_status': {'key': 'properties.localManagementStatus', 'type': 'str'}, + 'edge_profile': {'key': 'properties.edgeProfile', 'type': 'EdgeProfile'}, + 'role_status': {'key': 'properties.roleStatus', 'type': 'str'}, + } + + def __init__( + self, + *, + role_status: Optional[Union[str, "RoleStatus"]] = None, + **kwargs + ): + super(CloudEdgeManagementRole, self).__init__(**kwargs) + self.kind = 'CloudEdgeManagement' # type: str + self.local_management_status = None + self.edge_profile = None + self.role_status = role_status + + +class CloudErrorBody(msrest.serialization.Model): + """An error response from the service. + + :param code: An identifier for the error. Codes are invariant and are intended to be consumed + programmatically. + :type code: str + :param message: A message describing the error, intended to be suitable for display in a user + interface. + :type message: str + :param details: A list of additional details about the error. + :type details: list[~azure.mgmt.databoxedge.v2020_09_01.models.CloudErrorBody] + """ + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + 'details': {'key': 'details', 'type': '[CloudErrorBody]'}, + } + + def __init__( + self, + *, + code: Optional[str] = None, + message: Optional[str] = None, + details: Optional[List["CloudErrorBody"]] = None, + **kwargs + ): + super(CloudErrorBody, self).__init__(**kwargs) + self.code = code + self.message = message + self.details = details + + +class CniConfig(msrest.serialization.Model): + """Cni configuration. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar type: Cni type. + :vartype type: str + :ivar version: Cni version. + :vartype version: str + :ivar pod_subnet: Pod Subnet. + :vartype pod_subnet: str + :ivar service_subnet: Service subnet. + :vartype service_subnet: str + """ + + _validation = { + 'type': {'readonly': True}, + 'version': {'readonly': True}, + 'pod_subnet': {'readonly': True}, + 'service_subnet': {'readonly': True}, + } + + _attribute_map = { + 'type': {'key': 'type', 'type': 'str'}, + 'version': {'key': 'version', 'type': 'str'}, + 'pod_subnet': {'key': 'podSubnet', 'type': 'str'}, + 'service_subnet': {'key': 'serviceSubnet', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(CniConfig, self).__init__(**kwargs) + self.type = None + self.version = None + self.pod_subnet = None + self.service_subnet = None + + +class ComputeResource(msrest.serialization.Model): + """Compute infrastructure Resource. + + All required parameters must be populated in order to send to Azure. + + :param processor_count: Required. Processor count. + :type processor_count: int + :param memory_in_gb: Required. Memory in GB. + :type memory_in_gb: long + """ + + _validation = { + 'processor_count': {'required': True}, + 'memory_in_gb': {'required': True}, + } + + _attribute_map = { + 'processor_count': {'key': 'processorCount', 'type': 'int'}, + 'memory_in_gb': {'key': 'memoryInGB', 'type': 'long'}, + } + + def __init__( + self, + *, + processor_count: int, + memory_in_gb: int, + **kwargs + ): + super(ComputeResource, self).__init__(**kwargs) + self.processor_count = processor_count + self.memory_in_gb = memory_in_gb + + +class ContactDetails(msrest.serialization.Model): + """Contains all the contact details of the customer. + + All required parameters must be populated in order to send to Azure. + + :param contact_person: Required. The contact person name. + :type contact_person: str + :param company_name: Required. The name of the company. + :type company_name: str + :param phone: Required. The phone number. + :type phone: str + :param email_list: Required. The email list. + :type email_list: list[str] + """ + + _validation = { + 'contact_person': {'required': True}, + 'company_name': {'required': True}, + 'phone': {'required': True}, + 'email_list': {'required': True}, + } + + _attribute_map = { + 'contact_person': {'key': 'contactPerson', 'type': 'str'}, + 'company_name': {'key': 'companyName', 'type': 'str'}, + 'phone': {'key': 'phone', 'type': 'str'}, + 'email_list': {'key': 'emailList', 'type': '[str]'}, + } + + def __init__( + self, + *, + contact_person: str, + company_name: str, + phone: str, + email_list: List[str], + **kwargs + ): + super(ContactDetails, self).__init__(**kwargs) + self.contact_person = contact_person + self.company_name = company_name + self.phone = phone + self.email_list = email_list + + +class Container(ARMBaseModel): + """Represents a container on the Data Box Edge/Gateway device. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: The path ID that uniquely identifies the object. + :vartype id: str + :ivar name: The object name. + :vartype name: str + :ivar type: The hierarchical type of the object. + :vartype type: str + :ivar system_data: Container in DataBoxEdge Resource. + :vartype system_data: ~azure.mgmt.databoxedge.v2020_09_01.models.SystemData + :ivar container_status: Current status of the container. Possible values include: "OK", + "Offline", "Unknown", "Updating", "NeedsAttention". + :vartype container_status: str or ~azure.mgmt.databoxedge.v2020_09_01.models.ContainerStatus + :param data_format: Required. DataFormat for Container. Possible values include: "BlockBlob", + "PageBlob", "AzureFile". + :type data_format: str or ~azure.mgmt.databoxedge.v2020_09_01.models.AzureContainerDataFormat + :ivar refresh_details: Details of the refresh job on this container. + :vartype refresh_details: ~azure.mgmt.databoxedge.v2020_09_01.models.RefreshDetails + :ivar created_date_time: The UTC time when container got created. + :vartype created_date_time: ~datetime.datetime + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'system_data': {'readonly': True}, + 'container_status': {'readonly': True}, + 'data_format': {'required': True}, + 'refresh_details': {'readonly': True}, + 'created_date_time': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'container_status': {'key': 'properties.containerStatus', 'type': 'str'}, + 'data_format': {'key': 'properties.dataFormat', 'type': 'str'}, + 'refresh_details': {'key': 'properties.refreshDetails', 'type': 'RefreshDetails'}, + 'created_date_time': {'key': 'properties.createdDateTime', 'type': 'iso-8601'}, + } + + def __init__( + self, + *, + data_format: Union[str, "AzureContainerDataFormat"], + **kwargs + ): + super(Container, self).__init__(**kwargs) + self.system_data = None + self.container_status = None + self.data_format = data_format + self.refresh_details = None + self.created_date_time = None + + +class ContainerList(msrest.serialization.Model): + """Collection of all the containers on the Data Box Edge/Gateway device. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar value: The list of containers. + :vartype value: list[~azure.mgmt.databoxedge.v2020_09_01.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: ~azure.mgmt.databoxedge.v2020_09_01.models.Sku + :param etag: The etag for the devices. + :type etag: str + :param identity: Msi identity of the resource. + :type identity: ~azure.mgmt.databoxedge.v2020_09_01.models.ResourceIdentity + :ivar kind: The etag for the devices. Possible values include: "AzureDataBoxGateway", + "AzureStackEdge", "AzureStackHub", "AzureModularDataCentre". + :vartype kind: str or ~azure.mgmt.databoxedge.v2020_09_01.models.DataBoxEdgeDeviceKind + :ivar system_data: DataBoxEdge Resource. + :vartype system_data: ~azure.mgmt.databoxedge.v2020_09_01.models.SystemData + :param data_box_edge_device_status: The status of the Data Box Edge/Gateway device. Possible + values include: "ReadyToSetup", "Online", "Offline", "NeedsAttention", "Disconnected", + "PartiallyDisconnected", "Maintenance". + :type data_box_edge_device_status: str or + ~azure.mgmt.databoxedge.v2020_09_01.models.DataBoxEdgeDeviceStatus + :ivar serial_number: The Serial Number of Data Box Edge/Gateway device. + :vartype serial_number: str + :ivar description: The Description of the Data Box Edge/Gateway device. + :vartype description: str + :ivar model_description: The description of the Data Box Edge/Gateway device model. + :vartype model_description: str + :ivar device_type: The type of the Data Box Edge/Gateway device. Possible values include: + "DataBoxEdgeDevice". + :vartype device_type: str or ~azure.mgmt.databoxedge.v2020_09_01.models.DeviceType + :ivar friendly_name: The Data Box Edge/Gateway device name. + :vartype friendly_name: str + :ivar culture: The Data Box Edge/Gateway device culture. + :vartype culture: str + :ivar device_model: The Data Box Edge/Gateway device model. + :vartype device_model: str + :ivar device_software_version: The Data Box Edge/Gateway device software version. + :vartype device_software_version: str + :ivar device_local_capacity: The Data Box Edge/Gateway device local capacity in MB. + :vartype device_local_capacity: long + :ivar time_zone: The Data Box Edge/Gateway device timezone. + :vartype time_zone: str + :ivar device_hcs_version: The device software version number of the device (eg: 1.2.18105.6). + :vartype device_hcs_version: str + :ivar configured_role_types: Type of compute roles configured. + :vartype configured_role_types: list[str or + ~azure.mgmt.databoxedge.v2020_09_01.models.RoleTypes] + :ivar node_count: The number of nodes in the cluster. + :vartype node_count: int + :ivar resource_move_details: The details of the move operation on this resource. + :vartype resource_move_details: ~azure.mgmt.databoxedge.v2020_09_01.models.ResourceMoveDetails + :ivar edge_profile: The details of Edge Profile for this resource. + :vartype edge_profile: ~azure.mgmt.databoxedge.v2020_09_01.models.EdgeProfile + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': True}, + 'kind': {'readonly': True}, + 'system_data': {'readonly': True}, + 'serial_number': {'readonly': True}, + 'description': {'readonly': True}, + 'model_description': {'readonly': True}, + 'device_type': {'readonly': True}, + 'friendly_name': {'readonly': True}, + 'culture': {'readonly': True}, + 'device_model': {'readonly': True}, + 'device_software_version': {'readonly': True}, + 'device_local_capacity': {'readonly': True}, + 'time_zone': {'readonly': True}, + 'device_hcs_version': {'readonly': True}, + 'configured_role_types': {'readonly': True}, + 'node_count': {'readonly': True}, + 'resource_move_details': {'readonly': True}, + 'edge_profile': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'sku': {'key': 'sku', 'type': 'Sku'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'identity': {'key': 'identity', 'type': 'ResourceIdentity'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'data_box_edge_device_status': {'key': 'properties.dataBoxEdgeDeviceStatus', 'type': 'str'}, + 'serial_number': {'key': 'properties.serialNumber', 'type': 'str'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + 'model_description': {'key': 'properties.modelDescription', 'type': 'str'}, + 'device_type': {'key': 'properties.deviceType', 'type': 'str'}, + 'friendly_name': {'key': 'properties.friendlyName', 'type': 'str'}, + 'culture': {'key': 'properties.culture', 'type': 'str'}, + 'device_model': {'key': 'properties.deviceModel', 'type': 'str'}, + 'device_software_version': {'key': 'properties.deviceSoftwareVersion', 'type': 'str'}, + 'device_local_capacity': {'key': 'properties.deviceLocalCapacity', 'type': 'long'}, + 'time_zone': {'key': 'properties.timeZone', 'type': 'str'}, + 'device_hcs_version': {'key': 'properties.deviceHcsVersion', 'type': 'str'}, + 'configured_role_types': {'key': 'properties.configuredRoleTypes', 'type': '[str]'}, + 'node_count': {'key': 'properties.nodeCount', 'type': 'int'}, + 'resource_move_details': {'key': 'properties.resourceMoveDetails', 'type': 'ResourceMoveDetails'}, + 'edge_profile': {'key': 'properties.edgeProfile', 'type': 'EdgeProfile'}, + } + + def __init__( + self, + *, + location: str, + tags: Optional[Dict[str, str]] = None, + sku: Optional["Sku"] = None, + etag: Optional[str] = None, + identity: Optional["ResourceIdentity"] = None, + data_box_edge_device_status: Optional[Union[str, "DataBoxEdgeDeviceStatus"]] = None, + **kwargs + ): + super(DataBoxEdgeDevice, self).__init__(**kwargs) + self.location = location + self.tags = tags + self.sku = sku + self.etag = etag + self.identity = identity + self.kind = None + self.system_data = None + self.data_box_edge_device_status = data_box_edge_device_status + self.serial_number = None + self.description = None + self.model_description = None + self.device_type = None + self.friendly_name = None + self.culture = None + self.device_model = None + self.device_software_version = None + self.device_local_capacity = None + self.time_zone = None + self.device_hcs_version = None + self.configured_role_types = None + self.node_count = None + self.resource_move_details = None + self.edge_profile = None + + +class DataBoxEdgeDeviceExtendedInfo(ARMBaseModel): + """The extended Info of the Data Box Edge/Gateway device. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: The path ID that uniquely identifies the object. + :vartype id: str + :ivar name: The object name. + :vartype name: str + :ivar type: The hierarchical type of the object. + :vartype type: str + :param encryption_key_thumbprint: The digital signature of encrypted certificate. + :type encryption_key_thumbprint: str + :param encryption_key: The public part of the encryption certificate. Client uses this to + encrypt any secret. + :type encryption_key: str + :ivar resource_key: The Resource ID of the Resource. + :vartype resource_key: str + :param client_secret_store_id: The Key Vault ARM Id for client secrets. + :type client_secret_store_id: str + :param client_secret_store_url: The url to access the Client Key Vault. + :type client_secret_store_url: str + :param channel_integrity_key_name: The name of Channel Integrity Key stored in the Client Key + Vault. + :type channel_integrity_key_name: str + :param channel_integrity_key_version: The version of Channel Integrity Key stored in the Client + Key Vault. + :type channel_integrity_key_version: str + """ + + _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'}, + 'client_secret_store_id': {'key': 'properties.clientSecretStoreId', 'type': 'str'}, + 'client_secret_store_url': {'key': 'properties.clientSecretStoreUrl', 'type': 'str'}, + 'channel_integrity_key_name': {'key': 'properties.channelIntegrityKeyName', 'type': 'str'}, + 'channel_integrity_key_version': {'key': 'properties.channelIntegrityKeyVersion', 'type': 'str'}, + } + + def __init__( + self, + *, + encryption_key_thumbprint: Optional[str] = None, + encryption_key: Optional[str] = None, + client_secret_store_id: Optional[str] = None, + client_secret_store_url: Optional[str] = None, + channel_integrity_key_name: Optional[str] = None, + channel_integrity_key_version: Optional[str] = None, + **kwargs + ): + super(DataBoxEdgeDeviceExtendedInfo, self).__init__(**kwargs) + self.encryption_key_thumbprint = encryption_key_thumbprint + self.encryption_key = encryption_key + self.resource_key = None + self.client_secret_store_id = client_secret_store_id + self.client_secret_store_url = client_secret_store_url + self.channel_integrity_key_name = channel_integrity_key_name + self.channel_integrity_key_version = channel_integrity_key_version + + +class DataBoxEdgeDeviceExtendedInfoPatch(msrest.serialization.Model): + """The Data Box Edge/Gateway device extended info patch. + + :param client_secret_store_id: The Key Vault ARM Id for client secrets. + :type client_secret_store_id: str + :param client_secret_store_url: The url to access the Client Key Vault. + :type client_secret_store_url: str + :param channel_integrity_key_name: The name for Channel Integrity Key stored in the Client Key + Vault. + :type channel_integrity_key_name: str + :param channel_integrity_key_version: The version of Channel Integrity Key stored in the Client + Key Vault. + :type channel_integrity_key_version: str + """ + + _attribute_map = { + 'client_secret_store_id': {'key': 'clientSecretStoreId', 'type': 'str'}, + 'client_secret_store_url': {'key': 'clientSecretStoreUrl', 'type': 'str'}, + 'channel_integrity_key_name': {'key': 'channelIntegrityKeyName', 'type': 'str'}, + 'channel_integrity_key_version': {'key': 'channelIntegrityKeyVersion', 'type': 'str'}, + } + + def __init__( + self, + *, + client_secret_store_id: Optional[str] = None, + client_secret_store_url: Optional[str] = None, + channel_integrity_key_name: Optional[str] = None, + channel_integrity_key_version: Optional[str] = None, + **kwargs + ): + super(DataBoxEdgeDeviceExtendedInfoPatch, self).__init__(**kwargs) + self.client_secret_store_id = client_secret_store_id + self.client_secret_store_url = client_secret_store_url + self.channel_integrity_key_name = channel_integrity_key_name + self.channel_integrity_key_version = channel_integrity_key_version + + +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[~azure.mgmt.databoxedge.v2020_09_01.models.DataBoxEdgeDevice] + :ivar next_link: Link to the next set of results. + :vartype next_link: str + """ + + _validation = { + 'value': {'readonly': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[DataBoxEdgeDevice]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(DataBoxEdgeDeviceList, self).__init__(**kwargs) + self.value = None + self.next_link = None + + +class DataBoxEdgeDevicePatch(msrest.serialization.Model): + """The Data Box Edge/Gateway device patch. + + :param tags: A set of tags. The tags attached to the Data Box Edge/Gateway resource. + :type tags: dict[str, str] + :param identity: Msi identity of the resource. + :type identity: ~azure.mgmt.databoxedge.v2020_09_01.models.ResourceIdentity + :param edge_profile: Edge Profile property of the Data Box Edge/Gateway device. + :type edge_profile: ~azure.mgmt.databoxedge.v2020_09_01.models.EdgeProfilePatch + """ + + _attribute_map = { + 'tags': {'key': 'tags', 'type': '{str}'}, + 'identity': {'key': 'identity', 'type': 'ResourceIdentity'}, + 'edge_profile': {'key': 'properties.edgeProfile', 'type': 'EdgeProfilePatch'}, + } + + def __init__( + self, + *, + tags: Optional[Dict[str, str]] = None, + identity: Optional["ResourceIdentity"] = None, + edge_profile: Optional["EdgeProfilePatch"] = None, + **kwargs + ): + super(DataBoxEdgeDevicePatch, self).__init__(**kwargs) + self.tags = tags + self.identity = identity + self.edge_profile = edge_profile + + +class DataBoxEdgeMoveRequest(msrest.serialization.Model): + """Resource Move details. + + All required parameters must be populated in order to send to Azure. + + :param target_resource_group: Required. Target resource group ARMId. + :type target_resource_group: str + :param resources: Required. List of resources to be moved. + :type resources: list[str] + """ + + _validation = { + 'target_resource_group': {'required': True}, + 'resources': {'required': True}, + } + + _attribute_map = { + 'target_resource_group': {'key': 'targetResourceGroup', 'type': 'str'}, + 'resources': {'key': 'resources', 'type': '[str]'}, + } + + def __init__( + self, + *, + target_resource_group: str, + resources: List[str], + **kwargs + ): + super(DataBoxEdgeMoveRequest, self).__init__(**kwargs) + self.target_resource_group = target_resource_group + self.resources = resources + + +class DataBoxEdgeSku(msrest.serialization.Model): + """The Sku information. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar resource_type: The type of the resource. + :vartype resource_type: str + :ivar name: The Sku name. Possible values include: "Gateway", "Edge", "TEA_1Node", + "TEA_1Node_UPS", "TEA_1Node_Heater", "TEA_1Node_UPS_Heater", "TEA_4Node_Heater", + "TEA_4Node_UPS_Heater", "TMA", "TDC", "TCA_Small", "GPU", "TCA_Large", "EdgeP_Base", + "EdgeP_High", "EdgePR_Base", "EdgePR_Base_UPS", "EdgeMR_Mini", "RCA_Small", "RCA_Large", "RDC". + :vartype name: str or ~azure.mgmt.databoxedge.v2020_09_01.models.SkuName + :ivar kind: The Sku kind. + :vartype kind: str + :ivar tier: The Sku tier. Possible values include: "Standard". + :vartype tier: str or ~azure.mgmt.databoxedge.v2020_09_01.models.SkuTier + :ivar size: The Sku kind. + :vartype size: str + :ivar family: The Sku family. + :vartype family: str + :ivar locations: Availability of the Sku for the region. + :vartype locations: list[str] + :ivar api_versions: The API versions in which Sku is available. + :vartype api_versions: list[str] + :ivar location_info: Availability of the Sku for the location/zone/site. + :vartype location_info: list[~azure.mgmt.databoxedge.v2020_09_01.models.SkuLocationInfo] + :ivar costs: The pricing info of the Sku. + :vartype costs: list[~azure.mgmt.databoxedge.v2020_09_01.models.SkuCost] + :ivar signup_option: Sku can be signed up by customer or not. Possible values include: "None", + "Available". + :vartype signup_option: str or ~azure.mgmt.databoxedge.v2020_09_01.models.SkuSignupOption + :ivar version: Availability of the Sku as preview/stable. Possible values include: "Stable", + "Preview". + :vartype version: str or ~azure.mgmt.databoxedge.v2020_09_01.models.SkuVersion + :ivar availability: Links to the next set of results. Possible values include: "Available", + "Unavailable". + :vartype availability: str or ~azure.mgmt.databoxedge.v2020_09_01.models.SkuAvailability + :ivar shipment_types: List of Shipment Types supported by this SKU. + :vartype shipment_types: list[str or ~azure.mgmt.databoxedge.v2020_09_01.models.ShipmentType] + """ + + _validation = { + 'resource_type': {'readonly': True}, + 'name': {'readonly': True}, + 'kind': {'readonly': True}, + 'tier': {'readonly': True}, + 'size': {'readonly': True}, + 'family': {'readonly': True}, + 'locations': {'readonly': True}, + 'api_versions': {'readonly': True}, + 'location_info': {'readonly': True}, + 'costs': {'readonly': True}, + 'signup_option': {'readonly': True}, + 'version': {'readonly': True}, + 'availability': {'readonly': True}, + 'shipment_types': {'readonly': True}, + } + + _attribute_map = { + 'resource_type': {'key': 'resourceType', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'tier': {'key': 'tier', 'type': 'str'}, + 'size': {'key': 'size', 'type': 'str'}, + 'family': {'key': 'family', 'type': 'str'}, + 'locations': {'key': 'locations', 'type': '[str]'}, + 'api_versions': {'key': 'apiVersions', 'type': '[str]'}, + 'location_info': {'key': 'locationInfo', 'type': '[SkuLocationInfo]'}, + 'costs': {'key': 'costs', 'type': '[SkuCost]'}, + 'signup_option': {'key': 'signupOption', 'type': 'str'}, + 'version': {'key': 'version', 'type': 'str'}, + 'availability': {'key': 'availability', 'type': 'str'}, + 'shipment_types': {'key': 'shipmentTypes', 'type': '[str]'}, + } + + def __init__( + self, + **kwargs + ): + super(DataBoxEdgeSku, self).__init__(**kwargs) + self.resource_type = None + self.name = None + self.kind = None + self.tier = None + self.size = None + self.family = None + self.locations = None + self.api_versions = None + self.location_info = None + self.costs = None + self.signup_option = None + self.version = None + self.availability = None + self.shipment_types = None + + +class DataBoxEdgeSkuList(msrest.serialization.Model): + """List of SKU Information objects. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar value: List of ResourceType Sku. + :vartype value: list[~azure.mgmt.databoxedge.v2020_09_01.models.DataBoxEdgeSku] + :ivar next_link: Links to the next set of results. + :vartype next_link: str + """ + + _validation = { + 'value': {'readonly': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[DataBoxEdgeSku]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(DataBoxEdgeSkuList, self).__init__(**kwargs) + self.value = None + self.next_link = None + + +class DCAccessCode(msrest.serialization.Model): + """DC Access code in the case of Self Managed Shipping. + + :param auth_code: DCAccess Code for the Self Managed shipment. + :type auth_code: str + """ + + _attribute_map = { + 'auth_code': {'key': 'properties.authCode', 'type': 'str'}, + } + + def __init__( + self, + *, + auth_code: Optional[str] = None, + **kwargs + ): + super(DCAccessCode, self).__init__(**kwargs) + self.auth_code = auth_code + + +class EdgeProfile(msrest.serialization.Model): + """Details about Edge Profile for the resource. + + :param subscription: Edge Profile Subscription. + :type subscription: ~azure.mgmt.databoxedge.v2020_09_01.models.EdgeProfileSubscription + """ + + _attribute_map = { + 'subscription': {'key': 'subscription', 'type': 'EdgeProfileSubscription'}, + } + + def __init__( + self, + *, + subscription: Optional["EdgeProfileSubscription"] = None, + **kwargs + ): + super(EdgeProfile, self).__init__(**kwargs) + self.subscription = subscription + + +class EdgeProfilePatch(msrest.serialization.Model): + """The Data Box Edge/Gateway Edge Profile patch. + + :param subscription: The Data Box Edge/Gateway Edge Profile Subscription patch. + :type subscription: ~azure.mgmt.databoxedge.v2020_09_01.models.EdgeProfileSubscriptionPatch + """ + + _attribute_map = { + 'subscription': {'key': 'subscription', 'type': 'EdgeProfileSubscriptionPatch'}, + } + + def __init__( + self, + *, + subscription: Optional["EdgeProfileSubscriptionPatch"] = None, + **kwargs + ): + super(EdgeProfilePatch, self).__init__(**kwargs) + self.subscription = subscription + + +class EdgeProfileSubscription(msrest.serialization.Model): + """Subscription details for the Edge Profile. + + :param registration_id: Edge Subscription Registration ID. + :type registration_id: str + :param id: ARM ID of the subscription. + :type id: str + :param state: Possible values include: "Registered", "Warned", "Suspended", "Deleted", + "Unregistered". + :type state: str or ~azure.mgmt.databoxedge.v2020_09_01.models.SubscriptionState + :param registration_date: + :type registration_date: str + :param subscription_id: + :type subscription_id: str + :param tenant_id: + :type tenant_id: str + :param location_placement_id: + :type location_placement_id: str + :param quota_id: + :type quota_id: str + :param serialized_details: + :type serialized_details: str + :param registered_features: + :type registered_features: + list[~azure.mgmt.databoxedge.v2020_09_01.models.SubscriptionRegisteredFeatures] + """ + + _attribute_map = { + 'registration_id': {'key': 'registrationId', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + 'state': {'key': 'state', 'type': 'str'}, + 'registration_date': {'key': 'registrationDate', 'type': 'str'}, + 'subscription_id': {'key': 'subscriptionId', 'type': 'str'}, + 'tenant_id': {'key': 'properties.tenantId', 'type': 'str'}, + 'location_placement_id': {'key': 'properties.locationPlacementId', 'type': 'str'}, + 'quota_id': {'key': 'properties.quotaId', 'type': 'str'}, + 'serialized_details': {'key': 'properties.serializedDetails', 'type': 'str'}, + 'registered_features': {'key': 'properties.registeredFeatures', 'type': '[SubscriptionRegisteredFeatures]'}, + } + + def __init__( + self, + *, + registration_id: Optional[str] = None, + id: Optional[str] = None, + state: Optional[Union[str, "SubscriptionState"]] = None, + registration_date: Optional[str] = None, + subscription_id: Optional[str] = None, + tenant_id: Optional[str] = None, + location_placement_id: Optional[str] = None, + quota_id: Optional[str] = None, + serialized_details: Optional[str] = None, + registered_features: Optional[List["SubscriptionRegisteredFeatures"]] = None, + **kwargs + ): + super(EdgeProfileSubscription, self).__init__(**kwargs) + self.registration_id = registration_id + self.id = id + self.state = state + self.registration_date = registration_date + self.subscription_id = subscription_id + self.tenant_id = tenant_id + self.location_placement_id = location_placement_id + self.quota_id = quota_id + self.serialized_details = serialized_details + self.registered_features = registered_features + + +class EdgeProfileSubscriptionPatch(msrest.serialization.Model): + """The Data Box Edge/Gateway Edge Profile Subscription patch. + + :param id: The path ID that uniquely identifies the subscription of the edge profile. + :type id: str + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + } + + def __init__( + self, + *, + id: Optional[str] = None, + **kwargs + ): + super(EdgeProfileSubscriptionPatch, self).__init__(**kwargs) + self.id = id + + +class EtcdInfo(msrest.serialization.Model): + """Etcd configuration. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar type: Etcd type. + :vartype type: str + :ivar version: Etcd version. + :vartype version: str + """ + + _validation = { + 'type': {'readonly': True}, + 'version': {'readonly': True}, + } + + _attribute_map = { + 'type': {'key': 'type', 'type': 'str'}, + 'version': {'key': 'version', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(EtcdInfo, self).__init__(**kwargs) + self.type = None + self.version = None + + +class Trigger(ARMBaseModel): + """Trigger details. + + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: FileEventTrigger, PeriodicTimerEventTrigger. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: The path ID that uniquely identifies the object. + :vartype id: str + :ivar name: The object name. + :vartype name: str + :ivar type: The hierarchical type of the object. + :vartype type: str + :ivar system_data: Trigger in DataBoxEdge Resource. + :vartype system_data: ~azure.mgmt.databoxedge.v2020_09_01.models.SystemData + :param kind: Required. Trigger Kind.Constant filled by server. Possible values include: + "FileEvent", "PeriodicTimerEvent". + :type kind: str or ~azure.mgmt.databoxedge.v2020_09_01.models.TriggerEventType + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'system_data': {'readonly': True}, + 'kind': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'kind': {'key': 'kind', 'type': 'str'}, + } + + _subtype_map = { + 'kind': {'FileEvent': 'FileEventTrigger', 'PeriodicTimerEvent': 'PeriodicTimerEventTrigger'} + } + + def __init__( + self, + **kwargs + ): + super(Trigger, self).__init__(**kwargs) + self.system_data = None + self.kind = 'Trigger' # type: str + + +class FileEventTrigger(Trigger): + """Trigger details. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: The path ID that uniquely identifies the object. + :vartype id: str + :ivar name: The object name. + :vartype name: str + :ivar type: The hierarchical type of the object. + :vartype type: str + :ivar system_data: Trigger in DataBoxEdge Resource. + :vartype system_data: ~azure.mgmt.databoxedge.v2020_09_01.models.SystemData + :param kind: Required. Trigger Kind.Constant filled by server. Possible values include: + "FileEvent", "PeriodicTimerEvent". + :type kind: str or ~azure.mgmt.databoxedge.v2020_09_01.models.TriggerEventType + :param source_info: Required. File event source details. + :type source_info: ~azure.mgmt.databoxedge.v2020_09_01.models.FileSourceInfo + :param sink_info: Required. Role sink info. + :type sink_info: ~azure.mgmt.databoxedge.v2020_09_01.models.RoleSinkInfo + :param custom_context_tag: A custom context tag typically used to correlate the trigger against + its usage. For example, if a periodic timer trigger is intended for certain specific IoT + modules in the device, the tag can be the name or the image URL of the module. + :type custom_context_tag: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'system_data': {'readonly': True}, + 'kind': {'required': True}, + 'source_info': {'required': True}, + 'sink_info': {'required': True}, + 'custom_context_tag': {'max_length': 192, 'min_length': 0}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'source_info': {'key': 'properties.sourceInfo', 'type': 'FileSourceInfo'}, + 'sink_info': {'key': 'properties.sinkInfo', 'type': 'RoleSinkInfo'}, + 'custom_context_tag': {'key': 'properties.customContextTag', 'type': 'str'}, + } + + def __init__( + self, + *, + source_info: "FileSourceInfo", + sink_info: "RoleSinkInfo", + custom_context_tag: Optional[str] = None, + **kwargs + ): + super(FileEventTrigger, self).__init__(**kwargs) + self.kind = 'FileEvent' # type: str + self.source_info = source_info + self.sink_info = sink_info + self.custom_context_tag = custom_context_tag + + +class FileSourceInfo(msrest.serialization.Model): + """File source details. + + All required parameters must be populated in order to send to Azure. + + :param share_id: Required. File share ID. + :type share_id: str + """ + + _validation = { + 'share_id': {'required': True}, + } + + _attribute_map = { + 'share_id': {'key': 'shareId', 'type': 'str'}, + } + + def __init__( + self, + *, + share_id: str, + **kwargs + ): + super(FileSourceInfo, self).__init__(**kwargs) + self.share_id = share_id + + +class GenerateCertResponse(msrest.serialization.Model): + """Used in activation key generation flow. + + :param public_key: Gets or sets base64 encoded certificate raw data, + this is the public part needed to be uploaded to cert vault. + :type public_key: str + :param private_key: Gets or sets base64 encoded private part of the certificate, + needed to form the activation key. + :type private_key: str + :param expiry_time_in_utc: Gets or sets expiry time in UTC. + :type expiry_time_in_utc: str + """ + + _attribute_map = { + 'public_key': {'key': 'publicKey', 'type': 'str'}, + 'private_key': {'key': 'privateKey', 'type': 'str'}, + 'expiry_time_in_utc': {'key': 'expiryTimeInUTC', 'type': 'str'}, + } + + def __init__( + self, + *, + public_key: Optional[str] = None, + private_key: Optional[str] = None, + expiry_time_in_utc: Optional[str] = None, + **kwargs + ): + super(GenerateCertResponse, self).__init__(**kwargs) + self.public_key = public_key + self.private_key = private_key + self.expiry_time_in_utc = expiry_time_in_utc + + +class ImageRepositoryCredential(msrest.serialization.Model): + """Image repository credential. + + All required parameters must be populated in order to send to Azure. + + :param image_repository_url: Required. Image repository url (e.g.: mcr.microsoft.com). + :type image_repository_url: str + :param user_name: Required. Repository user name. + :type user_name: str + :param password: Repository user password. + :type password: ~azure.mgmt.databoxedge.v2020_09_01.models.AsymmetricEncryptedSecret + """ + + _validation = { + 'image_repository_url': {'required': True}, + 'user_name': {'required': True}, + } + + _attribute_map = { + 'image_repository_url': {'key': 'imageRepositoryUrl', 'type': 'str'}, + 'user_name': {'key': 'userName', 'type': 'str'}, + 'password': {'key': 'password', 'type': 'AsymmetricEncryptedSecret'}, + } + + def __init__( + self, + *, + image_repository_url: str, + user_name: str, + password: Optional["AsymmetricEncryptedSecret"] = None, + **kwargs + ): + super(ImageRepositoryCredential, self).__init__(**kwargs) + self.image_repository_url = image_repository_url + self.user_name = user_name + self.password = password + + +class IoTAddon(Addon): + """IoT Addon. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: The path ID that uniquely identifies the object. + :vartype id: str + :ivar name: The object name. + :vartype name: str + :ivar type: The hierarchical type of the object. + :vartype type: str + :param kind: Required. Addon type.Constant filled by server. Possible values include: + "IotEdge", "ArcForKubernetes". + :type kind: str or ~azure.mgmt.databoxedge.v2020_09_01.models.AddonType + :ivar system_data: Addon type. + :vartype system_data: ~azure.mgmt.databoxedge.v2020_09_01.models.SystemData + :param io_t_device_details: Required. IoT device metadata to which appliance needs to be + connected. + :type io_t_device_details: ~azure.mgmt.databoxedge.v2020_09_01.models.IoTDeviceInfo + :param io_t_edge_device_details: Required. IoT edge device to which the IoT Addon needs to be + configured. + :type io_t_edge_device_details: ~azure.mgmt.databoxedge.v2020_09_01.models.IoTDeviceInfo + :ivar version: Version of IoT running on the appliance. + :vartype version: str + :ivar host_platform: Host OS supported by the IoT addon. Possible values include: "Windows", + "Linux". + :vartype host_platform: str or ~azure.mgmt.databoxedge.v2020_09_01.models.PlatformType + :ivar host_platform_type: Platform where the runtime is hosted. Possible values include: + "KubernetesCluster", "LinuxVM". + :vartype host_platform_type: str or ~azure.mgmt.databoxedge.v2020_09_01.models.HostPlatformType + :ivar provisioning_state: Addon Provisioning State. Possible values include: "Invalid", + "Creating", "Created", "Updating", "Reconfiguring", "Failed", "Deleting". + :vartype provisioning_state: str or ~azure.mgmt.databoxedge.v2020_09_01.models.AddonState + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'kind': {'required': True}, + 'system_data': {'readonly': True}, + 'io_t_device_details': {'required': True}, + 'io_t_edge_device_details': {'required': True}, + 'version': {'readonly': True}, + 'host_platform': {'readonly': True}, + 'host_platform_type': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'io_t_device_details': {'key': 'properties.ioTDeviceDetails', 'type': 'IoTDeviceInfo'}, + 'io_t_edge_device_details': {'key': 'properties.ioTEdgeDeviceDetails', 'type': 'IoTDeviceInfo'}, + 'version': {'key': 'properties.version', 'type': 'str'}, + 'host_platform': {'key': 'properties.hostPlatform', 'type': 'str'}, + 'host_platform_type': {'key': 'properties.hostPlatformType', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + } + + def __init__( + self, + *, + io_t_device_details: "IoTDeviceInfo", + io_t_edge_device_details: "IoTDeviceInfo", + **kwargs + ): + super(IoTAddon, self).__init__(**kwargs) + self.kind = 'IotEdge' # type: str + self.io_t_device_details = io_t_device_details + self.io_t_edge_device_details = io_t_edge_device_details + self.version = None + self.host_platform = None + self.host_platform_type = None + self.provisioning_state = None + + +class IoTDeviceInfo(msrest.serialization.Model): + """Metadata of IoT device/IoT Edge device to be configured. + + All required parameters must be populated in order to send to Azure. + + :param device_id: Required. ID of the IoT device/edge device. + :type device_id: str + :param io_t_host_hub: Required. Host name for the IoT hub associated to the device. + :type io_t_host_hub: str + :param io_t_host_hub_id: Id for the IoT hub associated to the device. + :type io_t_host_hub_id: str + :param authentication: Encrypted IoT device/IoT edge device connection string. + :type authentication: ~azure.mgmt.databoxedge.v2020_09_01.models.Authentication + """ + + _validation = { + 'device_id': {'required': True}, + 'io_t_host_hub': {'required': True}, + } + + _attribute_map = { + 'device_id': {'key': 'deviceId', 'type': 'str'}, + 'io_t_host_hub': {'key': 'ioTHostHub', 'type': 'str'}, + 'io_t_host_hub_id': {'key': 'ioTHostHubId', 'type': 'str'}, + 'authentication': {'key': 'authentication', 'type': 'Authentication'}, + } + + def __init__( + self, + *, + device_id: str, + io_t_host_hub: str, + io_t_host_hub_id: Optional[str] = None, + authentication: Optional["Authentication"] = None, + **kwargs + ): + super(IoTDeviceInfo, self).__init__(**kwargs) + self.device_id = device_id + self.io_t_host_hub = io_t_host_hub + self.io_t_host_hub_id = io_t_host_hub_id + self.authentication = authentication + + +class IoTEdgeAgentInfo(msrest.serialization.Model): + """IoT edge agent details is optional, this will be used for download system Agent module while bootstrapping IoT Role if specified. + + All required parameters must be populated in order to send to Azure. + + :param image_name: Required. Name of the IoT edge agent image. + :type image_name: str + :param tag: Required. Image Tag. + :type tag: str + :param image_repository: Image repository details. + :type image_repository: ~azure.mgmt.databoxedge.v2020_09_01.models.ImageRepositoryCredential + """ + + _validation = { + 'image_name': {'required': True}, + 'tag': {'required': True}, + } + + _attribute_map = { + 'image_name': {'key': 'imageName', 'type': 'str'}, + 'tag': {'key': 'tag', 'type': 'str'}, + 'image_repository': {'key': 'imageRepository', 'type': 'ImageRepositoryCredential'}, + } + + def __init__( + self, + *, + image_name: str, + tag: str, + image_repository: Optional["ImageRepositoryCredential"] = None, + **kwargs + ): + super(IoTEdgeAgentInfo, self).__init__(**kwargs) + self.image_name = image_name + self.tag = tag + self.image_repository = image_repository + + +class IoTRole(Role): + """Compute role. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: The path ID that uniquely identifies the object. + :vartype id: str + :ivar name: The object name. + :vartype name: str + :ivar type: The hierarchical type of the object. + :vartype type: str + :param kind: Required. Role type.Constant filled by server. Possible values include: "IOT", + "ASA", "Functions", "Cognitive", "MEC", "CloudEdgeManagement", "Kubernetes". + :type kind: str or ~azure.mgmt.databoxedge.v2020_09_01.models.RoleTypes + :ivar system_data: Role configured on ASE resource. + :vartype system_data: ~azure.mgmt.databoxedge.v2020_09_01.models.SystemData + :param host_platform: Host OS supported by the IoT role. Possible values include: "Windows", + "Linux". + :type host_platform: str or ~azure.mgmt.databoxedge.v2020_09_01.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: ~azure.mgmt.databoxedge.v2020_09_01.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: ~azure.mgmt.databoxedge.v2020_09_01.models.IoTDeviceInfo + :param share_mappings: Mount points of shares in role(s). + :type share_mappings: list[~azure.mgmt.databoxedge.v2020_09_01.models.MountPointMap] + :param io_t_edge_agent_info: Iot edge agent details to download the agent and bootstrap iot + runtime. + :type io_t_edge_agent_info: ~azure.mgmt.databoxedge.v2020_09_01.models.IoTEdgeAgentInfo + :ivar host_platform_type: Platform where the Iot runtime is hosted. Possible values include: + "KubernetesCluster", "LinuxVM". + :vartype host_platform_type: str or ~azure.mgmt.databoxedge.v2020_09_01.models.HostPlatformType + :param compute_resource: Resource allocation. + :type compute_resource: ~azure.mgmt.databoxedge.v2020_09_01.models.ComputeResource + :param role_status: Role status. Possible values include: "Enabled", "Disabled". + :type role_status: str or ~azure.mgmt.databoxedge.v2020_09_01.models.RoleStatus + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'kind': {'required': True}, + 'system_data': {'readonly': True}, + 'host_platform_type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'host_platform': {'key': 'properties.hostPlatform', 'type': 'str'}, + 'io_t_device_details': {'key': 'properties.ioTDeviceDetails', 'type': 'IoTDeviceInfo'}, + 'io_t_edge_device_details': {'key': 'properties.ioTEdgeDeviceDetails', 'type': 'IoTDeviceInfo'}, + 'share_mappings': {'key': 'properties.shareMappings', 'type': '[MountPointMap]'}, + 'io_t_edge_agent_info': {'key': 'properties.ioTEdgeAgentInfo', 'type': 'IoTEdgeAgentInfo'}, + 'host_platform_type': {'key': 'properties.hostPlatformType', 'type': 'str'}, + 'compute_resource': {'key': 'properties.computeResource', 'type': 'ComputeResource'}, + 'role_status': {'key': 'properties.roleStatus', 'type': 'str'}, + } + + def __init__( + self, + *, + host_platform: Optional[Union[str, "PlatformType"]] = None, + io_t_device_details: Optional["IoTDeviceInfo"] = None, + io_t_edge_device_details: Optional["IoTDeviceInfo"] = None, + share_mappings: Optional[List["MountPointMap"]] = None, + io_t_edge_agent_info: Optional["IoTEdgeAgentInfo"] = None, + compute_resource: Optional["ComputeResource"] = None, + role_status: Optional[Union[str, "RoleStatus"]] = None, + **kwargs + ): + super(IoTRole, self).__init__(**kwargs) + self.kind = 'IOT' # type: str + self.host_platform = host_platform + self.io_t_device_details = io_t_device_details + self.io_t_edge_device_details = io_t_edge_device_details + self.share_mappings = share_mappings + self.io_t_edge_agent_info = io_t_edge_agent_info + self.host_platform_type = None + self.compute_resource = compute_resource + self.role_status = role_status + + +class Ipv4Config(msrest.serialization.Model): + """Details related to the IPv4 address configuration. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar ip_address: The IPv4 address of the network adapter. + :vartype ip_address: str + :ivar subnet: The IPv4 subnet of the network adapter. + :vartype subnet: str + :ivar gateway: The IPv4 gateway of the network adapter. + :vartype gateway: str + """ + + _validation = { + 'ip_address': {'readonly': True}, + 'subnet': {'readonly': True}, + 'gateway': {'readonly': True}, + } + + _attribute_map = { + 'ip_address': {'key': 'ipAddress', 'type': 'str'}, + 'subnet': {'key': 'subnet', 'type': 'str'}, + 'gateway': {'key': 'gateway', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(Ipv4Config, self).__init__(**kwargs) + self.ip_address = None + self.subnet = None + self.gateway = None + + +class Ipv6Config(msrest.serialization.Model): + """Details related to the IPv6 address configuration. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar ip_address: The IPv6 address of the network adapter. + :vartype ip_address: str + :ivar prefix_length: The IPv6 prefix of the network adapter. + :vartype prefix_length: int + :ivar gateway: The IPv6 gateway of the network adapter. + :vartype gateway: str + """ + + _validation = { + 'ip_address': {'readonly': True}, + 'prefix_length': {'readonly': True}, + 'gateway': {'readonly': True}, + } + + _attribute_map = { + 'ip_address': {'key': 'ipAddress', 'type': 'str'}, + 'prefix_length': {'key': 'prefixLength', 'type': 'int'}, + 'gateway': {'key': 'gateway', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(Ipv6Config, self).__init__(**kwargs) + self.ip_address = None + self.prefix_length = None + self.gateway = None + + +class Job(msrest.serialization.Model): + """A device job. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: The path ID that uniquely identifies the object. + :vartype id: str + :ivar name: The name of the object. + :vartype name: str + :ivar type: The hierarchical type of the object. + :vartype type: str + :ivar status: The current status of the job. Possible values include: "Invalid", "Running", + "Succeeded", "Failed", "Canceled", "Paused", "Scheduled". + :vartype status: str or ~azure.mgmt.databoxedge.v2020_09_01.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: ~azure.mgmt.databoxedge.v2020_09_01.models.JobErrorDetails + :ivar job_type: The type of the job. Possible values include: "Invalid", "ScanForUpdates", + "DownloadUpdates", "InstallUpdates", "RefreshShare", "RefreshContainer", "Backup", "Restore", + "TriggerSupportPackage". + :vartype job_type: str or ~azure.mgmt.databoxedge.v2020_09_01.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 ~azure.mgmt.databoxedge.v2020_09_01.models.UpdateOperationStage + :ivar download_progress: The download progress. + :vartype download_progress: ~azure.mgmt.databoxedge.v2020_09_01.models.UpdateDownloadProgress + :ivar install_progress: The install progress. + :vartype install_progress: ~azure.mgmt.databoxedge.v2020_09_01.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[~azure.mgmt.databoxedge.v2020_09_01.models.JobErrorItem] + :ivar code: The code intended for programmatic access. + :vartype code: str + :ivar message: The message that describes the error in detail. + :vartype message: str + """ + + _validation = { + 'error_details': {'readonly': True}, + 'code': {'readonly': True}, + 'message': {'readonly': True}, + } + + _attribute_map = { + 'error_details': {'key': 'errorDetails', 'type': '[JobErrorItem]'}, + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(JobErrorDetails, self).__init__(**kwargs) + self.error_details = None + self.code = None + self.message = None + + +class JobErrorItem(msrest.serialization.Model): + """The job error items. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar recommendations: The recommended actions. + :vartype recommendations: list[str] + :ivar code: The code intended for programmatic access. + :vartype code: str + :ivar message: The message that describes the error in detail. + :vartype message: str + """ + + _validation = { + 'recommendations': {'readonly': True}, + 'code': {'readonly': True}, + 'message': {'readonly': True}, + } + + _attribute_map = { + 'recommendations': {'key': 'recommendations', 'type': '[str]'}, + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(JobErrorItem, self).__init__(**kwargs) + self.recommendations = None + self.code = None + self.message = None + + +class KubernetesClusterInfo(msrest.serialization.Model): + """Kubernetes cluster configuration. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar etcd_info: Etcd configuration. + :vartype etcd_info: ~azure.mgmt.databoxedge.v2020_09_01.models.EtcdInfo + :ivar nodes: Kubernetes cluster nodes. + :vartype nodes: list[~azure.mgmt.databoxedge.v2020_09_01.models.NodeInfo] + :param version: Required. Kubernetes cluster version. + :type version: str + """ + + _validation = { + 'etcd_info': {'readonly': True}, + 'nodes': {'readonly': True}, + 'version': {'required': True}, + } + + _attribute_map = { + 'etcd_info': {'key': 'etcdInfo', 'type': 'EtcdInfo'}, + 'nodes': {'key': 'nodes', 'type': '[NodeInfo]'}, + 'version': {'key': 'version', 'type': 'str'}, + } + + def __init__( + self, + *, + version: str, + **kwargs + ): + super(KubernetesClusterInfo, self).__init__(**kwargs) + self.etcd_info = None + self.nodes = None + self.version = version + + +class KubernetesIPConfiguration(msrest.serialization.Model): + """Kubernetes node IP configuration. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar port: Port of the Kubernetes node. + :vartype port: str + :param ip_address: IP address of the Kubernetes node. + :type ip_address: str + """ + + _validation = { + 'port': {'readonly': True}, + } + + _attribute_map = { + 'port': {'key': 'port', 'type': 'str'}, + 'ip_address': {'key': 'ipAddress', 'type': 'str'}, + } + + def __init__( + self, + *, + ip_address: Optional[str] = None, + **kwargs + ): + super(KubernetesIPConfiguration, self).__init__(**kwargs) + self.port = None + self.ip_address = ip_address + + +class KubernetesRole(Role): + """Kubernetes role. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: The path ID that uniquely identifies the object. + :vartype id: str + :ivar name: The object name. + :vartype name: str + :ivar type: The hierarchical type of the object. + :vartype type: str + :param kind: Required. Role type.Constant filled by server. Possible values include: "IOT", + "ASA", "Functions", "Cognitive", "MEC", "CloudEdgeManagement", "Kubernetes". + :type kind: str or ~azure.mgmt.databoxedge.v2020_09_01.models.RoleTypes + :ivar system_data: Role configured on ASE resource. + :vartype system_data: ~azure.mgmt.databoxedge.v2020_09_01.models.SystemData + :param host_platform: Host OS supported by the Kubernetes role. Possible values include: + "Windows", "Linux". + :type host_platform: str or ~azure.mgmt.databoxedge.v2020_09_01.models.PlatformType + :ivar provisioning_state: State of Kubernetes deployment. Possible values include: "Invalid", + "Creating", "Created", "Updating", "Reconfiguring", "Failed", "Deleting". + :vartype provisioning_state: str or ~azure.mgmt.databoxedge.v2020_09_01.models.KubernetesState + :ivar host_platform_type: Platform where the runtime is hosted. Possible values include: + "KubernetesCluster", "LinuxVM". + :vartype host_platform_type: str or ~azure.mgmt.databoxedge.v2020_09_01.models.HostPlatformType + :param kubernetes_cluster_info: Kubernetes cluster configuration. + :type kubernetes_cluster_info: ~azure.mgmt.databoxedge.v2020_09_01.models.KubernetesClusterInfo + :param kubernetes_role_resources: Kubernetes role resources. + :type kubernetes_role_resources: + ~azure.mgmt.databoxedge.v2020_09_01.models.KubernetesRoleResources + :param role_status: Role status. Possible values include: "Enabled", "Disabled". + :type role_status: str or ~azure.mgmt.databoxedge.v2020_09_01.models.RoleStatus + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'kind': {'required': True}, + 'system_data': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + 'host_platform_type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'host_platform': {'key': 'properties.hostPlatform', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'host_platform_type': {'key': 'properties.hostPlatformType', 'type': 'str'}, + 'kubernetes_cluster_info': {'key': 'properties.kubernetesClusterInfo', 'type': 'KubernetesClusterInfo'}, + 'kubernetes_role_resources': {'key': 'properties.kubernetesRoleResources', 'type': 'KubernetesRoleResources'}, + 'role_status': {'key': 'properties.roleStatus', 'type': 'str'}, + } + + def __init__( + self, + *, + host_platform: Optional[Union[str, "PlatformType"]] = None, + kubernetes_cluster_info: Optional["KubernetesClusterInfo"] = None, + kubernetes_role_resources: Optional["KubernetesRoleResources"] = None, + role_status: Optional[Union[str, "RoleStatus"]] = None, + **kwargs + ): + super(KubernetesRole, self).__init__(**kwargs) + self.kind = 'Kubernetes' # type: str + self.host_platform = host_platform + self.provisioning_state = None + self.host_platform_type = None + self.kubernetes_cluster_info = kubernetes_cluster_info + self.kubernetes_role_resources = kubernetes_role_resources + self.role_status = role_status + + +class KubernetesRoleCompute(msrest.serialization.Model): + """Kubernetes role compute resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :param vm_profile: Required. VM profile. + :type vm_profile: str + :ivar memory_in_bytes: Memory in bytes. + :vartype memory_in_bytes: long + :ivar processor_count: Processor count. + :vartype processor_count: int + """ + + _validation = { + 'vm_profile': {'required': True}, + 'memory_in_bytes': {'readonly': True}, + 'processor_count': {'readonly': True}, + } + + _attribute_map = { + 'vm_profile': {'key': 'vmProfile', 'type': 'str'}, + 'memory_in_bytes': {'key': 'memoryInBytes', 'type': 'long'}, + 'processor_count': {'key': 'processorCount', 'type': 'int'}, + } + + def __init__( + self, + *, + vm_profile: str, + **kwargs + ): + super(KubernetesRoleCompute, self).__init__(**kwargs) + self.vm_profile = vm_profile + self.memory_in_bytes = None + self.processor_count = None + + +class KubernetesRoleNetwork(msrest.serialization.Model): + """Kubernetes role network resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar cni_config: Cni configuration. + :vartype cni_config: ~azure.mgmt.databoxedge.v2020_09_01.models.CniConfig + :ivar load_balancer_config: Load balancer configuration. + :vartype load_balancer_config: ~azure.mgmt.databoxedge.v2020_09_01.models.LoadBalancerConfig + """ + + _validation = { + 'cni_config': {'readonly': True}, + 'load_balancer_config': {'readonly': True}, + } + + _attribute_map = { + 'cni_config': {'key': 'cniConfig', 'type': 'CniConfig'}, + 'load_balancer_config': {'key': 'loadBalancerConfig', 'type': 'LoadBalancerConfig'}, + } + + def __init__( + self, + **kwargs + ): + super(KubernetesRoleNetwork, self).__init__(**kwargs) + self.cni_config = None + self.load_balancer_config = None + + +class KubernetesRoleResources(msrest.serialization.Model): + """Kubernetes role resources. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :param storage: Kubernetes role storage resource. + :type storage: ~azure.mgmt.databoxedge.v2020_09_01.models.KubernetesRoleStorage + :param compute: Required. Kubernetes role compute resource. + :type compute: ~azure.mgmt.databoxedge.v2020_09_01.models.KubernetesRoleCompute + :ivar network: Kubernetes role network resource. + :vartype network: ~azure.mgmt.databoxedge.v2020_09_01.models.KubernetesRoleNetwork + """ + + _validation = { + 'compute': {'required': True}, + 'network': {'readonly': True}, + } + + _attribute_map = { + 'storage': {'key': 'storage', 'type': 'KubernetesRoleStorage'}, + 'compute': {'key': 'compute', 'type': 'KubernetesRoleCompute'}, + 'network': {'key': 'network', 'type': 'KubernetesRoleNetwork'}, + } + + def __init__( + self, + *, + compute: "KubernetesRoleCompute", + storage: Optional["KubernetesRoleStorage"] = None, + **kwargs + ): + super(KubernetesRoleResources, self).__init__(**kwargs) + self.storage = storage + self.compute = compute + self.network = None + + +class KubernetesRoleStorage(msrest.serialization.Model): + """Kubernetes role storage resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar storage_classes: Kubernetes storage class info. + :vartype storage_classes: + list[~azure.mgmt.databoxedge.v2020_09_01.models.KubernetesRoleStorageClassInfo] + :param endpoints: Mount points of shares in role(s). + :type endpoints: list[~azure.mgmt.databoxedge.v2020_09_01.models.MountPointMap] + """ + + _validation = { + 'storage_classes': {'readonly': True}, + } + + _attribute_map = { + 'storage_classes': {'key': 'storageClasses', 'type': '[KubernetesRoleStorageClassInfo]'}, + 'endpoints': {'key': 'endpoints', 'type': '[MountPointMap]'}, + } + + def __init__( + self, + *, + endpoints: Optional[List["MountPointMap"]] = None, + **kwargs + ): + super(KubernetesRoleStorage, self).__init__(**kwargs) + self.storage_classes = None + self.endpoints = endpoints + + +class KubernetesRoleStorageClassInfo(msrest.serialization.Model): + """Kubernetes storage class info. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar name: Storage class name. + :vartype name: str + :ivar type: Storage class type. + :vartype type: str + :ivar posix_compliant: If provisioned storage is posix compliant. Possible values include: + "Invalid", "Enabled", "Disabled". + :vartype posix_compliant: str or + ~azure.mgmt.databoxedge.v2020_09_01.models.PosixComplianceStatus + """ + + _validation = { + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'posix_compliant': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'posix_compliant': {'key': 'posixCompliant', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(KubernetesRoleStorageClassInfo, self).__init__(**kwargs) + self.name = None + self.type = None + self.posix_compliant = None + + +class LoadBalancerConfig(msrest.serialization.Model): + """Load balancer configuration. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar type: Load balancer type. + :vartype type: str + :ivar version: Load balancer version. + :vartype version: str + """ + + _validation = { + 'type': {'readonly': True}, + 'version': {'readonly': True}, + } + + _attribute_map = { + 'type': {'key': 'type', 'type': 'str'}, + 'version': {'key': 'version', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(LoadBalancerConfig, self).__init__(**kwargs) + self.type = None + self.version = None + + +class MECRole(Role): + """MEC role. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: The path ID that uniquely identifies the object. + :vartype id: str + :ivar name: The object name. + :vartype name: str + :ivar type: The hierarchical type of the object. + :vartype type: str + :param kind: Required. Role type.Constant filled by server. Possible values include: "IOT", + "ASA", "Functions", "Cognitive", "MEC", "CloudEdgeManagement", "Kubernetes". + :type kind: str or ~azure.mgmt.databoxedge.v2020_09_01.models.RoleTypes + :ivar system_data: Role configured on ASE resource. + :vartype system_data: ~azure.mgmt.databoxedge.v2020_09_01.models.SystemData + :param connection_string: Activation key of the MEC. + :type connection_string: ~azure.mgmt.databoxedge.v2020_09_01.models.AsymmetricEncryptedSecret + :param role_status: Role status. Possible values include: "Enabled", "Disabled". + :type role_status: str or ~azure.mgmt.databoxedge.v2020_09_01.models.RoleStatus + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'kind': {'required': True}, + 'system_data': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'connection_string': {'key': 'properties.connectionString', 'type': 'AsymmetricEncryptedSecret'}, + 'role_status': {'key': 'properties.roleStatus', 'type': 'str'}, + } + + def __init__( + self, + *, + connection_string: Optional["AsymmetricEncryptedSecret"] = None, + role_status: Optional[Union[str, "RoleStatus"]] = None, + **kwargs + ): + super(MECRole, self).__init__(**kwargs) + self.kind = 'MEC' # type: str + self.connection_string = connection_string + self.role_status = role_status + + +class MetricConfiguration(msrest.serialization.Model): + """Metric configuration. + + All required parameters must be populated in order to send to Azure. + + :param resource_id: Required. The Resource ID on which the metrics should be pushed. + :type resource_id: str + :param mdm_account: The MDM account to which the counters should be pushed. + :type mdm_account: str + :param metric_name_space: The MDM namespace to which the counters should be pushed. This is + required if MDMAccount is specified. + :type metric_name_space: str + :param counter_sets: Required. Host name for the IoT hub associated to the device. + :type counter_sets: list[~azure.mgmt.databoxedge.v2020_09_01.models.MetricCounterSet] + """ + + _validation = { + 'resource_id': {'required': True}, + 'counter_sets': {'required': True}, + } + + _attribute_map = { + 'resource_id': {'key': 'resourceId', 'type': 'str'}, + 'mdm_account': {'key': 'mdmAccount', 'type': 'str'}, + 'metric_name_space': {'key': 'metricNameSpace', 'type': 'str'}, + 'counter_sets': {'key': 'counterSets', 'type': '[MetricCounterSet]'}, + } + + def __init__( + self, + *, + resource_id: str, + counter_sets: List["MetricCounterSet"], + mdm_account: Optional[str] = None, + metric_name_space: Optional[str] = None, + **kwargs + ): + super(MetricConfiguration, self).__init__(**kwargs) + self.resource_id = resource_id + self.mdm_account = mdm_account + self.metric_name_space = metric_name_space + self.counter_sets = counter_sets + + +class MetricCounter(msrest.serialization.Model): + """The metric counter. + + All required parameters must be populated in order to send to Azure. + + :param name: Required. The counter name. + :type name: str + :param instance: The instance from which counter should be collected. + :type instance: str + :param dimension_filter: The dimension filter. + :type dimension_filter: list[~azure.mgmt.databoxedge.v2020_09_01.models.MetricDimension] + :param additional_dimensions: The additional dimensions to be added to metric. + :type additional_dimensions: list[~azure.mgmt.databoxedge.v2020_09_01.models.MetricDimension] + """ + + _validation = { + 'name': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'instance': {'key': 'instance', 'type': 'str'}, + 'dimension_filter': {'key': 'dimensionFilter', 'type': '[MetricDimension]'}, + 'additional_dimensions': {'key': 'additionalDimensions', 'type': '[MetricDimension]'}, + } + + def __init__( + self, + *, + name: str, + instance: Optional[str] = None, + dimension_filter: Optional[List["MetricDimension"]] = None, + additional_dimensions: Optional[List["MetricDimension"]] = None, + **kwargs + ): + super(MetricCounter, self).__init__(**kwargs) + self.name = name + self.instance = instance + self.dimension_filter = dimension_filter + self.additional_dimensions = additional_dimensions + + +class MetricCounterSet(msrest.serialization.Model): + """The metric counter set. + + All required parameters must be populated in order to send to Azure. + + :param counters: Required. The counters that should be collected in this set. + :type counters: list[~azure.mgmt.databoxedge.v2020_09_01.models.MetricCounter] + """ + + _validation = { + 'counters': {'required': True}, + } + + _attribute_map = { + 'counters': {'key': 'counters', 'type': '[MetricCounter]'}, + } + + def __init__( + self, + *, + counters: List["MetricCounter"], + **kwargs + ): + super(MetricCounterSet, self).__init__(**kwargs) + self.counters = counters + + +class MetricDimension(msrest.serialization.Model): + """The metric dimension. + + All required parameters must be populated in order to send to Azure. + + :param source_type: Required. The dimension type. + :type source_type: str + :param source_name: Required. The dimension value. + :type source_name: str + """ + + _validation = { + 'source_type': {'required': True}, + 'source_name': {'required': True}, + } + + _attribute_map = { + 'source_type': {'key': 'sourceType', 'type': 'str'}, + 'source_name': {'key': 'sourceName', 'type': 'str'}, + } + + def __init__( + self, + *, + source_type: str, + source_name: str, + **kwargs + ): + super(MetricDimension, self).__init__(**kwargs) + self.source_type = source_type + self.source_name = source_name + + +class MetricDimensionV1(msrest.serialization.Model): + """Metric Dimension v1. + + :param name: Name of the metrics dimension. + :type name: str + :param display_name: Display name of the metrics dimension. + :type display_name: str + :param to_be_exported_for_shoebox: To be exported to shoe box. + :type to_be_exported_for_shoebox: bool + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'display_name': {'key': 'displayName', 'type': 'str'}, + 'to_be_exported_for_shoebox': {'key': 'toBeExportedForShoebox', 'type': 'bool'}, + } + + def __init__( + self, + *, + name: Optional[str] = None, + display_name: Optional[str] = None, + to_be_exported_for_shoebox: Optional[bool] = None, + **kwargs + ): + super(MetricDimensionV1, self).__init__(**kwargs) + self.name = name + self.display_name = display_name + self.to_be_exported_for_shoebox = to_be_exported_for_shoebox + + +class MetricSpecificationV1(msrest.serialization.Model): + """Metric specification version 1. + + :param name: Name of the metric. + :type name: str + :param display_name: Display name of the metric. + :type display_name: str + :param display_description: Description of the metric to be displayed. + :type display_description: str + :param unit: Metric units. Possible values include: "NotSpecified", "Percent", "Count", + "Seconds", "Milliseconds", "Bytes", "BytesPerSecond", "CountPerSecond". + :type unit: str or ~azure.mgmt.databoxedge.v2020_09_01.models.MetricUnit + :param aggregation_type: Metric aggregation type. Possible values include: "NotSpecified", + "None", "Average", "Minimum", "Maximum", "Total", "Count". + :type aggregation_type: str or ~azure.mgmt.databoxedge.v2020_09_01.models.MetricAggregationType + :param dimensions: Metric dimensions, other than default dimension which is resource. + :type dimensions: list[~azure.mgmt.databoxedge.v2020_09_01.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 ~azure.mgmt.databoxedge.v2020_09_01.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 + ~azure.mgmt.databoxedge.v2020_09_01.models.TimeGrain] + :param supported_aggregation_types: Support metric aggregation type. + :type supported_aggregation_types: list[str or + ~azure.mgmt.databoxedge.v2020_09_01.models.MetricAggregationType] + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'display_name': {'key': 'displayName', 'type': 'str'}, + 'display_description': {'key': 'displayDescription', 'type': 'str'}, + 'unit': {'key': 'unit', 'type': 'str'}, + 'aggregation_type': {'key': 'aggregationType', 'type': 'str'}, + 'dimensions': {'key': 'dimensions', 'type': '[MetricDimensionV1]'}, + 'fill_gap_with_zero': {'key': 'fillGapWithZero', 'type': 'bool'}, + 'category': {'key': 'category', 'type': 'str'}, + 'resource_id_dimension_name_override': {'key': 'resourceIdDimensionNameOverride', 'type': 'str'}, + 'supported_time_grain_types': {'key': 'supportedTimeGrainTypes', 'type': '[str]'}, + 'supported_aggregation_types': {'key': 'supportedAggregationTypes', 'type': '[str]'}, + } + + def __init__( + self, + *, + name: Optional[str] = None, + display_name: Optional[str] = None, + display_description: Optional[str] = None, + unit: Optional[Union[str, "MetricUnit"]] = None, + aggregation_type: Optional[Union[str, "MetricAggregationType"]] = None, + dimensions: Optional[List["MetricDimensionV1"]] = None, + fill_gap_with_zero: Optional[bool] = None, + category: Optional[Union[str, "MetricCategory"]] = None, + resource_id_dimension_name_override: Optional[str] = None, + supported_time_grain_types: Optional[List[Union[str, "TimeGrain"]]] = None, + supported_aggregation_types: Optional[List[Union[str, "MetricAggregationType"]]] = None, + **kwargs + ): + super(MetricSpecificationV1, self).__init__(**kwargs) + self.name = name + self.display_name = display_name + self.display_description = display_description + self.unit = unit + self.aggregation_type = aggregation_type + self.dimensions = dimensions + self.fill_gap_with_zero = fill_gap_with_zero + self.category = category + self.resource_id_dimension_name_override = resource_id_dimension_name_override + self.supported_time_grain_types = supported_time_grain_types + self.supported_aggregation_types = supported_aggregation_types + + +class MonitoringMetricConfiguration(ARMBaseModel): + """The metric setting details for the role. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: The path ID that uniquely identifies the object. + :vartype id: str + :ivar name: The object name. + :vartype name: str + :ivar type: The hierarchical type of the object. + :vartype type: str + :param metric_configurations: Required. The metrics configuration details. + :type metric_configurations: + list[~azure.mgmt.databoxedge.v2020_09_01.models.MetricConfiguration] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'metric_configurations': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'metric_configurations': {'key': 'properties.metricConfigurations', 'type': '[MetricConfiguration]'}, + } + + def __init__( + self, + *, + metric_configurations: List["MetricConfiguration"], + **kwargs + ): + super(MonitoringMetricConfiguration, self).__init__(**kwargs) + self.metric_configurations = metric_configurations + + +class MonitoringMetricConfigurationList(msrest.serialization.Model): + """Collection of metric configurations. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar value: The list of metric configurations. + :vartype value: list[~azure.mgmt.databoxedge.v2020_09_01.models.MonitoringMetricConfiguration] + :ivar next_link: Link to the next set of results. + :vartype next_link: str + """ + + _validation = { + 'value': {'readonly': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[MonitoringMetricConfiguration]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(MonitoringMetricConfigurationList, self).__init__(**kwargs) + self.value = None + self.next_link = None + + +class MountPointMap(msrest.serialization.Model): + """The share mount point. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :param share_id: Required. ID of the share mounted to the role VM. + :type share_id: str + :ivar role_id: ID of the role to which share is mounted. + :vartype role_id: str + :ivar mount_point: Mount point for the share. + :vartype mount_point: str + :ivar mount_type: Mounting type. Possible values include: "Volume", "HostPath". + :vartype mount_type: str or ~azure.mgmt.databoxedge.v2020_09_01.models.MountType + :ivar role_type: Role type. Possible values include: "IOT", "ASA", "Functions", "Cognitive", + "MEC", "CloudEdgeManagement", "Kubernetes". + :vartype role_type: str or ~azure.mgmt.databoxedge.v2020_09_01.models.RoleTypes + """ + + _validation = { + 'share_id': {'required': True}, + 'role_id': {'readonly': True}, + 'mount_point': {'readonly': True}, + 'mount_type': {'readonly': True}, + 'role_type': {'readonly': True}, + } + + _attribute_map = { + 'share_id': {'key': 'shareId', 'type': 'str'}, + 'role_id': {'key': 'roleId', 'type': 'str'}, + 'mount_point': {'key': 'mountPoint', 'type': 'str'}, + 'mount_type': {'key': 'mountType', 'type': 'str'}, + 'role_type': {'key': 'roleType', 'type': 'str'}, + } + + def __init__( + self, + *, + share_id: str, + **kwargs + ): + super(MountPointMap, self).__init__(**kwargs) + self.share_id = share_id + self.role_id = None + self.mount_point = None + self.mount_type = None + self.role_type = None + + +class NetworkAdapter(msrest.serialization.Model): + """Represents the networkAdapter on a device. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar adapter_id: Instance ID of network adapter. + :vartype adapter_id: str + :ivar adapter_position: Hardware position of network adapter. + :vartype adapter_position: ~azure.mgmt.databoxedge.v2020_09_01.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 ~azure.mgmt.databoxedge.v2020_09_01.models.NetworkAdapterStatus + :param rdma_status: Value indicating whether this adapter is RDMA capable. Possible values + include: "Incapable", "Capable". + :type rdma_status: str or ~azure.mgmt.databoxedge.v2020_09_01.models.NetworkAdapterRDMAStatus + :param dhcp_status: Value indicating whether this adapter has DHCP enabled. Possible values + include: "Disabled", "Enabled". + :type dhcp_status: str or ~azure.mgmt.databoxedge.v2020_09_01.models.NetworkAdapterDHCPStatus + :ivar ipv4_configuration: The IPv4 configuration of the network adapter. + :vartype ipv4_configuration: ~azure.mgmt.databoxedge.v2020_09_01.models.Ipv4Config + :ivar ipv6_configuration: The IPv6 configuration of the network adapter. + :vartype ipv6_configuration: ~azure.mgmt.databoxedge.v2020_09_01.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 ~azure.mgmt.databoxedge.v2020_09_01.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[~azure.mgmt.databoxedge.v2020_09_01.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 ~azure.mgmt.databoxedge.v2020_09_01.models.NodeStatus + :ivar node_chassis_serial_number: Serial number of the Chassis. + :vartype node_chassis_serial_number: str + :ivar node_serial_number: Serial number of the individual node. + :vartype node_serial_number: str + :ivar node_display_name: Display Name of the individual node. + :vartype node_display_name: str + :ivar node_friendly_software_version: Friendly software version name that is currently + installed on the node. + :vartype node_friendly_software_version: str + :ivar node_hcs_version: HCS version that is currently installed on the node. + :vartype node_hcs_version: str + :ivar node_instance_id: Guid instance id of the node. + :vartype node_instance_id: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'node_status': {'readonly': True}, + 'node_chassis_serial_number': {'readonly': True}, + 'node_serial_number': {'readonly': True}, + 'node_display_name': {'readonly': True}, + 'node_friendly_software_version': {'readonly': True}, + 'node_hcs_version': {'readonly': True}, + 'node_instance_id': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'node_status': {'key': 'properties.nodeStatus', 'type': 'str'}, + 'node_chassis_serial_number': {'key': 'properties.nodeChassisSerialNumber', 'type': 'str'}, + 'node_serial_number': {'key': 'properties.nodeSerialNumber', 'type': 'str'}, + 'node_display_name': {'key': 'properties.nodeDisplayName', 'type': 'str'}, + 'node_friendly_software_version': {'key': 'properties.nodeFriendlySoftwareVersion', 'type': 'str'}, + 'node_hcs_version': {'key': 'properties.nodeHcsVersion', 'type': 'str'}, + 'node_instance_id': {'key': 'properties.nodeInstanceId', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(Node, self).__init__(**kwargs) + self.node_status = None + self.node_chassis_serial_number = None + self.node_serial_number = None + self.node_display_name = None + self.node_friendly_software_version = None + self.node_hcs_version = None + self.node_instance_id = None + + +class NodeInfo(msrest.serialization.Model): + """Kubernetes node info. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar name: Node name. + :vartype name: str + :ivar type: Node type - Master/Worker. Possible values include: "Invalid", "Master", "Worker". + :vartype type: str or ~azure.mgmt.databoxedge.v2020_09_01.models.KubernetesNodeType + :param ip_configuration: IP Configuration of the Kubernetes node. + :type ip_configuration: + list[~azure.mgmt.databoxedge.v2020_09_01.models.KubernetesIPConfiguration] + """ + + _validation = { + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'ip_configuration': {'key': 'ipConfiguration', 'type': '[KubernetesIPConfiguration]'}, + } + + def __init__( + self, + *, + ip_configuration: Optional[List["KubernetesIPConfiguration"]] = None, + **kwargs + ): + super(NodeInfo, self).__init__(**kwargs) + self.name = None + self.type = None + self.ip_configuration = ip_configuration + + +class NodeList(msrest.serialization.Model): + """Collection of Nodes. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar value: The list of Nodes. + :vartype value: list[~azure.mgmt.databoxedge.v2020_09_01.models.Node] + :param next_link: Link to the next set of results. + :type next_link: str + """ + + _validation = { + 'value': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[Node]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + next_link: Optional[str] = None, + **kwargs + ): + super(NodeList, self).__init__(**kwargs) + self.value = None + self.next_link = next_link + + +class Operation(msrest.serialization.Model): + """Operations. + + :param name: Name of the operation. + :type name: str + :param display: Properties displayed for the operation. + :type display: ~azure.mgmt.databoxedge.v2020_09_01.models.OperationDisplay + :param origin: Origin of the operation. + :type origin: str + :param is_data_action: Indicates whether the operation is a data action. + :type is_data_action: bool + :param service_specification: Service specification. + :type service_specification: ~azure.mgmt.databoxedge.v2020_09_01.models.ServiceSpecification + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'display': {'key': 'display', 'type': 'OperationDisplay'}, + 'origin': {'key': 'origin', 'type': 'str'}, + 'is_data_action': {'key': 'isDataAction', 'type': 'bool'}, + 'service_specification': {'key': 'properties.serviceSpecification', 'type': 'ServiceSpecification'}, + } + + def __init__( + self, + *, + name: Optional[str] = None, + display: Optional["OperationDisplay"] = None, + origin: Optional[str] = None, + is_data_action: Optional[bool] = None, + service_specification: Optional["ServiceSpecification"] = None, + **kwargs + ): + super(Operation, self).__init__(**kwargs) + self.name = name + self.display = display + self.origin = origin + self.is_data_action = is_data_action + 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[~azure.mgmt.databoxedge.v2020_09_01.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: ~azure.mgmt.databoxedge.v2020_09_01.models.ContactDetails + :param shipping_address: The shipping address. + :type shipping_address: ~azure.mgmt.databoxedge.v2020_09_01.models.Address + :ivar current_status: Current status of the order. + :vartype current_status: ~azure.mgmt.databoxedge.v2020_09_01.models.OrderStatus + :ivar order_history: List of status changes in the order. + :vartype order_history: list[~azure.mgmt.databoxedge.v2020_09_01.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[~azure.mgmt.databoxedge.v2020_09_01.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[~azure.mgmt.databoxedge.v2020_09_01.models.TrackingInfo] + :param shipment_type: ShipmentType of the order. Possible values include: "NotApplicable", + "ShippedToCustomer", "SelfPickup". + :type shipment_type: str or ~azure.mgmt.databoxedge.v2020_09_01.models.ShipmentType + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'current_status': {'readonly': True}, + 'order_history': {'readonly': True}, + 'serial_number': {'readonly': True}, + 'delivery_tracking_info': {'readonly': True}, + 'return_tracking_info': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'contact_information': {'key': 'properties.contactInformation', 'type': 'ContactDetails'}, + 'shipping_address': {'key': 'properties.shippingAddress', 'type': 'Address'}, + 'current_status': {'key': 'properties.currentStatus', 'type': 'OrderStatus'}, + 'order_history': {'key': 'properties.orderHistory', 'type': '[OrderStatus]'}, + 'serial_number': {'key': 'properties.serialNumber', 'type': 'str'}, + 'delivery_tracking_info': {'key': 'properties.deliveryTrackingInfo', 'type': '[TrackingInfo]'}, + 'return_tracking_info': {'key': 'properties.returnTrackingInfo', 'type': '[TrackingInfo]'}, + 'shipment_type': {'key': 'properties.shipmentType', 'type': 'str'}, + } + + def __init__( + self, + *, + contact_information: Optional["ContactDetails"] = None, + shipping_address: Optional["Address"] = None, + shipment_type: Optional[Union[str, "ShipmentType"]] = None, + **kwargs + ): + super(Order, self).__init__(**kwargs) + self.contact_information = contact_information + self.shipping_address = shipping_address + self.current_status = None + self.order_history = None + self.serial_number = None + self.delivery_tracking_info = None + self.return_tracking_info = None + self.shipment_type = shipment_type + + +class OrderList(msrest.serialization.Model): + """List of order entities. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar value: The list of orders. + :vartype value: list[~azure.mgmt.databoxedge.v2020_09_01.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", + "AwaitingPickup", "PickupCompleted", "AwaitingDrop". + :type status: str or ~azure.mgmt.databoxedge.v2020_09_01.models.OrderState + :ivar update_date_time: Time of status update. + :vartype update_date_time: ~datetime.datetime + :param comments: Comments related to this status change. + :type comments: str + :ivar tracking_information: Tracking information related to the state in the ordering flow. + :vartype tracking_information: ~azure.mgmt.databoxedge.v2020_09_01.models.TrackingInfo + :ivar additional_order_details: Dictionary to hold generic information which is not stored + by the already existing properties. + :vartype additional_order_details: dict[str, str] + """ + + _validation = { + 'status': {'required': True}, + 'update_date_time': {'readonly': True}, + 'tracking_information': {'readonly': True}, + 'additional_order_details': {'readonly': True}, + } + + _attribute_map = { + 'status': {'key': 'status', 'type': 'str'}, + 'update_date_time': {'key': 'updateDateTime', 'type': 'iso-8601'}, + 'comments': {'key': 'comments', 'type': 'str'}, + 'tracking_information': {'key': 'trackingInformation', 'type': 'TrackingInfo'}, + 'additional_order_details': {'key': 'additionalOrderDetails', 'type': '{str}'}, + } + + def __init__( + self, + *, + status: Union[str, "OrderState"], + comments: Optional[str] = None, + **kwargs + ): + super(OrderStatus, self).__init__(**kwargs) + self.status = status + self.update_date_time = None + self.comments = comments + self.tracking_information = None + self.additional_order_details = None + + +class PeriodicTimerEventTrigger(Trigger): + """Trigger details. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: The path ID that uniquely identifies the object. + :vartype id: str + :ivar name: The object name. + :vartype name: str + :ivar type: The hierarchical type of the object. + :vartype type: str + :ivar system_data: Trigger in DataBoxEdge Resource. + :vartype system_data: ~azure.mgmt.databoxedge.v2020_09_01.models.SystemData + :param kind: Required. Trigger Kind.Constant filled by server. Possible values include: + "FileEvent", "PeriodicTimerEvent". + :type kind: str or ~azure.mgmt.databoxedge.v2020_09_01.models.TriggerEventType + :param source_info: Required. Periodic timer details. + :type source_info: ~azure.mgmt.databoxedge.v2020_09_01.models.PeriodicTimerSourceInfo + :param sink_info: Required. Role Sink information. + :type sink_info: ~azure.mgmt.databoxedge.v2020_09_01.models.RoleSinkInfo + :param custom_context_tag: A custom context tag typically used to correlate the trigger against + its usage. For example, if a periodic timer trigger is intended for certain specific IoT + modules in the device, the tag can be the name or the image URL of the module. + :type custom_context_tag: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'system_data': {'readonly': True}, + 'kind': {'required': True}, + 'source_info': {'required': True}, + 'sink_info': {'required': True}, + 'custom_context_tag': {'max_length': 192, 'min_length': 0}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'source_info': {'key': 'properties.sourceInfo', 'type': 'PeriodicTimerSourceInfo'}, + 'sink_info': {'key': 'properties.sinkInfo', 'type': 'RoleSinkInfo'}, + 'custom_context_tag': {'key': 'properties.customContextTag', 'type': 'str'}, + } + + def __init__( + self, + *, + source_info: "PeriodicTimerSourceInfo", + sink_info: "RoleSinkInfo", + custom_context_tag: Optional[str] = None, + **kwargs + ): + super(PeriodicTimerEventTrigger, self).__init__(**kwargs) + self.kind = 'PeriodicTimerEvent' # type: str + self.source_info = source_info + self.sink_info = sink_info + self.custom_context_tag = custom_context_tag + + +class PeriodicTimerSourceInfo(msrest.serialization.Model): + """Periodic timer event source. + + All required parameters must be populated in order to send to Azure. + + :param start_time: Required. The time of the day that results in a valid trigger. Schedule is + computed with reference to the time specified upto seconds. If timezone is not specified the + time will considered to be in device timezone. The value will always be returned as UTC time. + :type start_time: ~datetime.datetime + :param schedule: Required. Periodic frequency at which timer event needs to be raised. Supports + daily, hourly, minutes, and seconds. + :type schedule: str + :param topic: Topic where periodic events are published to IoT device. + :type topic: str + """ + + _validation = { + 'start_time': {'required': True}, + 'schedule': {'required': True}, + } + + _attribute_map = { + 'start_time': {'key': 'startTime', 'type': 'iso-8601'}, + 'schedule': {'key': 'schedule', 'type': 'str'}, + 'topic': {'key': 'topic', 'type': 'str'}, + } + + def __init__( + self, + *, + start_time: datetime.datetime, + schedule: str, + topic: Optional[str] = None, + **kwargs + ): + super(PeriodicTimerSourceInfo, self).__init__(**kwargs) + self.start_time = start_time + self.schedule = schedule + self.topic = topic + + +class RefreshDetails(msrest.serialization.Model): + """Fields for tracking refresh job on the share or container. + + :param in_progress_refresh_job_id: If a refresh job is currently in progress on this share or + container, this field indicates the ARM resource ID of that job. The field is empty if no job + is in progress. + :type in_progress_refresh_job_id: str + :param last_completed_refresh_job_time_in_utc: Indicates the completed time for the last + refresh job on this particular share or container, if any.This could be a failed job or a + successful job. + :type last_completed_refresh_job_time_in_utc: ~datetime.datetime + :param error_manifest_file: Indicates the relative path of the error xml for the last refresh + job on this particular share or container, if any. This could be a failed job or a successful + job. + :type error_manifest_file: str + :param last_job: Indicates the id of the last refresh job on this particular share or + container,if any. This could be a failed job or a successful job. + :type last_job: str + """ + + _attribute_map = { + 'in_progress_refresh_job_id': {'key': 'inProgressRefreshJobId', 'type': 'str'}, + 'last_completed_refresh_job_time_in_utc': {'key': 'lastCompletedRefreshJobTimeInUTC', 'type': 'iso-8601'}, + 'error_manifest_file': {'key': 'errorManifestFile', 'type': 'str'}, + 'last_job': {'key': 'lastJob', 'type': 'str'}, + } + + def __init__( + self, + *, + in_progress_refresh_job_id: Optional[str] = None, + last_completed_refresh_job_time_in_utc: Optional[datetime.datetime] = None, + error_manifest_file: Optional[str] = None, + last_job: Optional[str] = None, + **kwargs + ): + super(RefreshDetails, self).__init__(**kwargs) + self.in_progress_refresh_job_id = in_progress_refresh_job_id + self.last_completed_refresh_job_time_in_utc = last_completed_refresh_job_time_in_utc + self.error_manifest_file = error_manifest_file + self.last_job = last_job + + +class ResourceIdentity(msrest.serialization.Model): + """Msi identity details of the resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param type: Identity type. Possible values include: "None", "SystemAssigned", "UserAssigned". + :type type: str or ~azure.mgmt.databoxedge.v2020_09_01.models.MsiIdentityType + :ivar principal_id: Service Principal Id backing the Msi. + :vartype principal_id: str + :ivar tenant_id: Home Tenant Id. + :vartype tenant_id: str + """ + + _validation = { + 'principal_id': {'readonly': True}, + 'tenant_id': {'readonly': True}, + } + + _attribute_map = { + 'type': {'key': 'type', 'type': 'str'}, + 'principal_id': {'key': 'principalId', 'type': 'str'}, + 'tenant_id': {'key': 'tenantId', 'type': 'str'}, + } + + def __init__( + self, + *, + type: Optional[Union[str, "MsiIdentityType"]] = None, + **kwargs + ): + super(ResourceIdentity, self).__init__(**kwargs) + self.type = type + self.principal_id = None + self.tenant_id = None + + +class ResourceMoveDetails(msrest.serialization.Model): + """Fields for tracking resource move. + + :param operation_in_progress: Denotes whether move operation is in progress. Possible values + include: "None", "ResourceMoveInProgress", "ResourceMoveFailed". + :type operation_in_progress: str or + ~azure.mgmt.databoxedge.v2020_09_01.models.ResourceMoveStatus + :param operation_in_progress_lock_timeout_in_utc: Denotes the timeout of the operation to + finish. + :type operation_in_progress_lock_timeout_in_utc: ~datetime.datetime + """ + + _attribute_map = { + 'operation_in_progress': {'key': 'operationInProgress', 'type': 'str'}, + 'operation_in_progress_lock_timeout_in_utc': {'key': 'operationInProgressLockTimeoutInUTC', 'type': 'iso-8601'}, + } + + def __init__( + self, + *, + operation_in_progress: Optional[Union[str, "ResourceMoveStatus"]] = None, + operation_in_progress_lock_timeout_in_utc: Optional[datetime.datetime] = None, + **kwargs + ): + super(ResourceMoveDetails, self).__init__(**kwargs) + self.operation_in_progress = operation_in_progress + self.operation_in_progress_lock_timeout_in_utc = operation_in_progress_lock_timeout_in_utc + + +class ResourceTypeSku(msrest.serialization.Model): + """Resource type Sku object. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar resource_type: The resource type. + :vartype resource_type: str + :ivar skus: The skus. + :vartype skus: list[~azure.mgmt.databoxedge.v2020_09_01.models.SkuInformation] + """ + + _validation = { + 'resource_type': {'readonly': True}, + 'skus': {'readonly': True}, + } + + _attribute_map = { + 'resource_type': {'key': 'resourceType', 'type': 'str'}, + 'skus': {'key': 'skus', 'type': '[SkuInformation]'}, + } + + def __init__( + self, + **kwargs + ): + super(ResourceTypeSku, self).__init__(**kwargs) + self.resource_type = None + self.skus = None + + +class RoleList(msrest.serialization.Model): + """Collection of all the roles on the Data Box Edge device. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar value: The Value. + :vartype value: list[~azure.mgmt.databoxedge.v2020_09_01.models.Role] + :ivar next_link: Link to the next set of results. + :vartype next_link: str + """ + + _validation = { + 'value': {'readonly': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[Role]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(RoleList, self).__init__(**kwargs) + self.value = None + self.next_link = None + + +class RoleSinkInfo(msrest.serialization.Model): + """Compute role against which events will be raised. + + All required parameters must be populated in order to send to Azure. + + :param role_id: Required. Compute role ID. + :type role_id: str + """ + + _validation = { + 'role_id': {'required': True}, + } + + _attribute_map = { + 'role_id': {'key': 'roleId', 'type': 'str'}, + } + + def __init__( + self, + *, + role_id: str, + **kwargs + ): + super(RoleSinkInfo, self).__init__(**kwargs) + self.role_id = role_id + + +class 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: + ~azure.mgmt.databoxedge.v2020_09_01.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[~azure.mgmt.databoxedge.v2020_09_01.models.MetricSpecificationV1] + """ + + _attribute_map = { + 'metric_specifications': {'key': 'metricSpecifications', 'type': '[MetricSpecificationV1]'}, + } + + def __init__( + self, + *, + metric_specifications: Optional[List["MetricSpecificationV1"]] = None, + **kwargs + ): + super(ServiceSpecification, self).__init__(**kwargs) + self.metric_specifications = metric_specifications + + +class Share(ARMBaseModel): + """Represents a share on the Data Box Edge/Gateway device. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: The path ID that uniquely identifies the object. + :vartype id: str + :ivar name: The object name. + :vartype name: str + :ivar type: The hierarchical type of the object. + :vartype type: str + :ivar system_data: Share on ASE device. + :vartype system_data: ~azure.mgmt.databoxedge.v2020_09_01.models.SystemData + :param description: Description for the share. + :type description: str + :param share_status: Required. Current status of the share. Possible values include: "Offline", + "Unknown", "OK", "Updating", "NeedsAttention". + :type share_status: str or ~azure.mgmt.databoxedge.v2020_09_01.models.ShareStatus + :param monitoring_status: Required. Current monitoring status of the share. Possible values + include: "Enabled", "Disabled". + :type monitoring_status: str or ~azure.mgmt.databoxedge.v2020_09_01.models.MonitoringStatus + :param azure_container_info: Azure container mapping for the share. + :type azure_container_info: ~azure.mgmt.databoxedge.v2020_09_01.models.AzureContainerInfo + :param access_protocol: Required. Access protocol to be used by the share. Possible values + include: "SMB", "NFS". + :type access_protocol: str or ~azure.mgmt.databoxedge.v2020_09_01.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[~azure.mgmt.databoxedge.v2020_09_01.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[~azure.mgmt.databoxedge.v2020_09_01.models.ClientAccessRight] + :param refresh_details: Details of the refresh job on this share. + :type refresh_details: ~azure.mgmt.databoxedge.v2020_09_01.models.RefreshDetails + :ivar share_mappings: Share mount point to the role. + :vartype share_mappings: list[~azure.mgmt.databoxedge.v2020_09_01.models.MountPointMap] + :param data_policy: Data policy of the share. Possible values include: "Cloud", "Local". + :type data_policy: str or ~azure.mgmt.databoxedge.v2020_09_01.models.DataPolicy + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'system_data': {'readonly': True}, + 'share_status': {'required': True}, + 'monitoring_status': {'required': True}, + 'access_protocol': {'required': True}, + 'share_mappings': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + 'share_status': {'key': 'properties.shareStatus', 'type': 'str'}, + 'monitoring_status': {'key': 'properties.monitoringStatus', 'type': 'str'}, + 'azure_container_info': {'key': 'properties.azureContainerInfo', 'type': 'AzureContainerInfo'}, + 'access_protocol': {'key': 'properties.accessProtocol', 'type': 'str'}, + 'user_access_rights': {'key': 'properties.userAccessRights', 'type': '[UserAccessRight]'}, + 'client_access_rights': {'key': 'properties.clientAccessRights', 'type': '[ClientAccessRight]'}, + 'refresh_details': {'key': 'properties.refreshDetails', 'type': 'RefreshDetails'}, + 'share_mappings': {'key': 'properties.shareMappings', 'type': '[MountPointMap]'}, + 'data_policy': {'key': 'properties.dataPolicy', 'type': 'str'}, + } + + def __init__( + self, + *, + share_status: Union[str, "ShareStatus"], + monitoring_status: Union[str, "MonitoringStatus"], + access_protocol: Union[str, "ShareAccessProtocol"], + description: Optional[str] = None, + azure_container_info: Optional["AzureContainerInfo"] = None, + user_access_rights: Optional[List["UserAccessRight"]] = None, + client_access_rights: Optional[List["ClientAccessRight"]] = None, + refresh_details: Optional["RefreshDetails"] = None, + data_policy: Optional[Union[str, "DataPolicy"]] = None, + **kwargs + ): + super(Share, self).__init__(**kwargs) + self.system_data = None + self.description = description + self.share_status = share_status + self.monitoring_status = monitoring_status + self.azure_container_info = azure_container_info + self.access_protocol = access_protocol + self.user_access_rights = user_access_rights + self.client_access_rights = client_access_rights + self.refresh_details = refresh_details + self.share_mappings = None + self.data_policy = data_policy + + +class ShareAccessRight(msrest.serialization.Model): + """Specifies the mapping between this particular user and the type of access he has on shares on this device. + + All required parameters must be populated in order to send to Azure. + + :param share_id: Required. The share ID. + :type share_id: str + :param access_type: Required. Type of access to be allowed on the share for this user. Possible + values include: "Change", "Read", "Custom". + :type access_type: str or ~azure.mgmt.databoxedge.v2020_09_01.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[~azure.mgmt.databoxedge.v2020_09_01.models.Share] + :ivar next_link: Link to the next set of results. + :vartype next_link: str + """ + + _validation = { + 'value': {'readonly': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[Share]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ShareList, self).__init__(**kwargs) + self.value = None + self.next_link = None + + +class Sku(msrest.serialization.Model): + """The SKU type. + + :param name: SKU name. Possible values include: "Gateway", "Edge", "TEA_1Node", + "TEA_1Node_UPS", "TEA_1Node_Heater", "TEA_1Node_UPS_Heater", "TEA_4Node_Heater", + "TEA_4Node_UPS_Heater", "TMA", "TDC", "TCA_Small", "GPU", "TCA_Large", "EdgeP_Base", + "EdgeP_High", "EdgePR_Base", "EdgePR_Base_UPS", "EdgeMR_Mini", "RCA_Small", "RCA_Large", "RDC". + :type name: str or ~azure.mgmt.databoxedge.v2020_09_01.models.SkuName + :param tier: The SKU tier. This is based on the SKU name. Possible values include: "Standard". + :type tier: str or ~azure.mgmt.databoxedge.v2020_09_01.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: The extended unit. + :vartype extended_unit: str + """ + + _validation = { + 'meter_id': {'readonly': True}, + 'quantity': {'readonly': True}, + 'extended_unit': {'readonly': True}, + } + + _attribute_map = { + 'meter_id': {'key': 'meterId', 'type': 'str'}, + 'quantity': {'key': 'quantity', 'type': 'long'}, + 'extended_unit': {'key': 'extendedUnit', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(SkuCost, self).__init__(**kwargs) + self.meter_id = None + self.quantity = None + self.extended_unit = None + + +class SkuInformation(msrest.serialization.Model): + """Sku information. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar name: The sku name. + :vartype name: str + :ivar tier: The sku tier. + :vartype tier: str + :ivar kind: The sku kind. + :vartype kind: str + :ivar family: The Sku family. + :vartype family: str + :ivar costs: The pricing info of the Sku. + :vartype costs: list[~azure.mgmt.databoxedge.v2020_09_01.models.SkuCost] + :ivar locations: The locations where Sku is available. + :vartype locations: list[str] + :ivar location_info: The locations where Sku is available with zones and sites info. + :vartype location_info: list[~azure.mgmt.databoxedge.v2020_09_01.models.SkuLocationInfo] + :ivar required_quota_ids: The required quotaIds for the sku to be available. + :vartype required_quota_ids: list[str] + :ivar required_features: The required features for the sku to be available. + :vartype required_features: list[str] + """ + + _validation = { + 'name': {'readonly': True}, + 'tier': {'readonly': True}, + 'kind': {'readonly': True}, + 'family': {'readonly': True}, + 'costs': {'readonly': True}, + 'locations': {'readonly': True}, + 'location_info': {'readonly': True}, + 'required_quota_ids': {'readonly': True}, + 'required_features': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'tier': {'key': 'tier', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'family': {'key': 'family', 'type': 'str'}, + 'costs': {'key': 'costs', 'type': '[SkuCost]'}, + 'locations': {'key': 'locations', 'type': '[str]'}, + 'location_info': {'key': 'locationInfo', 'type': '[SkuLocationInfo]'}, + 'required_quota_ids': {'key': 'requiredQuotaIds', 'type': '[str]'}, + 'required_features': {'key': 'requiredFeatures', 'type': '[str]'}, + } + + def __init__( + self, + **kwargs + ): + super(SkuInformation, self).__init__(**kwargs) + self.name = None + self.tier = None + self.kind = None + self.family = None + self.costs = None + self.locations = None + self.location_info = None + self.required_quota_ids = None + self.required_features = None + + +class SkuInformationList(msrest.serialization.Model): + """List of SKU Information objects. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar value: List of ResourceTypeSku objects. + :vartype value: list[~azure.mgmt.databoxedge.v2020_09_01.models.ResourceTypeSku] + :ivar next_link: Links to the next set of results. + :vartype next_link: str + """ + + _validation = { + 'value': {'readonly': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[ResourceTypeSku]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(SkuInformationList, self).__init__(**kwargs) + self.value = None + self.next_link = None + + +class SkuLocationInfo(msrest.serialization.Model): + """The location info. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar location: The location. + :vartype location: str + :ivar zones: The zones. + :vartype zones: list[str] + :ivar sites: The sites. + :vartype sites: list[str] + """ + + _validation = { + 'location': {'readonly': True}, + 'zones': {'readonly': True}, + 'sites': {'readonly': True}, + } + + _attribute_map = { + 'location': {'key': 'location', 'type': 'str'}, + 'zones': {'key': 'zones', 'type': '[str]'}, + 'sites': {'key': 'sites', 'type': '[str]'}, + } + + def __init__( + self, + **kwargs + ): + super(SkuLocationInfo, self).__init__(**kwargs) + self.location = None + self.zones = None + self.sites = None + + +class StorageAccount(ARMBaseModel): + """Represents a Storage Account on the Data Box Edge/Gateway device. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: The path ID that uniquely identifies the object. + :vartype id: str + :ivar name: The object name. + :vartype name: str + :ivar type: The hierarchical type of the object. + :vartype type: str + :ivar system_data: StorageAccount object on ASE device. + :vartype system_data: ~azure.mgmt.databoxedge.v2020_09_01.models.SystemData + :param description: Description for the storage Account. + :type description: str + :param storage_account_status: Current status of the storage account. Possible values include: + "OK", "Offline", "Unknown", "Updating", "NeedsAttention". + :type storage_account_status: str or + ~azure.mgmt.databoxedge.v2020_09_01.models.StorageAccountStatus + :param data_policy: Required. Data policy of the storage Account. Possible values include: + "Cloud", "Local". + :type data_policy: str or ~azure.mgmt.databoxedge.v2020_09_01.models.DataPolicy + :param storage_account_credential_id: Storage Account Credential Id. + :type storage_account_credential_id: str + :ivar blob_endpoint: BlobEndpoint of Storage Account. + :vartype blob_endpoint: str + :ivar container_count: The Container Count. Present only for Storage Accounts with DataPolicy + set to Cloud. + :vartype container_count: int + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'system_data': {'readonly': True}, + 'data_policy': {'required': True}, + 'blob_endpoint': {'readonly': True}, + 'container_count': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + 'storage_account_status': {'key': 'properties.storageAccountStatus', 'type': 'str'}, + 'data_policy': {'key': 'properties.dataPolicy', 'type': 'str'}, + 'storage_account_credential_id': {'key': 'properties.storageAccountCredentialId', 'type': 'str'}, + 'blob_endpoint': {'key': 'properties.blobEndpoint', 'type': 'str'}, + 'container_count': {'key': 'properties.containerCount', 'type': 'int'}, + } + + def __init__( + self, + *, + data_policy: Union[str, "DataPolicy"], + description: Optional[str] = None, + storage_account_status: Optional[Union[str, "StorageAccountStatus"]] = None, + storage_account_credential_id: Optional[str] = None, + **kwargs + ): + super(StorageAccount, self).__init__(**kwargs) + self.system_data = None + self.description = description + self.storage_account_status = storage_account_status + self.data_policy = data_policy + self.storage_account_credential_id = storage_account_credential_id + self.blob_endpoint = None + self.container_count = None + + +class StorageAccountCredential(ARMBaseModel): + """The storage account credential. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: The path ID that uniquely identifies the object. + :vartype id: str + :ivar name: The object name. + :vartype name: str + :ivar type: The hierarchical type of the object. + :vartype type: str + :ivar system_data: StorageAccountCredential object. + :vartype system_data: ~azure.mgmt.databoxedge.v2020_09_01.models.SystemData + :param alias: Required. Alias for the storage account. + :type alias: str + :param user_name: Username for the storage account. + :type user_name: str + :param account_key: Encrypted storage key. + :type account_key: ~azure.mgmt.databoxedge.v2020_09_01.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 ~azure.mgmt.databoxedge.v2020_09_01.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 ~azure.mgmt.databoxedge.v2020_09_01.models.AccountType + :param storage_account_id: Id of the storage account. + :type storage_account_id: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'system_data': {'readonly': True}, + 'alias': {'required': True}, + 'ssl_status': {'required': True}, + 'account_type': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'alias': {'key': 'properties.alias', 'type': 'str'}, + 'user_name': {'key': 'properties.userName', 'type': 'str'}, + 'account_key': {'key': 'properties.accountKey', 'type': 'AsymmetricEncryptedSecret'}, + 'connection_string': {'key': 'properties.connectionString', 'type': 'str'}, + 'ssl_status': {'key': 'properties.sslStatus', 'type': 'str'}, + 'blob_domain_name': {'key': 'properties.blobDomainName', 'type': 'str'}, + 'account_type': {'key': 'properties.accountType', 'type': 'str'}, + 'storage_account_id': {'key': 'properties.storageAccountId', 'type': 'str'}, + } + + def __init__( + self, + *, + alias: str, + ssl_status: Union[str, "SSLStatus"], + account_type: Union[str, "AccountType"], + user_name: Optional[str] = None, + account_key: Optional["AsymmetricEncryptedSecret"] = None, + connection_string: Optional[str] = None, + blob_domain_name: Optional[str] = None, + storage_account_id: Optional[str] = None, + **kwargs + ): + super(StorageAccountCredential, self).__init__(**kwargs) + self.system_data = None + self.alias = alias + self.user_name = user_name + self.account_key = account_key + self.connection_string = connection_string + self.ssl_status = ssl_status + self.blob_domain_name = blob_domain_name + self.account_type = account_type + self.storage_account_id = storage_account_id + + +class StorageAccountCredentialList(msrest.serialization.Model): + """The collection of storage account credentials. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar value: The value. + :vartype value: list[~azure.mgmt.databoxedge.v2020_09_01.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[~azure.mgmt.databoxedge.v2020_09_01.models.StorageAccount] + :ivar next_link: Link to the next set of results. + :vartype next_link: str + """ + + _validation = { + 'value': {'readonly': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[StorageAccount]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(StorageAccountList, self).__init__(**kwargs) + self.value = None + self.next_link = None + + +class SubscriptionRegisteredFeatures(msrest.serialization.Model): + """SubscriptionRegisteredFeatures. + + :param name: + :type name: str + :param state: + :type state: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'state': {'key': 'state', 'type': 'str'}, + } + + def __init__( + self, + *, + name: Optional[str] = None, + state: Optional[str] = None, + **kwargs + ): + super(SubscriptionRegisteredFeatures, self).__init__(**kwargs) + self.name = name + self.state = state + + +class SymmetricKey(msrest.serialization.Model): + """Symmetric key for authentication. + + :param connection_string: Connection string based on the symmetric key. + :type connection_string: ~azure.mgmt.databoxedge.v2020_09_01.models.AsymmetricEncryptedSecret + """ + + _attribute_map = { + 'connection_string': {'key': 'connectionString', 'type': 'AsymmetricEncryptedSecret'}, + } + + def __init__( + self, + *, + connection_string: Optional["AsymmetricEncryptedSecret"] = None, + **kwargs + ): + super(SymmetricKey, self).__init__(**kwargs) + self.connection_string = connection_string + + +class SystemData(msrest.serialization.Model): + """Metadata pertaining to creation and last modification of the resource. + + :param created_by: The identity that created the resource. + :type created_by: str + :param created_by_type: The type of identity that created the resource. Possible values + include: "User", "Application", "ManagedIdentity", "Key". + :type created_by_type: str or ~azure.mgmt.databoxedge.v2020_09_01.models.CreatedByType + :param created_at: The timestamp of resource creation (UTC). + :type created_at: ~datetime.datetime + :param last_modified_by: The identity that last modified the resource. + :type last_modified_by: str + :param last_modified_by_type: The type of identity that last modified the resource. Possible + values include: "User", "Application", "ManagedIdentity", "Key". + :type last_modified_by_type: str or ~azure.mgmt.databoxedge.v2020_09_01.models.CreatedByType + :param last_modified_at: The type of identity that last modified the resource. + :type last_modified_at: ~datetime.datetime + """ + + _attribute_map = { + 'created_by': {'key': 'createdBy', 'type': 'str'}, + 'created_by_type': {'key': 'createdByType', 'type': 'str'}, + 'created_at': {'key': 'createdAt', 'type': 'iso-8601'}, + 'last_modified_by': {'key': 'lastModifiedBy', 'type': 'str'}, + 'last_modified_by_type': {'key': 'lastModifiedByType', 'type': 'str'}, + 'last_modified_at': {'key': 'lastModifiedAt', 'type': 'iso-8601'}, + } + + def __init__( + self, + *, + created_by: Optional[str] = None, + created_by_type: Optional[Union[str, "CreatedByType"]] = None, + created_at: Optional[datetime.datetime] = None, + last_modified_by: Optional[str] = None, + last_modified_by_type: Optional[Union[str, "CreatedByType"]] = None, + last_modified_at: Optional[datetime.datetime] = None, + **kwargs + ): + super(SystemData, self).__init__(**kwargs) + self.created_by = created_by + self.created_by_type = created_by_type + self.created_at = created_at + self.last_modified_by = last_modified_by + self.last_modified_by_type = last_modified_by_type + self.last_modified_at = last_modified_at + + +class TrackingInfo(msrest.serialization.Model): + """Tracking courier information. + + :param serial_number: Serial number of the device being tracked. + :type serial_number: str + :param carrier_name: Name of the carrier used in the delivery. + :type carrier_name: str + :param tracking_id: Tracking ID of the shipment. + :type tracking_id: str + :param tracking_url: Tracking URL of the shipment. + :type tracking_url: str + """ + + _attribute_map = { + 'serial_number': {'key': 'serialNumber', 'type': 'str'}, + 'carrier_name': {'key': 'carrierName', 'type': 'str'}, + 'tracking_id': {'key': 'trackingId', 'type': 'str'}, + 'tracking_url': {'key': 'trackingUrl', 'type': 'str'}, + } + + def __init__( + self, + *, + serial_number: Optional[str] = None, + carrier_name: Optional[str] = None, + tracking_id: Optional[str] = None, + tracking_url: Optional[str] = None, + **kwargs + ): + super(TrackingInfo, self).__init__(**kwargs) + self.serial_number = serial_number + self.carrier_name = carrier_name + self.tracking_id = tracking_id + self.tracking_url = tracking_url + + +class TriggerList(msrest.serialization.Model): + """Collection of all trigger on the data box edge device. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar value: The list of triggers. + :vartype value: list[~azure.mgmt.databoxedge.v2020_09_01.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 ~azure.mgmt.databoxedge.v2020_09_01.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 + ~azure.mgmt.databoxedge.v2020_09_01.models.InstallRebootBehavior + :ivar ongoing_update_operation: The current update operation. Possible values include: "None", + "Scan", "Download", "Install". + :vartype ongoing_update_operation: str or + ~azure.mgmt.databoxedge.v2020_09_01.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 ~azure.mgmt.databoxedge.v2020_09_01.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 ~azure.mgmt.databoxedge.v2020_09_01.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. + + :ivar id: The path ID that uniquely identifies the object. + :vartype id: str + :ivar name: The object name. + :vartype name: str + :ivar type: The hierarchical type of the object. + :vartype type: str + :ivar system_data: User in DataBoxEdge Resource. + :vartype system_data: ~azure.mgmt.databoxedge.v2020_09_01.models.SystemData + :param encrypted_password: The password details. + :type encrypted_password: ~azure.mgmt.databoxedge.v2020_09_01.models.AsymmetricEncryptedSecret + :ivar share_access_rights: List of shares that the user has rights on. This field should not be + specified during user creation. + :vartype share_access_rights: list[~azure.mgmt.databoxedge.v2020_09_01.models.ShareAccessRight] + :param user_type: Type of the user. Possible values include: "Share", "LocalManagement", "ARM". + :type user_type: str or ~azure.mgmt.databoxedge.v2020_09_01.models.UserType + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'system_data': {'readonly': True}, + 'share_access_rights': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + '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, + *, + encrypted_password: Optional["AsymmetricEncryptedSecret"] = None, + user_type: Optional[Union[str, "UserType"]] = None, + **kwargs + ): + super(User, self).__init__(**kwargs) + self.system_data = None + self.encrypted_password = encrypted_password + self.share_access_rights = None + self.user_type = user_type + + +class UserAccessRight(msrest.serialization.Model): + """The mapping between a particular user and the access type on the SMB share. + + All required parameters must be populated in order to send to Azure. + + :param user_id: Required. User ID (already existing in the device). + :type user_id: str + :param access_type: Required. Type of access to be allowed for the user. Possible values + include: "Change", "Read", "Custom". + :type access_type: str or ~azure.mgmt.databoxedge.v2020_09_01.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[~azure.mgmt.databoxedge.v2020_09_01.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/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_09_01/operations/__init__.py b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_09_01/operations/__init__.py new file mode 100644 index 000000000000..d70057be6458 --- /dev/null +++ b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_09_01/operations/__init__.py @@ -0,0 +1,47 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from ._operations import Operations +from ._available_skus_operations import AvailableSkusOperations +from ._devices_operations import DevicesOperations +from ._alerts_operations import AlertsOperations +from ._bandwidth_schedules_operations import BandwidthSchedulesOperations +from ._jobs_operations import JobsOperations +from ._nodes_operations import NodesOperations +from ._operations_status_operations import OperationsStatusOperations +from ._orders_operations import OrdersOperations +from ._roles_operations import RolesOperations +from ._addons_operations import AddonsOperations +from ._monitoring_config_operations import MonitoringConfigOperations +from ._shares_operations import SharesOperations +from ._storage_account_credentials_operations import StorageAccountCredentialsOperations +from ._storage_accounts_operations import StorageAccountsOperations +from ._containers_operations import ContainersOperations +from ._triggers_operations import TriggersOperations +from ._users_operations import UsersOperations + +__all__ = [ + 'Operations', + 'AvailableSkusOperations', + 'DevicesOperations', + 'AlertsOperations', + 'BandwidthSchedulesOperations', + 'JobsOperations', + 'NodesOperations', + 'OperationsStatusOperations', + 'OrdersOperations', + 'RolesOperations', + 'AddonsOperations', + 'MonitoringConfigOperations', + 'SharesOperations', + 'StorageAccountCredentialsOperations', + 'StorageAccountsOperations', + 'ContainersOperations', + 'TriggersOperations', + 'UsersOperations', +] diff --git a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_09_01/operations/_addons_operations.py b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_09_01/operations/_addons_operations.py new file mode 100644 index 000000000000..32c85be90393 --- /dev/null +++ b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_09_01/operations/_addons_operations.py @@ -0,0 +1,460 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.core.polling import LROPoller, NoPolling, PollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.arm_polling import ARMPolling + +from .. import models as _models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class AddonsOperations(object): + """AddonsOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.databoxedge.v2020_09_01.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list_by_role( + self, + device_name, # type: str + role_name, # type: str + resource_group_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.AddonList"] + """Lists all the addons configured in the role. + + :param device_name: The device name. + :type device_name: str + :param role_name: The role name. + :type role_name: str + :param resource_group_name: The resource group name. + :type resource_group_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either AddonList or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.databoxedge.v2020_09_01.models.AddonList] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.AddonList"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_by_role.metadata['url'] # type: ignore + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'roleName': self._serialize.url("role_name", role_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('AddonList', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_by_role.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/roles/{roleName}/addons'} # type: ignore + + def get( + self, + device_name, # type: str + role_name, # type: str + addon_name, # type: str + resource_group_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.Addon" + """Gets a specific addon by name. + + :param device_name: The device name. + :type device_name: str + :param role_name: The role name. + :type role_name: str + :param addon_name: The addon name. + :type addon_name: str + :param resource_group_name: The resource group name. + :type resource_group_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: Addon, or the result of cls(response) + :rtype: ~azure.mgmt.databoxedge.v2020_09_01.models.Addon + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.Addon"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'roleName': self._serialize.url("role_name", role_name, 'str'), + 'addonName': self._serialize.url("addon_name", addon_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('Addon', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/roles/{roleName}/addons/{addonName}'} # type: ignore + + def _create_or_update_initial( + self, + device_name, # type: str + role_name, # type: str + addon_name, # type: str + resource_group_name, # type: str + addon, # type: "_models.Addon" + **kwargs # type: Any + ): + # type: (...) -> Optional["_models.Addon"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.Addon"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._create_or_update_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'roleName': self._serialize.url("role_name", role_name, 'str'), + 'addonName': self._serialize.url("addon_name", addon_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(addon, 'Addon') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('Addon', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/roles/{roleName}/addons/{addonName}'} # type: ignore + + def begin_create_or_update( + self, + device_name, # type: str + role_name, # type: str + addon_name, # type: str + resource_group_name, # type: str + addon, # type: "_models.Addon" + **kwargs # type: Any + ): + # type: (...) -> LROPoller["_models.Addon"] + """Create or update a addon. + + :param device_name: The device name. + :type device_name: str + :param role_name: The role name. + :type role_name: str + :param addon_name: The addon name. + :type addon_name: str + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param addon: The addon properties. + :type addon: ~azure.mgmt.databoxedge.v2020_09_01.models.Addon + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: Pass in True if you'd like the ARMPolling polling method, + False for no polling, or your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either Addon or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.databoxedge.v2020_09_01.models.Addon] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Addon"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._create_or_update_initial( + device_name=device_name, + role_name=role_name, + addon_name=addon_name, + resource_group_name=resource_group_name, + addon=addon, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('Addon', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'roleName': self._serialize.url("role_name", role_name, 'str'), + 'addonName': self._serialize.url("addon_name", addon_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/roles/{roleName}/addons/{addonName}'} # type: ignore + + def _delete_initial( + self, + device_name, # type: str + role_name, # type: str + addon_name, # type: str + resource_group_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self._delete_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'roleName': self._serialize.url("role_name", role_name, 'str'), + 'addonName': self._serialize.url("addon_name", addon_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/roles/{roleName}/addons/{addonName}'} # type: ignore + + def begin_delete( + self, + device_name, # type: str + role_name, # type: str + addon_name, # type: str + resource_group_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> LROPoller[None] + """Deletes the addon on the device. + + :param device_name: The device name. + :type device_name: str + :param role_name: The role name. + :type role_name: str + :param addon_name: The addon name. + :type addon_name: str + :param resource_group_name: The resource group name. + :type resource_group_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: Pass in True if you'd like the ARMPolling polling method, + False for no polling, or your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._delete_initial( + device_name=device_name, + role_name=role_name, + addon_name=addon_name, + resource_group_name=resource_group_name, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'roleName': self._serialize.url("role_name", role_name, 'str'), + 'addonName': self._serialize.url("addon_name", addon_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/roles/{roleName}/addons/{addonName}'} # type: ignore diff --git a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_09_01/operations/_alerts_operations.py b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_09_01/operations/_alerts_operations.py new file mode 100644 index 000000000000..5e475c8ca70b --- /dev/null +++ b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_09_01/operations/_alerts_operations.py @@ -0,0 +1,186 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.mgmt.core.exceptions import ARMErrorFormat + +from .. import models as _models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class AlertsOperations(object): + """AlertsOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.databoxedge.v2020_09_01.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[~azure.mgmt.databoxedge.v2020_09_01.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 = "2020-09-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: ~azure.mgmt.databoxedge.v2020_09_01.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 = "2020-09-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/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_09_01/operations/_available_skus_operations.py b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_09_01/operations/_available_skus_operations.py new file mode 100644 index 000000000000..739f14c52a86 --- /dev/null +++ b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_09_01/operations/_available_skus_operations.py @@ -0,0 +1,115 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.mgmt.core.exceptions import ARMErrorFormat + +from .. import models as _models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class AvailableSkusOperations(object): + """AvailableSkusOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.databoxedge.v2020_09_01.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list( + self, + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.DataBoxEdgeSkuList"] + """List all the available Skus and information related to them. + + List all the available Skus and information related to them. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either DataBoxEdgeSkuList or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.databoxedge.v2020_09_01.models.DataBoxEdgeSkuList] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.DataBoxEdgeSkuList"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('DataBoxEdgeSkuList', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.DataBoxEdge/availableSkus'} # type: ignore diff --git a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_09_01/operations/_bandwidth_schedules_operations.py b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_09_01/operations/_bandwidth_schedules_operations.py new file mode 100644 index 000000000000..c08125370b0a --- /dev/null +++ b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_09_01/operations/_bandwidth_schedules_operations.py @@ -0,0 +1,438 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.core.polling import LROPoller, NoPolling, PollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.arm_polling import ARMPolling + +from .. import models as _models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class BandwidthSchedulesOperations(object): + """BandwidthSchedulesOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.databoxedge.v2020_09_01.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[~azure.mgmt.databoxedge.v2020_09_01.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 = "2020-09-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: ~azure.mgmt.databoxedge.v2020_09_01.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 = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('BandwidthSchedule', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/bandwidthSchedules/{name}'} # type: ignore + + def _create_or_update_initial( + self, + device_name, # type: str + name, # type: str + resource_group_name, # type: str + parameters, # type: "_models.BandwidthSchedule" + **kwargs # type: Any + ): + # type: (...) -> Optional["_models.BandwidthSchedule"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.BandwidthSchedule"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._create_or_update_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, 'BandwidthSchedule') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('BandwidthSchedule', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/bandwidthSchedules/{name}'} # type: ignore + + def begin_create_or_update( + self, + device_name, # type: str + name, # type: str + resource_group_name, # type: str + parameters, # type: "_models.BandwidthSchedule" + **kwargs # type: Any + ): + # type: (...) -> LROPoller["_models.BandwidthSchedule"] + """Creates or updates a bandwidth schedule. + + :param device_name: The device name. + :type device_name: str + :param name: The bandwidth schedule name which needs to be added/updated. + :type name: str + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param parameters: The bandwidth schedule to be added or updated. + :type parameters: ~azure.mgmt.databoxedge.v2020_09_01.models.BandwidthSchedule + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: Pass in True if you'd like the ARMPolling polling method, + False for no polling, or your own initialized polling object for a 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[~azure.mgmt.databoxedge.v2020_09_01.models.BandwidthSchedule] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.BandwidthSchedule"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._create_or_update_initial( + device_name=device_name, + name=name, + resource_group_name=resource_group_name, + parameters=parameters, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('BandwidthSchedule', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/bandwidthSchedules/{name}'} # type: ignore + + def _delete_initial( + self, + device_name, # type: str + name, # type: str + resource_group_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-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: Pass in True if you'd like the ARMPolling polling method, + False for no polling, or your own initialized polling object for a 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/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_09_01/operations/_containers_operations.py b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_09_01/operations/_containers_operations.py new file mode 100644 index 000000000000..18514cba48b2 --- /dev/null +++ b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_09_01/operations/_containers_operations.py @@ -0,0 +1,592 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.core.polling import LROPoller, NoPolling, PollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.arm_polling import ARMPolling + +from .. import models as _models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class ContainersOperations(object): + """ContainersOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.databoxedge.v2020_09_01.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[~azure.mgmt.databoxedge.v2020_09_01.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 = "2020-09-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: ~azure.mgmt.databoxedge.v2020_09_01.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 = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'storageAccountName': self._serialize.url("storage_account_name", storage_account_name, 'str'), + 'containerName': self._serialize.url("container_name", container_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('Container', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/storageAccounts/{storageAccountName}/containers/{containerName}'} # type: ignore + + def _create_or_update_initial( + self, + device_name, # type: str + storage_account_name, # type: str + container_name, # type: str + resource_group_name, # type: str + container, # type: "_models.Container" + **kwargs # type: Any + ): + # type: (...) -> Optional["_models.Container"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.Container"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._create_or_update_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'storageAccountName': self._serialize.url("storage_account_name", storage_account_name, 'str'), + 'containerName': self._serialize.url("container_name", container_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(container, 'Container') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('Container', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/storageAccounts/{storageAccountName}/containers/{containerName}'} # type: ignore + + def begin_create_or_update( + self, + device_name, # type: str + storage_account_name, # type: str + container_name, # type: str + resource_group_name, # type: str + container, # type: "_models.Container" + **kwargs # type: Any + ): + # type: (...) -> LROPoller["_models.Container"] + """Creates a new container or updates an existing container on the device. + + Creates a new container or updates an existing container on the device. + + :param device_name: The device name. + :type device_name: str + :param storage_account_name: The Storage Account Name. + :type storage_account_name: str + :param container_name: The container name. + :type container_name: str + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param container: The container properties. + :type container: ~azure.mgmt.databoxedge.v2020_09_01.models.Container + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: Pass in True if you'd like the ARMPolling polling method, + False for no polling, or your own initialized polling object for a 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[~azure.mgmt.databoxedge.v2020_09_01.models.Container] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Container"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._create_or_update_initial( + device_name=device_name, + storage_account_name=storage_account_name, + container_name=container_name, + resource_group_name=resource_group_name, + container=container, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('Container', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'storageAccountName': self._serialize.url("storage_account_name", storage_account_name, 'str'), + 'containerName': self._serialize.url("container_name", container_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/storageAccounts/{storageAccountName}/containers/{containerName}'} # type: ignore + + def _delete_initial( + self, + device_name, # type: str + storage_account_name, # type: str + container_name, # type: str + resource_group_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-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: Pass in True if you'd like the ARMPolling polling method, + False for no polling, or your own initialized polling object for a 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 = "2020-09-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: Pass in True if you'd like the ARMPolling polling method, + False for no polling, or your own initialized polling object for a 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/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_09_01/operations/_devices_operations.py b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_09_01/operations/_devices_operations.py new file mode 100644 index 000000000000..376eeb43c44f --- /dev/null +++ b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_09_01/operations/_devices_operations.py @@ -0,0 +1,1389 @@ +# 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 as _models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class DevicesOperations(object): + """DevicesOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.databoxedge.v2020_09_01.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[~azure.mgmt.databoxedge.v2020_09_01.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 = "2020-09-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[~azure.mgmt.databoxedge.v2020_09_01.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 = "2020-09-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: ~azure.mgmt.databoxedge.v2020_09_01.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 = "2020-09-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 + data_box_edge_device, # type: "_models.DataBoxEdgeDevice" + **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', {})) + api_version = "2020-09-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 + data_box_edge_device, # type: "_models.DataBoxEdgeDevice" + **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 data_box_edge_device: The resource object. + :type data_box_edge_device: ~azure.mgmt.databoxedge.v2020_09_01.models.DataBoxEdgeDevice + :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: Pass in True if you'd like the ARMPolling polling method, + False for no polling, or your own initialized polling object for a 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[~azure.mgmt.databoxedge.v2020_09_01.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, + data_box_edge_device=data_box_edge_device, + 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 = "2020-09-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: Pass in True if you'd like the ARMPolling polling method, + False for no polling, or your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._delete_initial( + device_name=device_name, + resource_group_name=resource_group_name, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}'} # type: ignore + + def update( + self, + device_name, # type: str + resource_group_name, # type: str + parameters, # type: "_models.DataBoxEdgeDevicePatch" + **kwargs # type: Any + ): + # type: (...) -> "_models.DataBoxEdgeDevice" + """Modifies a Data Box Edge/Data Box Gateway resource. + + :param device_name: The device name. + :type device_name: str + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param parameters: The resource parameters. + :type parameters: ~azure.mgmt.databoxedge.v2020_09_01.models.DataBoxEdgeDevicePatch + :keyword callable cls: A custom type or function that will be passed the direct response + :return: DataBoxEdgeDevice, or the result of cls(response) + :rtype: ~azure.mgmt.databoxedge.v2020_09_01.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 = "2020-09-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update.metadata['url'] # type: ignore + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, 'DataBoxEdgeDevicePatch') + body_content_kwargs['content'] = body_content + request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('DataBoxEdgeDevice', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}'} # type: ignore + + def _download_updates_initial( + self, + device_name, # type: str + resource_group_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self._download_updates_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _download_updates_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/downloadUpdates'} # type: ignore + + def begin_download_updates( + self, + device_name, # type: str + resource_group_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> LROPoller[None] + """Downloads the updates on a Data Box Edge/Data Box Gateway device. + + Downloads the updates on a Data Box Edge/Data Box Gateway device. + + :param device_name: The device name. + :type device_name: str + :param resource_group_name: The resource group name. + :type resource_group_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: Pass in True if you'd like the ARMPolling polling method, + False for no polling, or your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._download_updates_initial( + device_name=device_name, + resource_group_name=resource_group_name, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_download_updates.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/downloadUpdates'} # type: ignore + + def generate_certificate( + self, + device_name, # type: str + resource_group_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.GenerateCertResponse" + """Generates certificate for activation key. + + :param device_name: The device name. + :type device_name: str + :param resource_group_name: The resource group name. + :type resource_group_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: GenerateCertResponse, or the result of cls(response) + :rtype: ~azure.mgmt.databoxedge.v2020_09_01.models.GenerateCertResponse + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.GenerateCertResponse"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.generate_certificate.metadata['url'] # type: ignore + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('GenerateCertResponse', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + generate_certificate.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/generateCertificate'} # type: ignore + + def get_extended_information( + self, + device_name, # type: str + resource_group_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.DataBoxEdgeDeviceExtendedInfo" + """Gets additional information for the specified Azure Stack Edge/Data Box Gateway device. + + :param device_name: The device name. + :type device_name: str + :param resource_group_name: The resource group name. + :type resource_group_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: DataBoxEdgeDeviceExtendedInfo, or the result of cls(response) + :rtype: ~azure.mgmt.databoxedge.v2020_09_01.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 = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.get_extended_information.metadata['url'] # type: ignore + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('DataBoxEdgeDeviceExtendedInfo', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_extended_information.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/getExtendedInformation'} # type: ignore + + def _install_updates_initial( + self, + device_name, # type: str + resource_group_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self._install_updates_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _install_updates_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/installUpdates'} # type: ignore + + def begin_install_updates( + self, + device_name, # type: str + resource_group_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> LROPoller[None] + """Installs the updates on the Data Box Edge/Data Box Gateway device. + + Installs the updates on the Data Box Edge/Data Box Gateway device. + + :param device_name: The device name. + :type device_name: str + :param resource_group_name: The resource group name. + :type resource_group_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: Pass in True if you'd like the ARMPolling polling method, + False for no polling, or your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._install_updates_initial( + device_name=device_name, + resource_group_name=resource_group_name, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_install_updates.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/installUpdates'} # type: ignore + + def get_network_settings( + self, + device_name, # type: str + resource_group_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.NetworkSettings" + """Gets the network settings of the specified Data Box Edge/Data Box Gateway device. + + :param device_name: The device name. + :type device_name: str + :param resource_group_name: The resource group name. + :type resource_group_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: NetworkSettings, or the result of cls(response) + :rtype: ~azure.mgmt.databoxedge.v2020_09_01.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 = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.get_network_settings.metadata['url'] # type: ignore + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('NetworkSettings', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_network_settings.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/networkSettings/default'} # type: ignore + + def _scan_for_updates_initial( + self, + device_name, # type: str + resource_group_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self._scan_for_updates_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _scan_for_updates_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/scanForUpdates'} # type: ignore + + def begin_scan_for_updates( + self, + device_name, # type: str + resource_group_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> LROPoller[None] + """Scans for updates on a Data Box Edge/Data Box Gateway device. + + Scans for updates on a Data Box Edge/Data Box Gateway device. + + :param device_name: The device name. + :type device_name: str + :param resource_group_name: The resource group name. + :type resource_group_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: Pass in True if you'd like the ARMPolling polling method, + False for no polling, or your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._scan_for_updates_initial( + device_name=device_name, + resource_group_name=resource_group_name, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_scan_for_updates.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/scanForUpdates'} # type: ignore + + def _create_or_update_security_settings_initial( + self, + device_name, # type: str + resource_group_name, # type: str + security_settings, # type: "_models.SecuritySettings" + **kwargs # type: Any + ): + # type: (...) -> None + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._create_or_update_security_settings_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(security_settings, 'SecuritySettings') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _create_or_update_security_settings_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/securitySettings/default/update'} # type: ignore + + def begin_create_or_update_security_settings( + self, + device_name, # type: str + resource_group_name, # type: str + security_settings, # type: "_models.SecuritySettings" + **kwargs # type: Any + ): + # type: (...) -> LROPoller[None] + """Updates the security settings on a Data Box Edge/Data Box Gateway device. + + :param device_name: The device name. + :type device_name: str + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param security_settings: The security settings. + :type security_settings: ~azure.mgmt.databoxedge.v2020_09_01.models.SecuritySettings + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: Pass in True if you'd like the ARMPolling polling method, + False for no polling, or your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._create_or_update_security_settings_initial( + device_name=device_name, + resource_group_name=resource_group_name, + security_settings=security_settings, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create_or_update_security_settings.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/securitySettings/default/update'} # type: ignore + + def update_extended_information( + self, + device_name, # type: str + resource_group_name, # type: str + parameters, # type: "_models.DataBoxEdgeDeviceExtendedInfoPatch" + **kwargs # type: Any + ): + # type: (...) -> "_models.DataBoxEdgeDeviceExtendedInfo" + """Gets additional information for the specified Data Box Edge/Data Box Gateway device. + + :param device_name: The device name. + :type device_name: str + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param parameters: The patch object. + :type parameters: ~azure.mgmt.databoxedge.v2020_09_01.models.DataBoxEdgeDeviceExtendedInfoPatch + :keyword callable cls: A custom type or function that will be passed the direct response + :return: DataBoxEdgeDeviceExtendedInfo, or the result of cls(response) + :rtype: ~azure.mgmt.databoxedge.v2020_09_01.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 = "2020-09-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update_extended_information.metadata['url'] # type: ignore + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, 'DataBoxEdgeDeviceExtendedInfoPatch') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('DataBoxEdgeDeviceExtendedInfo', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update_extended_information.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/updateExtendedInformation'} # type: ignore + + def get_update_summary( + self, + device_name, # type: str + resource_group_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.UpdateSummary" + """Gets information about the availability of updates based on the last scan of the device. It also gets information about any ongoing download or install jobs on the device. + + Gets information about the availability of updates based on the last scan of the device. It + also gets information about any ongoing download or install jobs on the device. + + :param device_name: The device name. + :type device_name: str + :param resource_group_name: The resource group name. + :type resource_group_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: UpdateSummary, or the result of cls(response) + :rtype: ~azure.mgmt.databoxedge.v2020_09_01.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 = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.get_update_summary.metadata['url'] # type: ignore + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('UpdateSummary', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_update_summary.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/updateSummary/default'} # type: ignore + + def upload_certificate( + self, + device_name, # type: str + resource_group_name, # type: str + parameters, # type: "_models.UploadCertificateRequest" + **kwargs # type: Any + ): + # type: (...) -> "_models.UploadCertificateResponse" + """Uploads registration certificate for the device. + + :param device_name: The device name. + :type device_name: str + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param parameters: The upload certificate request. + :type parameters: ~azure.mgmt.databoxedge.v2020_09_01.models.UploadCertificateRequest + :keyword callable cls: A custom type or function that will be passed the direct response + :return: UploadCertificateResponse, or the result of cls(response) + :rtype: ~azure.mgmt.databoxedge.v2020_09_01.models.UploadCertificateResponse + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.UploadCertificateResponse"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-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/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_09_01/operations/_jobs_operations.py b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_09_01/operations/_jobs_operations.py new file mode 100644 index 000000000000..b9023fcd83e1 --- /dev/null +++ b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_09_01/operations/_jobs_operations.py @@ -0,0 +1,110 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.mgmt.core.exceptions import ARMErrorFormat + +from .. import models as _models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Optional, TypeVar + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class JobsOperations(object): + """JobsOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.databoxedge.v2020_09_01.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: ~azure.mgmt.databoxedge.v2020_09_01.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 = "2020-09-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/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_09_01/operations/_monitoring_config_operations.py b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_09_01/operations/_monitoring_config_operations.py new file mode 100644 index 000000000000..5036dd1df3ef --- /dev/null +++ b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_09_01/operations/_monitoring_config_operations.py @@ -0,0 +1,450 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.core.polling import LROPoller, NoPolling, PollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.arm_polling import ARMPolling + +from .. import models as _models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class MonitoringConfigOperations(object): + """MonitoringConfigOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.databoxedge.v2020_09_01.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list( + self, + device_name, # type: str + role_name, # type: str + resource_group_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.MonitoringMetricConfigurationList"] + """Lists metric configurations in a role. + + Lists metric configurations in a role. + + :param device_name: The device name. + :type device_name: str + :param role_name: The role name. + :type role_name: str + :param resource_group_name: The resource group name. + :type resource_group_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either MonitoringMetricConfigurationList or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.databoxedge.v2020_09_01.models.MonitoringMetricConfigurationList] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.MonitoringMetricConfigurationList"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list.metadata['url'] # type: ignore + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'roleName': self._serialize.url("role_name", role_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('MonitoringMetricConfigurationList', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/roles/{roleName}/monitoringConfig'} # type: ignore + + def get( + self, + device_name, # type: str + role_name, # type: str + resource_group_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.MonitoringMetricConfiguration" + """Gets a metric configuration of a role. + + Gets a metric configuration of a role. + + :param device_name: The device name. + :type device_name: str + :param role_name: The role name. + :type role_name: str + :param resource_group_name: The resource group name. + :type resource_group_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: MonitoringMetricConfiguration, or the result of cls(response) + :rtype: ~azure.mgmt.databoxedge.v2020_09_01.models.MonitoringMetricConfiguration + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.MonitoringMetricConfiguration"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'roleName': self._serialize.url("role_name", role_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('MonitoringMetricConfiguration', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/roles/{roleName}/monitoringConfig/default'} # type: ignore + + def _create_or_update_initial( + self, + device_name, # type: str + role_name, # type: str + resource_group_name, # type: str + monitoring_metric_configuration, # type: "_models.MonitoringMetricConfiguration" + **kwargs # type: Any + ): + # type: (...) -> Optional["_models.MonitoringMetricConfiguration"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.MonitoringMetricConfiguration"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._create_or_update_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'roleName': self._serialize.url("role_name", role_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(monitoring_metric_configuration, 'MonitoringMetricConfiguration') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('MonitoringMetricConfiguration', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/roles/{roleName}/monitoringConfig/default'} # type: ignore + + def begin_create_or_update( + self, + device_name, # type: str + role_name, # type: str + resource_group_name, # type: str + monitoring_metric_configuration, # type: "_models.MonitoringMetricConfiguration" + **kwargs # type: Any + ): + # type: (...) -> LROPoller["_models.MonitoringMetricConfiguration"] + """Creates a new metric configuration or updates an existing one for a role. + + Creates a new metric configuration or updates an existing one for a role. + + :param device_name: The device name. + :type device_name: str + :param role_name: The role name. + :type role_name: str + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param monitoring_metric_configuration: The metric configuration. + :type monitoring_metric_configuration: ~azure.mgmt.databoxedge.v2020_09_01.models.MonitoringMetricConfiguration + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: Pass in True if you'd like the ARMPolling polling method, + False for no polling, or your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either MonitoringMetricConfiguration or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.databoxedge.v2020_09_01.models.MonitoringMetricConfiguration] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.MonitoringMetricConfiguration"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._create_or_update_initial( + device_name=device_name, + role_name=role_name, + resource_group_name=resource_group_name, + monitoring_metric_configuration=monitoring_metric_configuration, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('MonitoringMetricConfiguration', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'roleName': self._serialize.url("role_name", role_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/roles/{roleName}/monitoringConfig/default'} # type: ignore + + def _delete_initial( + self, + device_name, # type: str + role_name, # type: str + resource_group_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self._delete_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'roleName': self._serialize.url("role_name", role_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/roles/{roleName}/monitoringConfig/default'} # type: ignore + + def begin_delete( + self, + device_name, # type: str + role_name, # type: str + resource_group_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> LROPoller[None] + """deletes a new metric configuration for a role. + + deletes a new metric configuration for a role. + + :param device_name: The device name. + :type device_name: str + :param role_name: The role name. + :type role_name: str + :param resource_group_name: The resource group name. + :type resource_group_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: Pass in True if you'd like the ARMPolling polling method, + False for no polling, or your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._delete_initial( + device_name=device_name, + role_name=role_name, + resource_group_name=resource_group_name, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'roleName': self._serialize.url("role_name", role_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/roles/{roleName}/monitoringConfig/default'} # type: ignore diff --git a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_09_01/operations/_nodes_operations.py b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_09_01/operations/_nodes_operations.py new file mode 100644 index 000000000000..098069c8a553 --- /dev/null +++ b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_09_01/operations/_nodes_operations.py @@ -0,0 +1,121 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.mgmt.core.exceptions import ARMErrorFormat + +from .. import models as _models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class NodesOperations(object): + """NodesOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.databoxedge.v2020_09_01.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[~azure.mgmt.databoxedge.v2020_09_01.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 = "2020-09-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_by_data_box_edge_device.metadata['url'] # type: ignore + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('NodeList', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_by_data_box_edge_device.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/nodes'} # type: ignore diff --git a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_09_01/operations/_operations.py b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_09_01/operations/_operations.py new file mode 100644 index 000000000000..f1df400f6fca --- /dev/null +++ b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_09_01/operations/_operations.py @@ -0,0 +1,111 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.mgmt.core.exceptions import ARMErrorFormat + +from .. import models as _models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class Operations(object): + """Operations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.databoxedge.v2020_09_01.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[~azure.mgmt.databoxedge.v2020_09_01.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 = "2020-09-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/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_09_01/operations/_operations_status_operations.py b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_09_01/operations/_operations_status_operations.py new file mode 100644 index 000000000000..a99b8e94cea7 --- /dev/null +++ b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_09_01/operations/_operations_status_operations.py @@ -0,0 +1,110 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.mgmt.core.exceptions import ARMErrorFormat + +from .. import models as _models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Optional, TypeVar + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class OperationsStatusOperations(object): + """OperationsStatusOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.databoxedge.v2020_09_01.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: ~azure.mgmt.databoxedge.v2020_09_01.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 = "2020-09-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/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_09_01/operations/_orders_operations.py b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_09_01/operations/_orders_operations.py new file mode 100644 index 000000000000..d580b845a6da --- /dev/null +++ b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_09_01/operations/_orders_operations.py @@ -0,0 +1,489 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.core.polling import LROPoller, NoPolling, PollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.arm_polling import ARMPolling + +from .. import models as _models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class OrdersOperations(object): + """OrdersOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.databoxedge.v2020_09_01.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[~azure.mgmt.databoxedge.v2020_09_01.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 = "2020-09-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: ~azure.mgmt.databoxedge.v2020_09_01.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 = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('Order', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/orders/default'} # type: ignore + + def _create_or_update_initial( + self, + device_name, # type: str + resource_group_name, # type: str + order, # type: "_models.Order" + **kwargs # type: Any + ): + # type: (...) -> Optional["_models.Order"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.Order"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._create_or_update_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(order, 'Order') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('Order', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/orders/default'} # type: ignore + + def begin_create_or_update( + self, + device_name, # type: str + resource_group_name, # type: str + order, # type: "_models.Order" + **kwargs # type: Any + ): + # type: (...) -> LROPoller["_models.Order"] + """Creates or updates an order. + + Creates or updates an order. + + :param device_name: The order details of a device. + :type device_name: str + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param order: The order to be created or updated. + :type order: ~azure.mgmt.databoxedge.v2020_09_01.models.Order + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: Pass in True if you'd like the ARMPolling polling method, + False for no polling, or your own initialized polling object for a 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[~azure.mgmt.databoxedge.v2020_09_01.models.Order] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Order"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._create_or_update_initial( + device_name=device_name, + resource_group_name=resource_group_name, + order=order, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('Order', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/orders/default'} # type: ignore + + def _delete_initial( + self, + device_name, # type: str + resource_group_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-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: Pass in True if you'd like the ARMPolling polling method, + False for no polling, or your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._delete_initial( + device_name=device_name, + resource_group_name=resource_group_name, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/orders/default'} # type: ignore + + def list_dc_access_code( + self, + device_name, # type: str + resource_group_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.DCAccessCode" + """Gets the DCAccess Code. + + Gets the DCAccess Code. + + :param device_name: The device name. + :type device_name: str + :param resource_group_name: The resource group name. + :type resource_group_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: DCAccessCode, or the result of cls(response) + :rtype: ~azure.mgmt.databoxedge.v2020_09_01.models.DCAccessCode + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.DCAccessCode"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.list_dc_access_code.metadata['url'] # type: ignore + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('DCAccessCode', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + list_dc_access_code.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/orders/default/listDCAccessCode'} # type: ignore diff --git a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_09_01/operations/_roles_operations.py b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_09_01/operations/_roles_operations.py new file mode 100644 index 000000000000..d885cd2fbb11 --- /dev/null +++ b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_09_01/operations/_roles_operations.py @@ -0,0 +1,438 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.core.polling import LROPoller, NoPolling, PollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.arm_polling import ARMPolling + +from .. import models as _models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class RolesOperations(object): + """RolesOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.databoxedge.v2020_09_01.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[~azure.mgmt.databoxedge.v2020_09_01.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 = "2020-09-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: ~azure.mgmt.databoxedge.v2020_09_01.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 = "2020-09-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 = "2020-09-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: ~azure.mgmt.databoxedge.v2020_09_01.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: Pass in True if you'd like the ARMPolling polling method, + False for no polling, or your own initialized polling object for a 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[~azure.mgmt.databoxedge.v2020_09_01.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 = "2020-09-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: Pass in True if you'd like the ARMPolling polling method, + False for no polling, or your own initialized polling object for a 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/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_09_01/operations/_shares_operations.py b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_09_01/operations/_shares_operations.py new file mode 100644 index 000000000000..03b97b7f9625 --- /dev/null +++ b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_09_01/operations/_shares_operations.py @@ -0,0 +1,563 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.core.polling import LROPoller, NoPolling, PollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.arm_polling import ARMPolling + +from .. import models as _models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class SharesOperations(object): + """SharesOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.databoxedge.v2020_09_01.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[~azure.mgmt.databoxedge.v2020_09_01.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 = "2020-09-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: ~azure.mgmt.databoxedge.v2020_09_01.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 = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('Share', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/shares/{name}'} # type: ignore + + def _create_or_update_initial( + self, + device_name, # type: str + name, # type: str + resource_group_name, # type: str + share, # type: "_models.Share" + **kwargs # type: Any + ): + # type: (...) -> Optional["_models.Share"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.Share"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._create_or_update_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(share, 'Share') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('Share', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/shares/{name}'} # type: ignore + + def begin_create_or_update( + self, + device_name, # type: str + name, # type: str + resource_group_name, # type: str + share, # type: "_models.Share" + **kwargs # type: Any + ): + # type: (...) -> LROPoller["_models.Share"] + """Creates a new share or updates an existing share on the device. + + Creates a new share or updates an existing share on the device. + + :param device_name: The device name. + :type device_name: str + :param name: The share name. + :type name: str + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param share: The share properties. + :type share: ~azure.mgmt.databoxedge.v2020_09_01.models.Share + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: Pass in True if you'd like the ARMPolling polling method, + False for no polling, or your own initialized polling object for a 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[~azure.mgmt.databoxedge.v2020_09_01.models.Share] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Share"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._create_or_update_initial( + device_name=device_name, + name=name, + resource_group_name=resource_group_name, + share=share, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('Share', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/shares/{name}'} # type: ignore + + def _delete_initial( + self, + device_name, # type: str + name, # type: str + resource_group_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-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: Pass in True if you'd like the ARMPolling polling method, + False for no polling, or your own initialized polling object for a 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 = "2020-09-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: Pass in True if you'd like the ARMPolling polling method, + False for no polling, or your own initialized polling object for a 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/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_09_01/operations/_storage_account_credentials_operations.py b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_09_01/operations/_storage_account_credentials_operations.py new file mode 100644 index 000000000000..cd19b75ebc50 --- /dev/null +++ b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_09_01/operations/_storage_account_credentials_operations.py @@ -0,0 +1,440 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.core.polling import LROPoller, NoPolling, PollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.arm_polling import ARMPolling + +from .. import models as _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: ~azure.mgmt.databoxedge.v2020_09_01.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[~azure.mgmt.databoxedge.v2020_09_01.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 = "2020-09-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: ~azure.mgmt.databoxedge.v2020_09_01.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 = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('StorageAccountCredential', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/storageAccountCredentials/{name}'} # type: ignore + + def _create_or_update_initial( + self, + device_name, # type: str + name, # type: str + resource_group_name, # type: str + storage_account_credential, # type: "_models.StorageAccountCredential" + **kwargs # type: Any + ): + # type: (...) -> Optional["_models.StorageAccountCredential"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.StorageAccountCredential"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._create_or_update_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(storage_account_credential, 'StorageAccountCredential') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('StorageAccountCredential', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/storageAccountCredentials/{name}'} # type: ignore + + def begin_create_or_update( + self, + device_name, # type: str + name, # type: str + resource_group_name, # type: str + storage_account_credential, # type: "_models.StorageAccountCredential" + **kwargs # type: Any + ): + # type: (...) -> LROPoller["_models.StorageAccountCredential"] + """Creates or updates the storage account credential. + + :param device_name: The device name. + :type device_name: str + :param name: The storage account credential name. + :type name: str + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param storage_account_credential: The storage account credential. + :type storage_account_credential: ~azure.mgmt.databoxedge.v2020_09_01.models.StorageAccountCredential + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: Pass in True if you'd like the ARMPolling polling method, + False for no polling, or your own initialized polling object for a 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[~azure.mgmt.databoxedge.v2020_09_01.models.StorageAccountCredential] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.StorageAccountCredential"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._create_or_update_initial( + device_name=device_name, + name=name, + resource_group_name=resource_group_name, + storage_account_credential=storage_account_credential, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('StorageAccountCredential', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/storageAccountCredentials/{name}'} # type: ignore + + def _delete_initial( + self, + device_name, # type: str + name, # type: str + resource_group_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-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: Pass in True if you'd like the ARMPolling polling method, + False for no polling, or your own initialized polling object for a 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/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_09_01/operations/_storage_accounts_operations.py b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_09_01/operations/_storage_accounts_operations.py new file mode 100644 index 000000000000..4d5ae80068de --- /dev/null +++ b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_09_01/operations/_storage_accounts_operations.py @@ -0,0 +1,444 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.core.polling import LROPoller, NoPolling, PollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.arm_polling import ARMPolling + +from .. import models as _models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class StorageAccountsOperations(object): + """StorageAccountsOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.databoxedge.v2020_09_01.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list_by_data_box_edge_device( + self, + device_name, # type: str + resource_group_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.StorageAccountList"] + """Lists all the StorageAccounts in a Data Box Edge/Data Box Gateway device. + + Lists all the StorageAccounts in a Data Box Edge/Data Box Gateway device. + + :param device_name: The device name. + :type device_name: str + :param resource_group_name: The resource group name. + :type resource_group_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either StorageAccountList or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.databoxedge.v2020_09_01.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 = "2020-09-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: ~azure.mgmt.databoxedge.v2020_09_01.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 = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'storageAccountName': self._serialize.url("storage_account_name", storage_account_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('StorageAccount', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/storageAccounts/{storageAccountName}'} # type: ignore + + def _create_or_update_initial( + self, + device_name, # type: str + storage_account_name, # type: str + resource_group_name, # type: str + storage_account, # type: "_models.StorageAccount" + **kwargs # type: Any + ): + # type: (...) -> Optional["_models.StorageAccount"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.StorageAccount"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._create_or_update_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'storageAccountName': self._serialize.url("storage_account_name", storage_account_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(storage_account, 'StorageAccount') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('StorageAccount', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/storageAccounts/{storageAccountName}'} # type: ignore + + def begin_create_or_update( + self, + device_name, # type: str + storage_account_name, # type: str + resource_group_name, # type: str + storage_account, # type: "_models.StorageAccount" + **kwargs # type: Any + ): + # type: (...) -> LROPoller["_models.StorageAccount"] + """Creates a new StorageAccount or updates an existing StorageAccount on the device. + + Creates a new StorageAccount or updates an existing StorageAccount on the device. + + :param device_name: The device name. + :type device_name: str + :param storage_account_name: The StorageAccount name. + :type storage_account_name: str + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param storage_account: The StorageAccount properties. + :type storage_account: ~azure.mgmt.databoxedge.v2020_09_01.models.StorageAccount + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: Pass in True if you'd like the ARMPolling polling method, + False for no polling, or your own initialized polling object for a 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[~azure.mgmt.databoxedge.v2020_09_01.models.StorageAccount] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.StorageAccount"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._create_or_update_initial( + device_name=device_name, + storage_account_name=storage_account_name, + resource_group_name=resource_group_name, + storage_account=storage_account, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('StorageAccount', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'storageAccountName': self._serialize.url("storage_account_name", storage_account_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/storageAccounts/{storageAccountName}'} # type: ignore + + def _delete_initial( + self, + device_name, # type: str + storage_account_name, # type: str + resource_group_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-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: Pass in True if you'd like the ARMPolling polling method, + False for no polling, or your own initialized polling object for a 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/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_09_01/operations/_triggers_operations.py b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_09_01/operations/_triggers_operations.py new file mode 100644 index 000000000000..f6b42b941e51 --- /dev/null +++ b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_09_01/operations/_triggers_operations.py @@ -0,0 +1,444 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.core.polling import LROPoller, NoPolling, PollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.arm_polling import ARMPolling + +from .. import models as _models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class TriggersOperations(object): + """TriggersOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.databoxedge.v2020_09_01.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[~azure.mgmt.databoxedge.v2020_09_01.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 = "2020-09-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: ~azure.mgmt.databoxedge.v2020_09_01.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 = "2020-09-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 = "2020-09-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: ~azure.mgmt.databoxedge.v2020_09_01.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: Pass in True if you'd like the ARMPolling polling method, + False for no polling, or your own initialized polling object for a 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[~azure.mgmt.databoxedge.v2020_09_01.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 = "2020-09-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: Pass in True if you'd like the ARMPolling polling method, + False for no polling, or your own initialized polling object for a 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/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_09_01/operations/_users_operations.py b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_09_01/operations/_users_operations.py new file mode 100644 index 000000000000..aa8c34b50bf4 --- /dev/null +++ b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_09_01/operations/_users_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 as _models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class UsersOperations(object): + """UsersOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.databoxedge.v2020_09_01.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 + expand=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 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 UserList or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.databoxedge.v2020_09_01.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 = "2020-09-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 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('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: ~azure.mgmt.databoxedge.v2020_09_01.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 = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('User', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/users/{name}'} # type: ignore + + def _create_or_update_initial( + self, + device_name, # type: str + name, # type: str + resource_group_name, # type: str + user, # type: "_models.User" + **kwargs # type: Any + ): + # type: (...) -> Optional["_models.User"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.User"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._create_or_update_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(user, 'User') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('User', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/users/{name}'} # type: ignore + + def begin_create_or_update( + self, + device_name, # type: str + name, # type: str + resource_group_name, # type: str + user, # type: "_models.User" + **kwargs # type: Any + ): + # type: (...) -> LROPoller["_models.User"] + """Creates a new user or updates an existing user's information on a Data Box Edge/Data Box + Gateway device. + + :param device_name: The device name. + :type device_name: str + :param name: The user name. + :type name: str + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param user: The user details. + :type user: ~azure.mgmt.databoxedge.v2020_09_01.models.User + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: Pass in True if you'd like the ARMPolling polling method, + False for no polling, or your own initialized polling object for a 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[~azure.mgmt.databoxedge.v2020_09_01.models.User] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.User"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._create_or_update_initial( + device_name=device_name, + name=name, + resource_group_name=resource_group_name, + user=user, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('User', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/users/{name}'} # type: ignore + + def _delete_initial( + self, + device_name, # type: str + name, # type: str + resource_group_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-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: Pass in True if you'd like the ARMPolling polling method, + False for no polling, or your own initialized polling object for a 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/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_09_01/py.typed b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_09_01/py.typed new file mode 100644 index 000000000000..e5aff4f83af8 --- /dev/null +++ b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_09_01/py.typed @@ -0,0 +1 @@ +# Marker file for PEP 561. \ No newline at end of file diff --git a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_09_01_preview/__init__.py b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_09_01_preview/__init__.py new file mode 100644 index 000000000000..e63196b6b98f --- /dev/null +++ b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_09_01_preview/__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/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_09_01_preview/_configuration.py b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_09_01_preview/_configuration.py new file mode 100644 index 000000000000..47c80b2e85dc --- /dev/null +++ b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_09_01_preview/_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 = "2020-09-01-preview" + self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default']) + kwargs.setdefault('sdk_moniker', 'mgmt-databoxedge/{}'.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/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_09_01_preview/_data_box_edge_management_client.py b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_09_01_preview/_data_box_edge_management_client.py new file mode 100644 index 000000000000..71d0d3a836f6 --- /dev/null +++ b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_09_01_preview/_data_box_edge_management_client.py @@ -0,0 +1,174 @@ +# 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 azure.core.pipeline.transport import HttpRequest, HttpResponse + +from ._configuration import DataBoxEdgeManagementClientConfiguration +from .operations import Operations +from .operations import AvailableSkusOperations +from .operations import DevicesOperations +from .operations import AlertsOperations +from .operations import BandwidthSchedulesOperations +from .operations import JobsOperations +from .operations import NodesOperations +from .operations import OperationsStatusOperations +from .operations import OrdersOperations +from .operations import RolesOperations +from .operations import AddonsOperations +from .operations import MonitoringConfigOperations +from .operations import SharesOperations +from .operations import StorageAccountCredentialsOperations +from .operations import StorageAccountsOperations +from .operations import ContainersOperations +from .operations import TriggersOperations +from .operations import UsersOperations +from . import models + + +class DataBoxEdgeManagementClient(object): + """The DataBoxEdge Client. + + :ivar operations: Operations operations + :vartype operations: azure.mgmt.databoxedge.v2020_09_01_preview.operations.Operations + :ivar available_skus: AvailableSkusOperations operations + :vartype available_skus: azure.mgmt.databoxedge.v2020_09_01_preview.operations.AvailableSkusOperations + :ivar devices: DevicesOperations operations + :vartype devices: azure.mgmt.databoxedge.v2020_09_01_preview.operations.DevicesOperations + :ivar alerts: AlertsOperations operations + :vartype alerts: azure.mgmt.databoxedge.v2020_09_01_preview.operations.AlertsOperations + :ivar bandwidth_schedules: BandwidthSchedulesOperations operations + :vartype bandwidth_schedules: azure.mgmt.databoxedge.v2020_09_01_preview.operations.BandwidthSchedulesOperations + :ivar jobs: JobsOperations operations + :vartype jobs: azure.mgmt.databoxedge.v2020_09_01_preview.operations.JobsOperations + :ivar nodes: NodesOperations operations + :vartype nodes: azure.mgmt.databoxedge.v2020_09_01_preview.operations.NodesOperations + :ivar operations_status: OperationsStatusOperations operations + :vartype operations_status: azure.mgmt.databoxedge.v2020_09_01_preview.operations.OperationsStatusOperations + :ivar orders: OrdersOperations operations + :vartype orders: azure.mgmt.databoxedge.v2020_09_01_preview.operations.OrdersOperations + :ivar roles: RolesOperations operations + :vartype roles: azure.mgmt.databoxedge.v2020_09_01_preview.operations.RolesOperations + :ivar addons: AddonsOperations operations + :vartype addons: azure.mgmt.databoxedge.v2020_09_01_preview.operations.AddonsOperations + :ivar monitoring_config: MonitoringConfigOperations operations + :vartype monitoring_config: azure.mgmt.databoxedge.v2020_09_01_preview.operations.MonitoringConfigOperations + :ivar shares: SharesOperations operations + :vartype shares: azure.mgmt.databoxedge.v2020_09_01_preview.operations.SharesOperations + :ivar storage_account_credentials: StorageAccountCredentialsOperations operations + :vartype storage_account_credentials: azure.mgmt.databoxedge.v2020_09_01_preview.operations.StorageAccountCredentialsOperations + :ivar storage_accounts: StorageAccountsOperations operations + :vartype storage_accounts: azure.mgmt.databoxedge.v2020_09_01_preview.operations.StorageAccountsOperations + :ivar containers: ContainersOperations operations + :vartype containers: azure.mgmt.databoxedge.v2020_09_01_preview.operations.ContainersOperations + :ivar triggers: TriggersOperations operations + :vartype triggers: azure.mgmt.databoxedge.v2020_09_01_preview.operations.TriggersOperations + :ivar users: UsersOperations operations + :vartype users: azure.mgmt.databoxedge.v2020_09_01_preview.operations.UsersOperations + :param credential: Credential needed for the client to connect to Azure. + :type credential: ~azure.core.credentials.TokenCredential + :param subscription_id: The subscription ID. + :type subscription_id: str + :param str base_url: Service URL + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + """ + + def __init__( + self, + credential, # type: "TokenCredential" + subscription_id, # type: str + base_url=None, # type: Optional[str] + **kwargs # type: Any + ): + # type: (...) -> None + if not base_url: + base_url = 'https://management.azure.com' + self._config = DataBoxEdgeManagementClientConfiguration(credential, subscription_id, **kwargs) + self._client = ARMPipelineClient(base_url=base_url, config=self._config, **kwargs) + + client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} + self._serialize = Serializer(client_models) + self._serialize.client_side_validation = False + self._deserialize = Deserializer(client_models) + + self.operations = Operations( + self._client, self._config, self._serialize, self._deserialize) + self.available_skus = AvailableSkusOperations( + self._client, self._config, self._serialize, self._deserialize) + self.devices = DevicesOperations( + self._client, self._config, self._serialize, self._deserialize) + self.alerts = AlertsOperations( + self._client, self._config, self._serialize, self._deserialize) + self.bandwidth_schedules = BandwidthSchedulesOperations( + self._client, self._config, self._serialize, self._deserialize) + self.jobs = JobsOperations( + self._client, self._config, self._serialize, self._deserialize) + self.nodes = NodesOperations( + self._client, self._config, self._serialize, self._deserialize) + self.operations_status = OperationsStatusOperations( + self._client, self._config, self._serialize, self._deserialize) + self.orders = OrdersOperations( + self._client, self._config, self._serialize, self._deserialize) + self.roles = RolesOperations( + self._client, self._config, self._serialize, self._deserialize) + self.addons = AddonsOperations( + self._client, self._config, self._serialize, self._deserialize) + self.monitoring_config = MonitoringConfigOperations( + self._client, self._config, self._serialize, self._deserialize) + self.shares = SharesOperations( + self._client, self._config, self._serialize, self._deserialize) + self.storage_account_credentials = StorageAccountCredentialsOperations( + self._client, self._config, self._serialize, self._deserialize) + self.storage_accounts = StorageAccountsOperations( + self._client, self._config, self._serialize, self._deserialize) + self.containers = ContainersOperations( + self._client, self._config, self._serialize, self._deserialize) + self.triggers = TriggersOperations( + self._client, self._config, self._serialize, self._deserialize) + self.users = UsersOperations( + self._client, self._config, self._serialize, self._deserialize) + + def _send_request(self, http_request, **kwargs): + # type: (HttpRequest, Any) -> HttpResponse + """Runs the network request through the client's chained policies. + + :param http_request: The network request you want to make. Required. + :type http_request: ~azure.core.pipeline.transport.HttpRequest + :keyword bool stream: Whether the response payload will be streamed. Defaults to True. + :return: The response of your network call. Does not do error handling on your response. + :rtype: ~azure.core.pipeline.transport.HttpResponse + """ + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + http_request.url = self._client.format_url(http_request.url, **path_format_arguments) + stream = kwargs.pop("stream", True) + pipeline_response = self._client._pipeline.run(http_request, stream=stream, **kwargs) + return pipeline_response.http_response + + 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/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_09_01_preview/_metadata.json b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_09_01_preview/_metadata.json new file mode 100644 index 000000000000..8f4872654ff2 --- /dev/null +++ b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_09_01_preview/_metadata.json @@ -0,0 +1,120 @@ +{ + "chosen_version": "2020-09-01-preview", + "total_api_version_list": ["2020-09-01-preview"], + "client": { + "name": "DataBoxEdgeManagementClient", + "filename": "_data_box_edge_management_client", + "description": "The DataBoxEdge Client.", + "base_url": "\u0027https://management.azure.com\u0027", + "custom_base_url": null, + "azure_arm": true, + "has_lro_operations": true, + "client_side_validation": false, + "sync_imports": "{\"typing\": {\"azurecore\": {\"azure.core.credentials\": [\"TokenCredential\"]}}, \"regular\": {\"azurecore\": {\"azure.profiles\": [\"KnownProfiles\", \"ProfileDefinition\"], \"azure.profiles.multiapiclient\": [\"MultiApiClientMixin\"], \"msrest\": [\"Deserializer\", \"Serializer\"], \"azure.mgmt.core\": [\"ARMPipelineClient\"]}, \"local\": {\"._configuration\": [\"DataBoxEdgeManagementClientConfiguration\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}, \"azurecore\": {\"azure.core.pipeline.transport\": [\"HttpRequest\", \"HttpResponse\"]}}}", + "async_imports": "{\"typing\": {\"azurecore\": {\"azure.core.credentials_async\": [\"AsyncTokenCredential\"]}}, \"regular\": {\"azurecore\": {\"azure.profiles\": [\"KnownProfiles\", \"ProfileDefinition\"], \"azure.profiles.multiapiclient\": [\"MultiApiClientMixin\"], \"msrest\": [\"Deserializer\", \"Serializer\"], \"azure.mgmt.core\": [\"AsyncARMPipelineClient\"]}, \"local\": {\"._configuration\": [\"DataBoxEdgeManagementClientConfiguration\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}, \"azurecore\": {\"azure.core.pipeline.transport\": [\"AsyncHttpResponse\", \"HttpRequest\"]}}}" + }, + "global_parameters": { + "sync": { + "credential": { + "signature": "credential, # type: \"TokenCredential\"", + "description": "Credential needed for the client to connect to Azure.", + "docstring_type": "~azure.core.credentials.TokenCredential", + "required": true + }, + "subscription_id": { + "signature": "subscription_id, # type: str", + "description": "The subscription ID.", + "docstring_type": "str", + "required": true + } + }, + "async": { + "credential": { + "signature": "credential: \"AsyncTokenCredential\",", + "description": "Credential needed for the client to connect to Azure.", + "docstring_type": "~azure.core.credentials_async.AsyncTokenCredential", + "required": true + }, + "subscription_id": { + "signature": "subscription_id: str,", + "description": "The subscription ID.", + "docstring_type": "str", + "required": true + } + }, + "constant": { + }, + "call": "credential, subscription_id", + "service_client_specific": { + "sync": { + "api_version": { + "signature": "api_version=None, # type: Optional[str]", + "description": "API version to use if no profile is provided, or if missing in profile.", + "docstring_type": "str", + "required": false + }, + "base_url": { + "signature": "base_url=None, # type: Optional[str]", + "description": "Service URL", + "docstring_type": "str", + "required": false + }, + "profile": { + "signature": "profile=KnownProfiles.default, # type: KnownProfiles", + "description": "A profile definition, from KnownProfiles to dict.", + "docstring_type": "azure.profiles.KnownProfiles", + "required": false + } + }, + "async": { + "api_version": { + "signature": "api_version: Optional[str] = None,", + "description": "API version to use if no profile is provided, or if missing in profile.", + "docstring_type": "str", + "required": false + }, + "base_url": { + "signature": "base_url: Optional[str] = None,", + "description": "Service URL", + "docstring_type": "str", + "required": false + }, + "profile": { + "signature": "profile: KnownProfiles = KnownProfiles.default,", + "description": "A profile definition, from KnownProfiles to dict.", + "docstring_type": "azure.profiles.KnownProfiles", + "required": false + } + } + } + }, + "config": { + "credential": true, + "credential_scopes": ["https://management.azure.com/.default"], + "credential_default_policy_type": "BearerTokenCredentialPolicy", + "credential_default_policy_type_has_async_version": true, + "credential_key_header_name": null, + "sync_imports": "{\"regular\": {\"azurecore\": {\"azure.core.configuration\": [\"Configuration\"], \"azure.core.pipeline\": [\"policies\"], \"azure.mgmt.core.policies\": [\"ARMHttpLoggingPolicy\"]}, \"local\": {\"._version\": [\"VERSION\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\"]}}, \"typing\": {\"azurecore\": {\"azure.core.credentials\": [\"TokenCredential\"]}}}", + "async_imports": "{\"regular\": {\"azurecore\": {\"azure.core.configuration\": [\"Configuration\"], \"azure.core.pipeline\": [\"policies\"], \"azure.mgmt.core.policies\": [\"ARMHttpLoggingPolicy\"]}, \"local\": {\".._version\": [\"VERSION\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\"]}}, \"typing\": {\"azurecore\": {\"azure.core.credentials_async\": [\"AsyncTokenCredential\"]}}}" + }, + "operation_groups": { + "operations": "Operations", + "available_skus": "AvailableSkusOperations", + "devices": "DevicesOperations", + "alerts": "AlertsOperations", + "bandwidth_schedules": "BandwidthSchedulesOperations", + "jobs": "JobsOperations", + "nodes": "NodesOperations", + "operations_status": "OperationsStatusOperations", + "orders": "OrdersOperations", + "roles": "RolesOperations", + "addons": "AddonsOperations", + "monitoring_config": "MonitoringConfigOperations", + "shares": "SharesOperations", + "storage_account_credentials": "StorageAccountCredentialsOperations", + "storage_accounts": "StorageAccountsOperations", + "containers": "ContainersOperations", + "triggers": "TriggersOperations", + "users": "UsersOperations" + } +} \ No newline at end of file diff --git a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_09_01_preview/aio/__init__.py b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_09_01_preview/aio/__init__.py new file mode 100644 index 000000000000..c33d46ee91d8 --- /dev/null +++ b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_09_01_preview/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/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_09_01_preview/aio/_configuration.py b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_09_01_preview/aio/_configuration.py new file mode 100644 index 000000000000..b545e589e3d1 --- /dev/null +++ b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_09_01_preview/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 = "2020-09-01-preview" + self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default']) + kwargs.setdefault('sdk_moniker', 'mgmt-databoxedge/{}'.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/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_09_01_preview/aio/_data_box_edge_management_client.py b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_09_01_preview/aio/_data_box_edge_management_client.py new file mode 100644 index 000000000000..7b23ab727068 --- /dev/null +++ b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_09_01_preview/aio/_data_box_edge_management_client.py @@ -0,0 +1,167 @@ +# 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.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.mgmt.core import AsyncARMPipelineClient +from msrest import Deserializer, Serializer + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from azure.core.credentials_async import AsyncTokenCredential + +from ._configuration import DataBoxEdgeManagementClientConfiguration +from .operations import Operations +from .operations import AvailableSkusOperations +from .operations import DevicesOperations +from .operations import AlertsOperations +from .operations import BandwidthSchedulesOperations +from .operations import JobsOperations +from .operations import NodesOperations +from .operations import OperationsStatusOperations +from .operations import OrdersOperations +from .operations import RolesOperations +from .operations import AddonsOperations +from .operations import MonitoringConfigOperations +from .operations import SharesOperations +from .operations import StorageAccountCredentialsOperations +from .operations import StorageAccountsOperations +from .operations import ContainersOperations +from .operations import TriggersOperations +from .operations import UsersOperations +from .. import models + + +class DataBoxEdgeManagementClient(object): + """The DataBoxEdge Client. + + :ivar operations: Operations operations + :vartype operations: azure.mgmt.databoxedge.v2020_09_01_preview.aio.operations.Operations + :ivar available_skus: AvailableSkusOperations operations + :vartype available_skus: azure.mgmt.databoxedge.v2020_09_01_preview.aio.operations.AvailableSkusOperations + :ivar devices: DevicesOperations operations + :vartype devices: azure.mgmt.databoxedge.v2020_09_01_preview.aio.operations.DevicesOperations + :ivar alerts: AlertsOperations operations + :vartype alerts: azure.mgmt.databoxedge.v2020_09_01_preview.aio.operations.AlertsOperations + :ivar bandwidth_schedules: BandwidthSchedulesOperations operations + :vartype bandwidth_schedules: azure.mgmt.databoxedge.v2020_09_01_preview.aio.operations.BandwidthSchedulesOperations + :ivar jobs: JobsOperations operations + :vartype jobs: azure.mgmt.databoxedge.v2020_09_01_preview.aio.operations.JobsOperations + :ivar nodes: NodesOperations operations + :vartype nodes: azure.mgmt.databoxedge.v2020_09_01_preview.aio.operations.NodesOperations + :ivar operations_status: OperationsStatusOperations operations + :vartype operations_status: azure.mgmt.databoxedge.v2020_09_01_preview.aio.operations.OperationsStatusOperations + :ivar orders: OrdersOperations operations + :vartype orders: azure.mgmt.databoxedge.v2020_09_01_preview.aio.operations.OrdersOperations + :ivar roles: RolesOperations operations + :vartype roles: azure.mgmt.databoxedge.v2020_09_01_preview.aio.operations.RolesOperations + :ivar addons: AddonsOperations operations + :vartype addons: azure.mgmt.databoxedge.v2020_09_01_preview.aio.operations.AddonsOperations + :ivar monitoring_config: MonitoringConfigOperations operations + :vartype monitoring_config: azure.mgmt.databoxedge.v2020_09_01_preview.aio.operations.MonitoringConfigOperations + :ivar shares: SharesOperations operations + :vartype shares: azure.mgmt.databoxedge.v2020_09_01_preview.aio.operations.SharesOperations + :ivar storage_account_credentials: StorageAccountCredentialsOperations operations + :vartype storage_account_credentials: azure.mgmt.databoxedge.v2020_09_01_preview.aio.operations.StorageAccountCredentialsOperations + :ivar storage_accounts: StorageAccountsOperations operations + :vartype storage_accounts: azure.mgmt.databoxedge.v2020_09_01_preview.aio.operations.StorageAccountsOperations + :ivar containers: ContainersOperations operations + :vartype containers: azure.mgmt.databoxedge.v2020_09_01_preview.aio.operations.ContainersOperations + :ivar triggers: TriggersOperations operations + :vartype triggers: azure.mgmt.databoxedge.v2020_09_01_preview.aio.operations.TriggersOperations + :ivar users: UsersOperations operations + :vartype users: azure.mgmt.databoxedge.v2020_09_01_preview.aio.operations.UsersOperations + :param credential: Credential needed for the client to connect to Azure. + :type credential: ~azure.core.credentials_async.AsyncTokenCredential + :param subscription_id: The subscription ID. + :type subscription_id: str + :param str base_url: Service URL + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + """ + + def __init__( + self, + credential: "AsyncTokenCredential", + subscription_id: str, + base_url: Optional[str] = None, + **kwargs: Any + ) -> None: + if not base_url: + base_url = 'https://management.azure.com' + self._config = DataBoxEdgeManagementClientConfiguration(credential, subscription_id, **kwargs) + self._client = AsyncARMPipelineClient(base_url=base_url, config=self._config, **kwargs) + + client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} + self._serialize = Serializer(client_models) + self._serialize.client_side_validation = False + self._deserialize = Deserializer(client_models) + + self.operations = Operations( + self._client, self._config, self._serialize, self._deserialize) + self.available_skus = AvailableSkusOperations( + self._client, self._config, self._serialize, self._deserialize) + self.devices = DevicesOperations( + self._client, self._config, self._serialize, self._deserialize) + self.alerts = AlertsOperations( + self._client, self._config, self._serialize, self._deserialize) + self.bandwidth_schedules = BandwidthSchedulesOperations( + self._client, self._config, self._serialize, self._deserialize) + self.jobs = JobsOperations( + self._client, self._config, self._serialize, self._deserialize) + self.nodes = NodesOperations( + self._client, self._config, self._serialize, self._deserialize) + self.operations_status = OperationsStatusOperations( + self._client, self._config, self._serialize, self._deserialize) + self.orders = OrdersOperations( + self._client, self._config, self._serialize, self._deserialize) + self.roles = RolesOperations( + self._client, self._config, self._serialize, self._deserialize) + self.addons = AddonsOperations( + self._client, self._config, self._serialize, self._deserialize) + self.monitoring_config = MonitoringConfigOperations( + self._client, self._config, self._serialize, self._deserialize) + self.shares = SharesOperations( + self._client, self._config, self._serialize, self._deserialize) + self.storage_account_credentials = StorageAccountCredentialsOperations( + self._client, self._config, self._serialize, self._deserialize) + self.storage_accounts = StorageAccountsOperations( + self._client, self._config, self._serialize, self._deserialize) + self.containers = ContainersOperations( + self._client, self._config, self._serialize, self._deserialize) + self.triggers = TriggersOperations( + self._client, self._config, self._serialize, self._deserialize) + self.users = UsersOperations( + self._client, self._config, self._serialize, self._deserialize) + + async def _send_request(self, http_request: HttpRequest, **kwargs: Any) -> AsyncHttpResponse: + """Runs the network request through the client's chained policies. + + :param http_request: The network request you want to make. Required. + :type http_request: ~azure.core.pipeline.transport.HttpRequest + :keyword bool stream: Whether the response payload will be streamed. Defaults to True. + :return: The response of your network call. Does not do error handling on your response. + :rtype: ~azure.core.pipeline.transport.AsyncHttpResponse + """ + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + http_request.url = self._client.format_url(http_request.url, **path_format_arguments) + stream = kwargs.pop("stream", True) + pipeline_response = await self._client._pipeline.run(http_request, stream=stream, **kwargs) + return pipeline_response.http_response + + 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/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_09_01_preview/aio/operations/__init__.py b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_09_01_preview/aio/operations/__init__.py new file mode 100644 index 000000000000..d70057be6458 --- /dev/null +++ b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_09_01_preview/aio/operations/__init__.py @@ -0,0 +1,47 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from ._operations import Operations +from ._available_skus_operations import AvailableSkusOperations +from ._devices_operations import DevicesOperations +from ._alerts_operations import AlertsOperations +from ._bandwidth_schedules_operations import BandwidthSchedulesOperations +from ._jobs_operations import JobsOperations +from ._nodes_operations import NodesOperations +from ._operations_status_operations import OperationsStatusOperations +from ._orders_operations import OrdersOperations +from ._roles_operations import RolesOperations +from ._addons_operations import AddonsOperations +from ._monitoring_config_operations import MonitoringConfigOperations +from ._shares_operations import SharesOperations +from ._storage_account_credentials_operations import StorageAccountCredentialsOperations +from ._storage_accounts_operations import StorageAccountsOperations +from ._containers_operations import ContainersOperations +from ._triggers_operations import TriggersOperations +from ._users_operations import UsersOperations + +__all__ = [ + 'Operations', + 'AvailableSkusOperations', + 'DevicesOperations', + 'AlertsOperations', + 'BandwidthSchedulesOperations', + 'JobsOperations', + 'NodesOperations', + 'OperationsStatusOperations', + 'OrdersOperations', + 'RolesOperations', + 'AddonsOperations', + 'MonitoringConfigOperations', + 'SharesOperations', + 'StorageAccountCredentialsOperations', + 'StorageAccountsOperations', + 'ContainersOperations', + 'TriggersOperations', + 'UsersOperations', +] diff --git a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_09_01_preview/aio/operations/_addons_operations.py b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_09_01_preview/aio/operations/_addons_operations.py new file mode 100644 index 000000000000..86490d757f0c --- /dev/null +++ b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_09_01_preview/aio/operations/_addons_operations.py @@ -0,0 +1,450 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling + +from ... import models as _models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class AddonsOperations: + """AddonsOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.databoxedge.v2020_09_01_preview.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list_by_role( + self, + device_name: str, + role_name: str, + resource_group_name: str, + **kwargs + ) -> AsyncIterable["_models.AddonList"]: + """Lists all the addons configured in the role. + + :param device_name: The device name. + :type device_name: str + :param role_name: The role name. + :type role_name: str + :param resource_group_name: The resource group name. + :type resource_group_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either AddonList or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.databoxedge.v2020_09_01_preview.models.AddonList] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.AddonList"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01-preview" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_by_role.metadata['url'] # type: ignore + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'roleName': self._serialize.url("role_name", role_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('AddonList', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_by_role.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/roles/{roleName}/addons'} # type: ignore + + async def get( + self, + device_name: str, + role_name: str, + addon_name: str, + resource_group_name: str, + **kwargs + ) -> "_models.Addon": + """Gets a specific addon by name. + + :param device_name: The device name. + :type device_name: str + :param role_name: The role name. + :type role_name: str + :param addon_name: The addon name. + :type addon_name: str + :param resource_group_name: The resource group name. + :type resource_group_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: Addon, or the result of cls(response) + :rtype: ~azure.mgmt.databoxedge.v2020_09_01_preview.models.Addon + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.Addon"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01-preview" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'roleName': self._serialize.url("role_name", role_name, 'str'), + 'addonName': self._serialize.url("addon_name", addon_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('Addon', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/roles/{roleName}/addons/{addonName}'} # type: ignore + + async def _create_or_update_initial( + self, + device_name: str, + role_name: str, + addon_name: str, + resource_group_name: str, + addon: "_models.Addon", + **kwargs + ) -> Optional["_models.Addon"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.Addon"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01-preview" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._create_or_update_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'roleName': self._serialize.url("role_name", role_name, 'str'), + 'addonName': self._serialize.url("addon_name", addon_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(addon, 'Addon') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('Addon', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/roles/{roleName}/addons/{addonName}'} # type: ignore + + async def begin_create_or_update( + self, + device_name: str, + role_name: str, + addon_name: str, + resource_group_name: str, + addon: "_models.Addon", + **kwargs + ) -> AsyncLROPoller["_models.Addon"]: + """Create or update a addon. + + :param device_name: The device name. + :type device_name: str + :param role_name: The role name. + :type role_name: str + :param addon_name: The addon name. + :type addon_name: str + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param addon: The addon properties. + :type addon: ~azure.mgmt.databoxedge.v2020_09_01_preview.models.Addon + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: Pass in True if you'd like the AsyncARMPolling polling method, + False for no polling, or your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either Addon or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.databoxedge.v2020_09_01_preview.models.Addon] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Addon"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._create_or_update_initial( + device_name=device_name, + role_name=role_name, + addon_name=addon_name, + resource_group_name=resource_group_name, + addon=addon, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('Addon', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'roleName': self._serialize.url("role_name", role_name, 'str'), + 'addonName': self._serialize.url("addon_name", addon_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/roles/{roleName}/addons/{addonName}'} # type: ignore + + async def _delete_initial( + self, + device_name: str, + role_name: str, + addon_name: str, + resource_group_name: str, + **kwargs + ) -> None: + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01-preview" + accept = "application/json" + + # Construct URL + url = self._delete_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'roleName': self._serialize.url("role_name", role_name, 'str'), + 'addonName': self._serialize.url("addon_name", addon_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/roles/{roleName}/addons/{addonName}'} # type: ignore + + async def begin_delete( + self, + device_name: str, + role_name: str, + addon_name: str, + resource_group_name: str, + **kwargs + ) -> AsyncLROPoller[None]: + """Deletes the addon on the device. + + :param device_name: The device name. + :type device_name: str + :param role_name: The role name. + :type role_name: str + :param addon_name: The addon name. + :type addon_name: str + :param resource_group_name: The resource group name. + :type resource_group_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: Pass in True if you'd like the AsyncARMPolling polling method, + False for no polling, or your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._delete_initial( + device_name=device_name, + role_name=role_name, + addon_name=addon_name, + resource_group_name=resource_group_name, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'roleName': self._serialize.url("role_name", role_name, 'str'), + 'addonName': self._serialize.url("addon_name", addon_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/roles/{roleName}/addons/{addonName}'} # type: ignore diff --git a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_09_01_preview/aio/operations/_alerts_operations.py b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_09_01_preview/aio/operations/_alerts_operations.py new file mode 100644 index 000000000000..1df491e86495 --- /dev/null +++ b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_09_01_preview/aio/operations/_alerts_operations.py @@ -0,0 +1,180 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.mgmt.core.exceptions import ARMErrorFormat + +from ... import models as _models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class AlertsOperations: + """AlertsOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.databoxedge.v2020_09_01_preview.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[~azure.mgmt.databoxedge.v2020_09_01_preview.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 = "2020-09-01-preview" + 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: ~azure.mgmt.databoxedge.v2020_09_01_preview.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 = "2020-09-01-preview" + 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/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_09_01_preview/aio/operations/_available_skus_operations.py b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_09_01_preview/aio/operations/_available_skus_operations.py new file mode 100644 index 000000000000..4e0b2b5bcddf --- /dev/null +++ b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_09_01_preview/aio/operations/_available_skus_operations.py @@ -0,0 +1,110 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.mgmt.core.exceptions import ARMErrorFormat + +from ... import models as _models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class AvailableSkusOperations: + """AvailableSkusOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.databoxedge.v2020_09_01_preview.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list( + self, + **kwargs + ) -> AsyncIterable["_models.DataBoxEdgeSkuList"]: + """List all the available Skus and information related to them. + + List all the available Skus and information related to them. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either DataBoxEdgeSkuList or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.databoxedge.v2020_09_01_preview.models.DataBoxEdgeSkuList] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.DataBoxEdgeSkuList"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01-preview" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('DataBoxEdgeSkuList', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.DataBoxEdge/availableSkus'} # type: ignore diff --git a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_09_01_preview/aio/operations/_bandwidth_schedules_operations.py b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_09_01_preview/aio/operations/_bandwidth_schedules_operations.py new file mode 100644 index 000000000000..8885812017bd --- /dev/null +++ b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_09_01_preview/aio/operations/_bandwidth_schedules_operations.py @@ -0,0 +1,428 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling + +from ... import models as _models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class BandwidthSchedulesOperations: + """BandwidthSchedulesOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.databoxedge.v2020_09_01_preview.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[~azure.mgmt.databoxedge.v2020_09_01_preview.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 = "2020-09-01-preview" + 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: ~azure.mgmt.databoxedge.v2020_09_01_preview.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 = "2020-09-01-preview" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('BandwidthSchedule', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/bandwidthSchedules/{name}'} # type: ignore + + async def _create_or_update_initial( + self, + device_name: str, + name: str, + resource_group_name: str, + parameters: "_models.BandwidthSchedule", + **kwargs + ) -> Optional["_models.BandwidthSchedule"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.BandwidthSchedule"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01-preview" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._create_or_update_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, 'BandwidthSchedule') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('BandwidthSchedule', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/bandwidthSchedules/{name}'} # type: ignore + + async def begin_create_or_update( + self, + device_name: str, + name: str, + resource_group_name: str, + parameters: "_models.BandwidthSchedule", + **kwargs + ) -> AsyncLROPoller["_models.BandwidthSchedule"]: + """Creates or updates a bandwidth schedule. + + :param device_name: The device name. + :type device_name: str + :param name: The bandwidth schedule name which needs to be added/updated. + :type name: str + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param parameters: The bandwidth schedule to be added or updated. + :type parameters: ~azure.mgmt.databoxedge.v2020_09_01_preview.models.BandwidthSchedule + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: Pass in True if you'd like the AsyncARMPolling polling method, + False for no polling, or your own initialized polling object for a 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[~azure.mgmt.databoxedge.v2020_09_01_preview.models.BandwidthSchedule] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.BandwidthSchedule"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._create_or_update_initial( + device_name=device_name, + name=name, + resource_group_name=resource_group_name, + parameters=parameters, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('BandwidthSchedule', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/bandwidthSchedules/{name}'} # type: ignore + + async def _delete_initial( + self, + device_name: str, + name: str, + resource_group_name: str, + **kwargs + ) -> None: + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01-preview" + 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: Pass in True if you'd like the AsyncARMPolling polling method, + False for no polling, or your own initialized polling object for a 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/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_09_01_preview/aio/operations/_containers_operations.py b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_09_01_preview/aio/operations/_containers_operations.py new file mode 100644 index 000000000000..0d8b3454251d --- /dev/null +++ b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_09_01_preview/aio/operations/_containers_operations.py @@ -0,0 +1,580 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling + +from ... import models as _models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class ContainersOperations: + """ContainersOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.databoxedge.v2020_09_01_preview.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[~azure.mgmt.databoxedge.v2020_09_01_preview.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 = "2020-09-01-preview" + 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: ~azure.mgmt.databoxedge.v2020_09_01_preview.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 = "2020-09-01-preview" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'storageAccountName': self._serialize.url("storage_account_name", storage_account_name, 'str'), + 'containerName': self._serialize.url("container_name", container_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('Container', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/storageAccounts/{storageAccountName}/containers/{containerName}'} # type: ignore + + async def _create_or_update_initial( + self, + device_name: str, + storage_account_name: str, + container_name: str, + resource_group_name: str, + container: "_models.Container", + **kwargs + ) -> Optional["_models.Container"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.Container"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01-preview" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._create_or_update_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'storageAccountName': self._serialize.url("storage_account_name", storage_account_name, 'str'), + 'containerName': self._serialize.url("container_name", container_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(container, 'Container') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('Container', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/storageAccounts/{storageAccountName}/containers/{containerName}'} # type: ignore + + async def begin_create_or_update( + self, + device_name: str, + storage_account_name: str, + container_name: str, + resource_group_name: str, + container: "_models.Container", + **kwargs + ) -> AsyncLROPoller["_models.Container"]: + """Creates a new container or updates an existing container on the device. + + Creates a new container or updates an existing container on the device. + + :param device_name: The device name. + :type device_name: str + :param storage_account_name: The Storage Account Name. + :type storage_account_name: str + :param container_name: The container name. + :type container_name: str + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param container: The container properties. + :type container: ~azure.mgmt.databoxedge.v2020_09_01_preview.models.Container + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: Pass in True if you'd like the AsyncARMPolling polling method, + False for no polling, or your own initialized polling object for a 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[~azure.mgmt.databoxedge.v2020_09_01_preview.models.Container] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Container"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._create_or_update_initial( + device_name=device_name, + storage_account_name=storage_account_name, + container_name=container_name, + resource_group_name=resource_group_name, + container=container, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('Container', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'storageAccountName': self._serialize.url("storage_account_name", storage_account_name, 'str'), + 'containerName': self._serialize.url("container_name", container_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/storageAccounts/{storageAccountName}/containers/{containerName}'} # type: ignore + + async def _delete_initial( + self, + device_name: str, + storage_account_name: str, + container_name: str, + resource_group_name: str, + **kwargs + ) -> None: + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01-preview" + 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: Pass in True if you'd like the AsyncARMPolling polling method, + False for no polling, or your own initialized polling object for a 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 = "2020-09-01-preview" + 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: Pass in True if you'd like the AsyncARMPolling polling method, + False for no polling, or your own initialized polling object for a 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/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_09_01_preview/aio/operations/_devices_operations.py b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_09_01_preview/aio/operations/_devices_operations.py new file mode 100644 index 000000000000..52cdbc54ff00 --- /dev/null +++ b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_09_01_preview/aio/operations/_devices_operations.py @@ -0,0 +1,1363 @@ +# 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 as _models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class DevicesOperations: + """DevicesOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.databoxedge.v2020_09_01_preview.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[~azure.mgmt.databoxedge.v2020_09_01_preview.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 = "2020-09-01-preview" + 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[~azure.mgmt.databoxedge.v2020_09_01_preview.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 = "2020-09-01-preview" + 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: ~azure.mgmt.databoxedge.v2020_09_01_preview.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 = "2020-09-01-preview" + 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, + data_box_edge_device: "_models.DataBoxEdgeDevice", + **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', {})) + api_version = "2020-09-01-preview" + 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, + data_box_edge_device: "_models.DataBoxEdgeDevice", + **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 data_box_edge_device: The resource object. + :type data_box_edge_device: ~azure.mgmt.databoxedge.v2020_09_01_preview.models.DataBoxEdgeDevice + :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: Pass in True if you'd like the AsyncARMPolling polling method, + False for no polling, or your own initialized polling object for a 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[~azure.mgmt.databoxedge.v2020_09_01_preview.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, + data_box_edge_device=data_box_edge_device, + 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 = "2020-09-01-preview" + 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: Pass in True if you'd like the AsyncARMPolling polling method, + False for no polling, or your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._delete_initial( + device_name=device_name, + resource_group_name=resource_group_name, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}'} # type: ignore + + async def update( + self, + device_name: str, + resource_group_name: str, + parameters: "_models.DataBoxEdgeDevicePatch", + **kwargs + ) -> "_models.DataBoxEdgeDevice": + """Modifies a Data Box Edge/Data Box Gateway resource. + + :param device_name: The device name. + :type device_name: str + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param parameters: The resource parameters. + :type parameters: ~azure.mgmt.databoxedge.v2020_09_01_preview.models.DataBoxEdgeDevicePatch + :keyword callable cls: A custom type or function that will be passed the direct response + :return: DataBoxEdgeDevice, or the result of cls(response) + :rtype: ~azure.mgmt.databoxedge.v2020_09_01_preview.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 = "2020-09-01-preview" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update.metadata['url'] # type: ignore + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, 'DataBoxEdgeDevicePatch') + body_content_kwargs['content'] = body_content + request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('DataBoxEdgeDevice', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}'} # type: ignore + + async def _download_updates_initial( + self, + device_name: str, + resource_group_name: str, + **kwargs + ) -> None: + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01-preview" + accept = "application/json" + + # Construct URL + url = self._download_updates_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _download_updates_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/downloadUpdates'} # type: ignore + + async def begin_download_updates( + self, + device_name: str, + resource_group_name: str, + **kwargs + ) -> AsyncLROPoller[None]: + """Downloads the updates on a Data Box Edge/Data Box Gateway device. + + Downloads the updates on a Data Box Edge/Data Box Gateway device. + + :param device_name: The device name. + :type device_name: str + :param resource_group_name: The resource group name. + :type resource_group_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: Pass in True if you'd like the AsyncARMPolling polling method, + False for no polling, or your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._download_updates_initial( + device_name=device_name, + resource_group_name=resource_group_name, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_download_updates.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/downloadUpdates'} # type: ignore + + async def generate_certificate( + self, + device_name: str, + resource_group_name: str, + **kwargs + ) -> "_models.GenerateCertResponse": + """Generates certificate for activation key. + + :param device_name: The device name. + :type device_name: str + :param resource_group_name: The resource group name. + :type resource_group_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: GenerateCertResponse, or the result of cls(response) + :rtype: ~azure.mgmt.databoxedge.v2020_09_01_preview.models.GenerateCertResponse + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.GenerateCertResponse"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01-preview" + accept = "application/json" + + # Construct URL + url = self.generate_certificate.metadata['url'] # type: ignore + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('GenerateCertResponse', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + generate_certificate.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/generateCertificate'} # type: ignore + + async def get_extended_information( + self, + device_name: str, + resource_group_name: str, + **kwargs + ) -> "_models.DataBoxEdgeDeviceExtendedInfo": + """Gets additional information for the specified Azure Stack Edge/Data Box Gateway device. + + :param device_name: The device name. + :type device_name: str + :param resource_group_name: The resource group name. + :type resource_group_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: DataBoxEdgeDeviceExtendedInfo, or the result of cls(response) + :rtype: ~azure.mgmt.databoxedge.v2020_09_01_preview.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 = "2020-09-01-preview" + accept = "application/json" + + # Construct URL + url = self.get_extended_information.metadata['url'] # type: ignore + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('DataBoxEdgeDeviceExtendedInfo', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_extended_information.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/getExtendedInformation'} # type: ignore + + async def _install_updates_initial( + self, + device_name: str, + resource_group_name: str, + **kwargs + ) -> None: + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01-preview" + accept = "application/json" + + # Construct URL + url = self._install_updates_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _install_updates_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/installUpdates'} # type: ignore + + async def begin_install_updates( + self, + device_name: str, + resource_group_name: str, + **kwargs + ) -> AsyncLROPoller[None]: + """Installs the updates on the Data Box Edge/Data Box Gateway device. + + Installs the updates on the Data Box Edge/Data Box Gateway device. + + :param device_name: The device name. + :type device_name: str + :param resource_group_name: The resource group name. + :type resource_group_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: Pass in True if you'd like the AsyncARMPolling polling method, + False for no polling, or your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._install_updates_initial( + device_name=device_name, + resource_group_name=resource_group_name, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_install_updates.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/installUpdates'} # type: ignore + + async def get_network_settings( + self, + device_name: str, + resource_group_name: str, + **kwargs + ) -> "_models.NetworkSettings": + """Gets the network settings of the specified Data Box Edge/Data Box Gateway device. + + :param device_name: The device name. + :type device_name: str + :param resource_group_name: The resource group name. + :type resource_group_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: NetworkSettings, or the result of cls(response) + :rtype: ~azure.mgmt.databoxedge.v2020_09_01_preview.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 = "2020-09-01-preview" + accept = "application/json" + + # Construct URL + url = self.get_network_settings.metadata['url'] # type: ignore + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('NetworkSettings', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_network_settings.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/networkSettings/default'} # type: ignore + + async def _scan_for_updates_initial( + self, + device_name: str, + resource_group_name: str, + **kwargs + ) -> None: + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01-preview" + accept = "application/json" + + # Construct URL + url = self._scan_for_updates_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _scan_for_updates_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/scanForUpdates'} # type: ignore + + async def begin_scan_for_updates( + self, + device_name: str, + resource_group_name: str, + **kwargs + ) -> AsyncLROPoller[None]: + """Scans for updates on a Data Box Edge/Data Box Gateway device. + + Scans for updates on a Data Box Edge/Data Box Gateway device. + + :param device_name: The device name. + :type device_name: str + :param resource_group_name: The resource group name. + :type resource_group_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: Pass in True if you'd like the AsyncARMPolling polling method, + False for no polling, or your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._scan_for_updates_initial( + device_name=device_name, + resource_group_name=resource_group_name, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_scan_for_updates.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/scanForUpdates'} # type: ignore + + async def _create_or_update_security_settings_initial( + self, + device_name: str, + resource_group_name: str, + security_settings: "_models.SecuritySettings", + **kwargs + ) -> None: + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01-preview" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._create_or_update_security_settings_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(security_settings, 'SecuritySettings') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _create_or_update_security_settings_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/securitySettings/default/update'} # type: ignore + + async def begin_create_or_update_security_settings( + self, + device_name: str, + resource_group_name: str, + security_settings: "_models.SecuritySettings", + **kwargs + ) -> AsyncLROPoller[None]: + """Updates the security settings on a Data Box Edge/Data Box Gateway device. + + :param device_name: The device name. + :type device_name: str + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param security_settings: The security settings. + :type security_settings: ~azure.mgmt.databoxedge.v2020_09_01_preview.models.SecuritySettings + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: Pass in True if you'd like the AsyncARMPolling polling method, + False for no polling, or your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._create_or_update_security_settings_initial( + device_name=device_name, + resource_group_name=resource_group_name, + security_settings=security_settings, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create_or_update_security_settings.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/securitySettings/default/update'} # type: ignore + + async def update_extended_information( + self, + device_name: str, + resource_group_name: str, + parameters: "_models.DataBoxEdgeDeviceExtendedInfoPatch", + **kwargs + ) -> "_models.DataBoxEdgeDeviceExtendedInfo": + """Gets additional information for the specified Data Box Edge/Data Box Gateway device. + + :param device_name: The device name. + :type device_name: str + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param parameters: The patch object. + :type parameters: ~azure.mgmt.databoxedge.v2020_09_01_preview.models.DataBoxEdgeDeviceExtendedInfoPatch + :keyword callable cls: A custom type or function that will be passed the direct response + :return: DataBoxEdgeDeviceExtendedInfo, or the result of cls(response) + :rtype: ~azure.mgmt.databoxedge.v2020_09_01_preview.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 = "2020-09-01-preview" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update_extended_information.metadata['url'] # type: ignore + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, 'DataBoxEdgeDeviceExtendedInfoPatch') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('DataBoxEdgeDeviceExtendedInfo', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update_extended_information.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/updateExtendedInformation'} # type: ignore + + async def get_update_summary( + self, + device_name: str, + resource_group_name: str, + **kwargs + ) -> "_models.UpdateSummary": + """Gets information about the availability of updates based on the last scan of the device. It also gets information about any ongoing download or install jobs on the device. + + Gets information about the availability of updates based on the last scan of the device. It + also gets information about any ongoing download or install jobs on the device. + + :param device_name: The device name. + :type device_name: str + :param resource_group_name: The resource group name. + :type resource_group_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: UpdateSummary, or the result of cls(response) + :rtype: ~azure.mgmt.databoxedge.v2020_09_01_preview.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 = "2020-09-01-preview" + accept = "application/json" + + # Construct URL + url = self.get_update_summary.metadata['url'] # type: ignore + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('UpdateSummary', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_update_summary.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/updateSummary/default'} # type: ignore + + async def upload_certificate( + self, + device_name: str, + resource_group_name: str, + parameters: "_models.UploadCertificateRequest", + **kwargs + ) -> "_models.UploadCertificateResponse": + """Uploads registration certificate for the device. + + :param device_name: The device name. + :type device_name: str + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param parameters: The upload certificate request. + :type parameters: ~azure.mgmt.databoxedge.v2020_09_01_preview.models.UploadCertificateRequest + :keyword callable cls: A custom type or function that will be passed the direct response + :return: UploadCertificateResponse, or the result of cls(response) + :rtype: ~azure.mgmt.databoxedge.v2020_09_01_preview.models.UploadCertificateResponse + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.UploadCertificateResponse"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01-preview" + 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/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_09_01_preview/aio/operations/_jobs_operations.py b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_09_01_preview/aio/operations/_jobs_operations.py new file mode 100644 index 000000000000..8d1ef9d46a12 --- /dev/null +++ b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_09_01_preview/aio/operations/_jobs_operations.py @@ -0,0 +1,105 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, Callable, Dict, Generic, Optional, TypeVar +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.mgmt.core.exceptions import ARMErrorFormat + +from ... import models as _models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class JobsOperations: + """JobsOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.databoxedge.v2020_09_01_preview.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: ~azure.mgmt.databoxedge.v2020_09_01_preview.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 = "2020-09-01-preview" + 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/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_09_01_preview/aio/operations/_monitoring_config_operations.py b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_09_01_preview/aio/operations/_monitoring_config_operations.py new file mode 100644 index 000000000000..01e65834f526 --- /dev/null +++ b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_09_01_preview/aio/operations/_monitoring_config_operations.py @@ -0,0 +1,440 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling + +from ... import models as _models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class MonitoringConfigOperations: + """MonitoringConfigOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.databoxedge.v2020_09_01_preview.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list( + self, + device_name: str, + role_name: str, + resource_group_name: str, + **kwargs + ) -> AsyncIterable["_models.MonitoringMetricConfigurationList"]: + """Lists metric configurations in a role. + + Lists metric configurations in a role. + + :param device_name: The device name. + :type device_name: str + :param role_name: The role name. + :type role_name: str + :param resource_group_name: The resource group name. + :type resource_group_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either MonitoringMetricConfigurationList or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.databoxedge.v2020_09_01_preview.models.MonitoringMetricConfigurationList] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.MonitoringMetricConfigurationList"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01-preview" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list.metadata['url'] # type: ignore + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'roleName': self._serialize.url("role_name", role_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('MonitoringMetricConfigurationList', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/roles/{roleName}/monitoringConfig'} # type: ignore + + async def get( + self, + device_name: str, + role_name: str, + resource_group_name: str, + **kwargs + ) -> "_models.MonitoringMetricConfiguration": + """Gets a metric configuration of a role. + + Gets a metric configuration of a role. + + :param device_name: The device name. + :type device_name: str + :param role_name: The role name. + :type role_name: str + :param resource_group_name: The resource group name. + :type resource_group_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: MonitoringMetricConfiguration, or the result of cls(response) + :rtype: ~azure.mgmt.databoxedge.v2020_09_01_preview.models.MonitoringMetricConfiguration + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.MonitoringMetricConfiguration"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01-preview" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'roleName': self._serialize.url("role_name", role_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('MonitoringMetricConfiguration', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/roles/{roleName}/monitoringConfig/default'} # type: ignore + + async def _create_or_update_initial( + self, + device_name: str, + role_name: str, + resource_group_name: str, + monitoring_metric_configuration: "_models.MonitoringMetricConfiguration", + **kwargs + ) -> Optional["_models.MonitoringMetricConfiguration"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.MonitoringMetricConfiguration"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01-preview" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._create_or_update_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'roleName': self._serialize.url("role_name", role_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(monitoring_metric_configuration, 'MonitoringMetricConfiguration') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('MonitoringMetricConfiguration', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/roles/{roleName}/monitoringConfig/default'} # type: ignore + + async def begin_create_or_update( + self, + device_name: str, + role_name: str, + resource_group_name: str, + monitoring_metric_configuration: "_models.MonitoringMetricConfiguration", + **kwargs + ) -> AsyncLROPoller["_models.MonitoringMetricConfiguration"]: + """Creates a new metric configuration or updates an existing one for a role. + + Creates a new metric configuration or updates an existing one for a role. + + :param device_name: The device name. + :type device_name: str + :param role_name: The role name. + :type role_name: str + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param monitoring_metric_configuration: The metric configuration. + :type monitoring_metric_configuration: ~azure.mgmt.databoxedge.v2020_09_01_preview.models.MonitoringMetricConfiguration + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: Pass in True if you'd like the AsyncARMPolling polling method, + False for no polling, or your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either MonitoringMetricConfiguration or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.databoxedge.v2020_09_01_preview.models.MonitoringMetricConfiguration] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.MonitoringMetricConfiguration"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._create_or_update_initial( + device_name=device_name, + role_name=role_name, + resource_group_name=resource_group_name, + monitoring_metric_configuration=monitoring_metric_configuration, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('MonitoringMetricConfiguration', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'roleName': self._serialize.url("role_name", role_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/roles/{roleName}/monitoringConfig/default'} # type: ignore + + async def _delete_initial( + self, + device_name: str, + role_name: str, + resource_group_name: str, + **kwargs + ) -> None: + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01-preview" + accept = "application/json" + + # Construct URL + url = self._delete_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'roleName': self._serialize.url("role_name", role_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/roles/{roleName}/monitoringConfig/default'} # type: ignore + + async def begin_delete( + self, + device_name: str, + role_name: str, + resource_group_name: str, + **kwargs + ) -> AsyncLROPoller[None]: + """deletes a new metric configuration for a role. + + deletes a new metric configuration for a role. + + :param device_name: The device name. + :type device_name: str + :param role_name: The role name. + :type role_name: str + :param resource_group_name: The resource group name. + :type resource_group_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: Pass in True if you'd like the AsyncARMPolling polling method, + False for no polling, or your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._delete_initial( + device_name=device_name, + role_name=role_name, + resource_group_name=resource_group_name, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'roleName': self._serialize.url("role_name", role_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/roles/{roleName}/monitoringConfig/default'} # type: ignore diff --git a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_09_01_preview/aio/operations/_nodes_operations.py b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_09_01_preview/aio/operations/_nodes_operations.py new file mode 100644 index 000000000000..16b1502c3c01 --- /dev/null +++ b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_09_01_preview/aio/operations/_nodes_operations.py @@ -0,0 +1,116 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.mgmt.core.exceptions import ARMErrorFormat + +from ... import models as _models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class NodesOperations: + """NodesOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.databoxedge.v2020_09_01_preview.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[~azure.mgmt.databoxedge.v2020_09_01_preview.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 = "2020-09-01-preview" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_by_data_box_edge_device.metadata['url'] # type: ignore + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('NodeList', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_by_data_box_edge_device.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/nodes'} # type: ignore diff --git a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_09_01_preview/aio/operations/_operations.py b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_09_01_preview/aio/operations/_operations.py new file mode 100644 index 000000000000..e95f2b13a318 --- /dev/null +++ b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_09_01_preview/aio/operations/_operations.py @@ -0,0 +1,106 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.mgmt.core.exceptions import ARMErrorFormat + +from ... import models as _models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class Operations: + """Operations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.databoxedge.v2020_09_01_preview.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[~azure.mgmt.databoxedge.v2020_09_01_preview.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 = "2020-09-01-preview" + 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/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_09_01_preview/aio/operations/_operations_status_operations.py b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_09_01_preview/aio/operations/_operations_status_operations.py new file mode 100644 index 000000000000..950f863461ed --- /dev/null +++ b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_09_01_preview/aio/operations/_operations_status_operations.py @@ -0,0 +1,105 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, Callable, Dict, Generic, Optional, TypeVar +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.mgmt.core.exceptions import ARMErrorFormat + +from ... import models as _models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class OperationsStatusOperations: + """OperationsStatusOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.databoxedge.v2020_09_01_preview.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: ~azure.mgmt.databoxedge.v2020_09_01_preview.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 = "2020-09-01-preview" + 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/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_09_01_preview/aio/operations/_orders_operations.py b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_09_01_preview/aio/operations/_orders_operations.py new file mode 100644 index 000000000000..1e665d55ec85 --- /dev/null +++ b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_09_01_preview/aio/operations/_orders_operations.py @@ -0,0 +1,478 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling + +from ... import models as _models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class OrdersOperations: + """OrdersOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.databoxedge.v2020_09_01_preview.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[~azure.mgmt.databoxedge.v2020_09_01_preview.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 = "2020-09-01-preview" + 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: ~azure.mgmt.databoxedge.v2020_09_01_preview.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 = "2020-09-01-preview" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('Order', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/orders/default'} # type: ignore + + async def _create_or_update_initial( + self, + device_name: str, + resource_group_name: str, + order: "_models.Order", + **kwargs + ) -> Optional["_models.Order"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.Order"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01-preview" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._create_or_update_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(order, 'Order') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('Order', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/orders/default'} # type: ignore + + async def begin_create_or_update( + self, + device_name: str, + resource_group_name: str, + order: "_models.Order", + **kwargs + ) -> AsyncLROPoller["_models.Order"]: + """Creates or updates an order. + + Creates or updates an order. + + :param device_name: The order details of a device. + :type device_name: str + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param order: The order to be created or updated. + :type order: ~azure.mgmt.databoxedge.v2020_09_01_preview.models.Order + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: Pass in True if you'd like the AsyncARMPolling polling method, + False for no polling, or your own initialized polling object for a 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[~azure.mgmt.databoxedge.v2020_09_01_preview.models.Order] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Order"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._create_or_update_initial( + device_name=device_name, + resource_group_name=resource_group_name, + order=order, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('Order', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/orders/default'} # type: ignore + + async def _delete_initial( + self, + device_name: str, + resource_group_name: str, + **kwargs + ) -> None: + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01-preview" + 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: Pass in True if you'd like the AsyncARMPolling polling method, + False for no polling, or your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._delete_initial( + device_name=device_name, + resource_group_name=resource_group_name, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/orders/default'} # type: ignore + + async def list_dc_access_code( + self, + device_name: str, + resource_group_name: str, + **kwargs + ) -> "_models.DCAccessCode": + """Gets the DCAccess Code. + + Gets the DCAccess Code. + + :param device_name: The device name. + :type device_name: str + :param resource_group_name: The resource group name. + :type resource_group_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: DCAccessCode, or the result of cls(response) + :rtype: ~azure.mgmt.databoxedge.v2020_09_01_preview.models.DCAccessCode + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.DCAccessCode"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01-preview" + accept = "application/json" + + # Construct URL + url = self.list_dc_access_code.metadata['url'] # type: ignore + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('DCAccessCode', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + list_dc_access_code.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/orders/default/listDCAccessCode'} # type: ignore diff --git a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_09_01_preview/aio/operations/_roles_operations.py b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_09_01_preview/aio/operations/_roles_operations.py new file mode 100644 index 000000000000..6b88bc8be448 --- /dev/null +++ b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_09_01_preview/aio/operations/_roles_operations.py @@ -0,0 +1,428 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling + +from ... import models as _models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class RolesOperations: + """RolesOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.databoxedge.v2020_09_01_preview.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[~azure.mgmt.databoxedge.v2020_09_01_preview.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 = "2020-09-01-preview" + 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: ~azure.mgmt.databoxedge.v2020_09_01_preview.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 = "2020-09-01-preview" + 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 = "2020-09-01-preview" + 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: ~azure.mgmt.databoxedge.v2020_09_01_preview.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: Pass in True if you'd like the AsyncARMPolling polling method, + False for no polling, or your own initialized polling object for a 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[~azure.mgmt.databoxedge.v2020_09_01_preview.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 = "2020-09-01-preview" + 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: Pass in True if you'd like the AsyncARMPolling polling method, + False for no polling, or your own initialized polling object for a 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/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_09_01_preview/aio/operations/_shares_operations.py b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_09_01_preview/aio/operations/_shares_operations.py new file mode 100644 index 000000000000..d70a74348b59 --- /dev/null +++ b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_09_01_preview/aio/operations/_shares_operations.py @@ -0,0 +1,551 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling + +from ... import models as _models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class SharesOperations: + """SharesOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.databoxedge.v2020_09_01_preview.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[~azure.mgmt.databoxedge.v2020_09_01_preview.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 = "2020-09-01-preview" + 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: ~azure.mgmt.databoxedge.v2020_09_01_preview.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 = "2020-09-01-preview" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('Share', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/shares/{name}'} # type: ignore + + async def _create_or_update_initial( + self, + device_name: str, + name: str, + resource_group_name: str, + share: "_models.Share", + **kwargs + ) -> Optional["_models.Share"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.Share"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01-preview" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._create_or_update_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(share, 'Share') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('Share', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/shares/{name}'} # type: ignore + + async def begin_create_or_update( + self, + device_name: str, + name: str, + resource_group_name: str, + share: "_models.Share", + **kwargs + ) -> AsyncLROPoller["_models.Share"]: + """Creates a new share or updates an existing share on the device. + + Creates a new share or updates an existing share on the device. + + :param device_name: The device name. + :type device_name: str + :param name: The share name. + :type name: str + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param share: The share properties. + :type share: ~azure.mgmt.databoxedge.v2020_09_01_preview.models.Share + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: Pass in True if you'd like the AsyncARMPolling polling method, + False for no polling, or your own initialized polling object for a 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[~azure.mgmt.databoxedge.v2020_09_01_preview.models.Share] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Share"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._create_or_update_initial( + device_name=device_name, + name=name, + resource_group_name=resource_group_name, + share=share, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('Share', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/shares/{name}'} # type: ignore + + async def _delete_initial( + self, + device_name: str, + name: str, + resource_group_name: str, + **kwargs + ) -> None: + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01-preview" + 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: Pass in True if you'd like the AsyncARMPolling polling method, + False for no polling, or your own initialized polling object for a 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 = "2020-09-01-preview" + 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: Pass in True if you'd like the AsyncARMPolling polling method, + False for no polling, or your own initialized polling object for a 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/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_09_01_preview/aio/operations/_storage_account_credentials_operations.py b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_09_01_preview/aio/operations/_storage_account_credentials_operations.py new file mode 100644 index 000000000000..40c4cd4f3593 --- /dev/null +++ b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_09_01_preview/aio/operations/_storage_account_credentials_operations.py @@ -0,0 +1,430 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling + +from ... import models as _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: ~azure.mgmt.databoxedge.v2020_09_01_preview.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[~azure.mgmt.databoxedge.v2020_09_01_preview.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 = "2020-09-01-preview" + 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: ~azure.mgmt.databoxedge.v2020_09_01_preview.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 = "2020-09-01-preview" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('StorageAccountCredential', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/storageAccountCredentials/{name}'} # type: ignore + + async def _create_or_update_initial( + self, + device_name: str, + name: str, + resource_group_name: str, + storage_account_credential: "_models.StorageAccountCredential", + **kwargs + ) -> Optional["_models.StorageAccountCredential"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.StorageAccountCredential"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01-preview" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._create_or_update_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(storage_account_credential, 'StorageAccountCredential') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('StorageAccountCredential', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/storageAccountCredentials/{name}'} # type: ignore + + async def begin_create_or_update( + self, + device_name: str, + name: str, + resource_group_name: str, + storage_account_credential: "_models.StorageAccountCredential", + **kwargs + ) -> AsyncLROPoller["_models.StorageAccountCredential"]: + """Creates or updates the storage account credential. + + :param device_name: The device name. + :type device_name: str + :param name: The storage account credential name. + :type name: str + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param storage_account_credential: The storage account credential. + :type storage_account_credential: ~azure.mgmt.databoxedge.v2020_09_01_preview.models.StorageAccountCredential + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: Pass in True if you'd like the AsyncARMPolling polling method, + False for no polling, or your own initialized polling object for a 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[~azure.mgmt.databoxedge.v2020_09_01_preview.models.StorageAccountCredential] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.StorageAccountCredential"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._create_or_update_initial( + device_name=device_name, + name=name, + resource_group_name=resource_group_name, + storage_account_credential=storage_account_credential, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('StorageAccountCredential', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/storageAccountCredentials/{name}'} # type: ignore + + async def _delete_initial( + self, + device_name: str, + name: str, + resource_group_name: str, + **kwargs + ) -> None: + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01-preview" + 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: Pass in True if you'd like the AsyncARMPolling polling method, + False for no polling, or your own initialized polling object for a 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/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_09_01_preview/aio/operations/_storage_accounts_operations.py b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_09_01_preview/aio/operations/_storage_accounts_operations.py new file mode 100644 index 000000000000..188f3555a9cd --- /dev/null +++ b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_09_01_preview/aio/operations/_storage_accounts_operations.py @@ -0,0 +1,434 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling + +from ... import models as _models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class StorageAccountsOperations: + """StorageAccountsOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.databoxedge.v2020_09_01_preview.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list_by_data_box_edge_device( + self, + device_name: str, + resource_group_name: str, + **kwargs + ) -> AsyncIterable["_models.StorageAccountList"]: + """Lists all the StorageAccounts in a Data Box Edge/Data Box Gateway device. + + Lists all the StorageAccounts in a Data Box Edge/Data Box Gateway device. + + :param device_name: The device name. + :type device_name: str + :param resource_group_name: The resource group name. + :type resource_group_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either StorageAccountList or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.databoxedge.v2020_09_01_preview.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 = "2020-09-01-preview" + 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: ~azure.mgmt.databoxedge.v2020_09_01_preview.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 = "2020-09-01-preview" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'storageAccountName': self._serialize.url("storage_account_name", storage_account_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('StorageAccount', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/storageAccounts/{storageAccountName}'} # type: ignore + + async def _create_or_update_initial( + self, + device_name: str, + storage_account_name: str, + resource_group_name: str, + storage_account: "_models.StorageAccount", + **kwargs + ) -> Optional["_models.StorageAccount"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.StorageAccount"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01-preview" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._create_or_update_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'storageAccountName': self._serialize.url("storage_account_name", storage_account_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(storage_account, 'StorageAccount') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('StorageAccount', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/storageAccounts/{storageAccountName}'} # type: ignore + + async def begin_create_or_update( + self, + device_name: str, + storage_account_name: str, + resource_group_name: str, + storage_account: "_models.StorageAccount", + **kwargs + ) -> AsyncLROPoller["_models.StorageAccount"]: + """Creates a new StorageAccount or updates an existing StorageAccount on the device. + + Creates a new StorageAccount or updates an existing StorageAccount on the device. + + :param device_name: The device name. + :type device_name: str + :param storage_account_name: The StorageAccount name. + :type storage_account_name: str + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param storage_account: The StorageAccount properties. + :type storage_account: ~azure.mgmt.databoxedge.v2020_09_01_preview.models.StorageAccount + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: Pass in True if you'd like the AsyncARMPolling polling method, + False for no polling, or your own initialized polling object for a 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[~azure.mgmt.databoxedge.v2020_09_01_preview.models.StorageAccount] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.StorageAccount"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._create_or_update_initial( + device_name=device_name, + storage_account_name=storage_account_name, + resource_group_name=resource_group_name, + storage_account=storage_account, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('StorageAccount', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'storageAccountName': self._serialize.url("storage_account_name", storage_account_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/storageAccounts/{storageAccountName}'} # type: ignore + + async def _delete_initial( + self, + device_name: str, + storage_account_name: str, + resource_group_name: str, + **kwargs + ) -> None: + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01-preview" + 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: Pass in True if you'd like the AsyncARMPolling polling method, + False for no polling, or your own initialized polling object for a 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/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_09_01_preview/aio/operations/_triggers_operations.py b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_09_01_preview/aio/operations/_triggers_operations.py new file mode 100644 index 000000000000..ed62fda82f71 --- /dev/null +++ b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_09_01_preview/aio/operations/_triggers_operations.py @@ -0,0 +1,434 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling + +from ... import models as _models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class TriggersOperations: + """TriggersOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.databoxedge.v2020_09_01_preview.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[~azure.mgmt.databoxedge.v2020_09_01_preview.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 = "2020-09-01-preview" + 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: ~azure.mgmt.databoxedge.v2020_09_01_preview.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 = "2020-09-01-preview" + 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 = "2020-09-01-preview" + 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: ~azure.mgmt.databoxedge.v2020_09_01_preview.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: Pass in True if you'd like the AsyncARMPolling polling method, + False for no polling, or your own initialized polling object for a 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[~azure.mgmt.databoxedge.v2020_09_01_preview.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 = "2020-09-01-preview" + 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: Pass in True if you'd like the AsyncARMPolling polling method, + False for no polling, or your own initialized polling object for a 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/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_09_01_preview/aio/operations/_users_operations.py b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_09_01_preview/aio/operations/_users_operations.py new file mode 100644 index 000000000000..f3eee3cf5521 --- /dev/null +++ b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_09_01_preview/aio/operations/_users_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 as _models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class UsersOperations: + """UsersOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.databoxedge.v2020_09_01_preview.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, + expand: 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 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 UserList or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.databoxedge.v2020_09_01_preview.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 = "2020-09-01-preview" + 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 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('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: ~azure.mgmt.databoxedge.v2020_09_01_preview.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 = "2020-09-01-preview" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('User', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/users/{name}'} # type: ignore + + async def _create_or_update_initial( + self, + device_name: str, + name: str, + resource_group_name: str, + user: "_models.User", + **kwargs + ) -> Optional["_models.User"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.User"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01-preview" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._create_or_update_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(user, 'User') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('User', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/users/{name}'} # type: ignore + + async def begin_create_or_update( + self, + device_name: str, + name: str, + resource_group_name: str, + user: "_models.User", + **kwargs + ) -> AsyncLROPoller["_models.User"]: + """Creates a new user or updates an existing user's information on a Data Box Edge/Data Box + Gateway device. + + :param device_name: The device name. + :type device_name: str + :param name: The user name. + :type name: str + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param user: The user details. + :type user: ~azure.mgmt.databoxedge.v2020_09_01_preview.models.User + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: Pass in True if you'd like the AsyncARMPolling polling method, + False for no polling, or your own initialized polling object for a 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[~azure.mgmt.databoxedge.v2020_09_01_preview.models.User] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.User"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._create_or_update_initial( + device_name=device_name, + name=name, + resource_group_name=resource_group_name, + user=user, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('User', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/users/{name}'} # type: ignore + + async def _delete_initial( + self, + device_name: str, + name: str, + resource_group_name: str, + **kwargs + ) -> None: + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01-preview" + 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: Pass in True if you'd like the AsyncARMPolling polling method, + False for no polling, or your own initialized polling object for a 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/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_09_01_preview/models/__init__.py b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_09_01_preview/models/__init__.py new file mode 100644 index 000000000000..8b331ada40a8 --- /dev/null +++ b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_09_01_preview/models/__init__.py @@ -0,0 +1,476 @@ +# 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 ARMBaseModel + from ._models_py3 import Addon + from ._models_py3 import AddonList + from ._models_py3 import Address + from ._models_py3 import Alert + from ._models_py3 import AlertErrorDetails + from ._models_py3 import AlertList + from ._models_py3 import ArcAddon + from ._models_py3 import AsymmetricEncryptedSecret + from ._models_py3 import Authentication + from ._models_py3 import AzureContainerInfo + from ._models_py3 import BandwidthSchedule + from ._models_py3 import BandwidthSchedulesList + from ._models_py3 import ClientAccessRight + from ._models_py3 import CloudEdgeManagementRole + from ._models_py3 import CloudErrorBody + from ._models_py3 import CniConfig + from ._models_py3 import ComputeResource + from ._models_py3 import ContactDetails + from ._models_py3 import Container + from ._models_py3 import ContainerList + from ._models_py3 import DCAccessCode + from ._models_py3 import DataBoxEdgeDevice + from ._models_py3 import DataBoxEdgeDeviceExtendedInfo + from ._models_py3 import DataBoxEdgeDeviceExtendedInfoPatch + from ._models_py3 import DataBoxEdgeDeviceList + from ._models_py3 import DataBoxEdgeDevicePatch + from ._models_py3 import DataBoxEdgeMoveRequest + from ._models_py3 import DataBoxEdgeSku + from ._models_py3 import DataBoxEdgeSkuList + from ._models_py3 import EdgeProfile + from ._models_py3 import EdgeProfilePatch + from ._models_py3 import EdgeProfileSubscription + from ._models_py3 import EdgeProfileSubscriptionPatch + from ._models_py3 import EtcdInfo + from ._models_py3 import FileEventTrigger + from ._models_py3 import FileSourceInfo + from ._models_py3 import GenerateCertResponse + from ._models_py3 import ImageRepositoryCredential + from ._models_py3 import IoTAddon + from ._models_py3 import IoTDeviceInfo + from ._models_py3 import IoTEdgeAgentInfo + from ._models_py3 import IoTRole + from ._models_py3 import Ipv4Config + from ._models_py3 import Ipv6Config + from ._models_py3 import Job + from ._models_py3 import JobErrorDetails + from ._models_py3 import JobErrorItem + from ._models_py3 import KubernetesClusterInfo + from ._models_py3 import KubernetesIPConfiguration + from ._models_py3 import KubernetesRole + from ._models_py3 import KubernetesRoleCompute + from ._models_py3 import KubernetesRoleNetwork + from ._models_py3 import KubernetesRoleResources + from ._models_py3 import KubernetesRoleStorage + from ._models_py3 import KubernetesRoleStorageClassInfo + from ._models_py3 import LoadBalancerConfig + from ._models_py3 import MECRole + from ._models_py3 import MetricConfiguration + from ._models_py3 import MetricCounter + from ._models_py3 import MetricCounterSet + from ._models_py3 import MetricDimension + from ._models_py3 import MetricDimensionV1 + from ._models_py3 import MetricSpecificationV1 + from ._models_py3 import MonitoringMetricConfiguration + from ._models_py3 import MonitoringMetricConfigurationList + from ._models_py3 import MountPointMap + from ._models_py3 import NetworkAdapter + from ._models_py3 import NetworkAdapterPosition + from ._models_py3 import NetworkSettings + from ._models_py3 import Node + from ._models_py3 import NodeInfo + from ._models_py3 import NodeList + from ._models_py3 import Operation + from ._models_py3 import OperationDisplay + from ._models_py3 import OperationsList + from ._models_py3 import Order + from ._models_py3 import OrderList + from ._models_py3 import OrderStatus + from ._models_py3 import PeriodicTimerEventTrigger + from ._models_py3 import PeriodicTimerSourceInfo + from ._models_py3 import RefreshDetails + from ._models_py3 import ResourceIdentity + from ._models_py3 import ResourceMoveDetails + from ._models_py3 import ResourceTypeSku + from ._models_py3 import Role + from ._models_py3 import RoleList + from ._models_py3 import RoleSinkInfo + from ._models_py3 import 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 SkuInformation + from ._models_py3 import SkuInformationList + from ._models_py3 import SkuLocationInfo + from ._models_py3 import StorageAccount + from ._models_py3 import StorageAccountCredential + from ._models_py3 import StorageAccountCredentialList + from ._models_py3 import StorageAccountList + from ._models_py3 import SubscriptionRegisteredFeatures + from ._models_py3 import SymmetricKey + from ._models_py3 import SystemData + from ._models_py3 import TrackingInfo + from ._models_py3 import Trigger + from ._models_py3 import TriggerList + from ._models_py3 import 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 ARMBaseModel # type: ignore + from ._models import Addon # type: ignore + from ._models import AddonList # type: ignore + from ._models import Address # type: ignore + from ._models import Alert # type: ignore + from ._models import AlertErrorDetails # type: ignore + from ._models import AlertList # type: ignore + from ._models import ArcAddon # type: ignore + from ._models import AsymmetricEncryptedSecret # type: ignore + from ._models import Authentication # type: ignore + from ._models import AzureContainerInfo # type: ignore + from ._models import BandwidthSchedule # type: ignore + from ._models import BandwidthSchedulesList # type: ignore + from ._models import ClientAccessRight # type: ignore + from ._models import CloudEdgeManagementRole # type: ignore + from ._models import CloudErrorBody # type: ignore + from ._models import CniConfig # type: ignore + from ._models import ComputeResource # type: ignore + from ._models import ContactDetails # type: ignore + from ._models import Container # type: ignore + from ._models import ContainerList # type: ignore + from ._models import DCAccessCode # type: ignore + from ._models import DataBoxEdgeDevice # type: ignore + from ._models import DataBoxEdgeDeviceExtendedInfo # type: ignore + from ._models import DataBoxEdgeDeviceExtendedInfoPatch # type: ignore + from ._models import DataBoxEdgeDeviceList # type: ignore + from ._models import DataBoxEdgeDevicePatch # type: ignore + from ._models import DataBoxEdgeMoveRequest # type: ignore + from ._models import DataBoxEdgeSku # type: ignore + from ._models import DataBoxEdgeSkuList # type: ignore + from ._models import EdgeProfile # type: ignore + from ._models import EdgeProfilePatch # type: ignore + from ._models import EdgeProfileSubscription # type: ignore + from ._models import EdgeProfileSubscriptionPatch # type: ignore + from ._models import EtcdInfo # type: ignore + from ._models import FileEventTrigger # type: ignore + from ._models import FileSourceInfo # type: ignore + from ._models import GenerateCertResponse # type: ignore + from ._models import ImageRepositoryCredential # type: ignore + from ._models import IoTAddon # type: ignore + from ._models import IoTDeviceInfo # type: ignore + from ._models import IoTEdgeAgentInfo # type: ignore + from ._models import IoTRole # type: ignore + from ._models import Ipv4Config # type: ignore + from ._models import Ipv6Config # type: ignore + from ._models import Job # type: ignore + from ._models import JobErrorDetails # type: ignore + from ._models import JobErrorItem # type: ignore + from ._models import KubernetesClusterInfo # type: ignore + from ._models import KubernetesIPConfiguration # type: ignore + from ._models import KubernetesRole # type: ignore + from ._models import KubernetesRoleCompute # type: ignore + from ._models import KubernetesRoleNetwork # type: ignore + from ._models import KubernetesRoleResources # type: ignore + from ._models import KubernetesRoleStorage # type: ignore + from ._models import KubernetesRoleStorageClassInfo # type: ignore + from ._models import LoadBalancerConfig # type: ignore + from ._models import MECRole # type: ignore + from ._models import MetricConfiguration # type: ignore + from ._models import MetricCounter # type: ignore + from ._models import MetricCounterSet # type: ignore + from ._models import MetricDimension # type: ignore + from ._models import MetricDimensionV1 # type: ignore + from ._models import MetricSpecificationV1 # type: ignore + from ._models import MonitoringMetricConfiguration # type: ignore + from ._models import MonitoringMetricConfigurationList # type: ignore + from ._models import MountPointMap # type: ignore + from ._models import NetworkAdapter # type: ignore + from ._models import NetworkAdapterPosition # type: ignore + from ._models import NetworkSettings # type: ignore + from ._models import Node # type: ignore + from ._models import NodeInfo # type: ignore + from ._models import NodeList # type: ignore + from ._models import Operation # type: ignore + from ._models import OperationDisplay # type: ignore + from ._models import OperationsList # type: ignore + from ._models import Order # type: ignore + from ._models import OrderList # type: ignore + from ._models import OrderStatus # type: ignore + from ._models import PeriodicTimerEventTrigger # type: ignore + from ._models import PeriodicTimerSourceInfo # type: ignore + from ._models import RefreshDetails # type: ignore + from ._models import ResourceIdentity # type: ignore + from ._models import ResourceMoveDetails # type: ignore + from ._models import ResourceTypeSku # type: ignore + from ._models import Role # type: ignore + from ._models import RoleList # type: ignore + from ._models import RoleSinkInfo # type: ignore + from ._models import 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 SkuInformation # type: ignore + from ._models import SkuInformationList # type: ignore + from ._models import SkuLocationInfo # type: ignore + from ._models import StorageAccount # type: ignore + from ._models import StorageAccountCredential # type: ignore + from ._models import StorageAccountCredentialList # type: ignore + from ._models import StorageAccountList # type: ignore + from ._models import SubscriptionRegisteredFeatures # type: ignore + from ._models import SymmetricKey # type: ignore + from ._models import SystemData # type: ignore + from ._models import TrackingInfo # type: ignore + from ._models import Trigger # type: ignore + from ._models import TriggerList # type: ignore + from ._models import 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, + AddonState, + AddonType, + AlertSeverity, + AuthenticationType, + AzureContainerDataFormat, + ClientPermissionType, + ContainerStatus, + CreatedByType, + DataBoxEdgeDeviceKind, + DataBoxEdgeDeviceStatus, + DataPolicy, + DayOfWeek, + DeviceType, + DownloadPhase, + EncryptionAlgorithm, + HostPlatformType, + InstallRebootBehavior, + JobStatus, + JobType, + KubernetesNodeType, + KubernetesState, + MetricAggregationType, + MetricCategory, + MetricUnit, + MonitoringStatus, + MountType, + MsiIdentityType, + NetworkAdapterDHCPStatus, + NetworkAdapterRDMAStatus, + NetworkAdapterStatus, + NetworkGroup, + NodeStatus, + OrderState, + PlatformType, + PosixComplianceStatus, + ResourceMoveStatus, + RoleStatus, + RoleTypes, + SSLStatus, + ShareAccessProtocol, + ShareAccessType, + ShareStatus, + ShipmentType, + SkuAvailability, + SkuName, + SkuSignupOption, + SkuTier, + SkuVersion, + StorageAccountStatus, + SubscriptionState, + TimeGrain, + TriggerEventType, + UpdateOperation, + UpdateOperationStage, + UserType, +) + +__all__ = [ + 'ARMBaseModel', + 'Addon', + 'AddonList', + 'Address', + 'Alert', + 'AlertErrorDetails', + 'AlertList', + 'ArcAddon', + 'AsymmetricEncryptedSecret', + 'Authentication', + 'AzureContainerInfo', + 'BandwidthSchedule', + 'BandwidthSchedulesList', + 'ClientAccessRight', + 'CloudEdgeManagementRole', + 'CloudErrorBody', + 'CniConfig', + 'ComputeResource', + 'ContactDetails', + 'Container', + 'ContainerList', + 'DCAccessCode', + 'DataBoxEdgeDevice', + 'DataBoxEdgeDeviceExtendedInfo', + 'DataBoxEdgeDeviceExtendedInfoPatch', + 'DataBoxEdgeDeviceList', + 'DataBoxEdgeDevicePatch', + 'DataBoxEdgeMoveRequest', + 'DataBoxEdgeSku', + 'DataBoxEdgeSkuList', + 'EdgeProfile', + 'EdgeProfilePatch', + 'EdgeProfileSubscription', + 'EdgeProfileSubscriptionPatch', + 'EtcdInfo', + 'FileEventTrigger', + 'FileSourceInfo', + 'GenerateCertResponse', + 'ImageRepositoryCredential', + 'IoTAddon', + 'IoTDeviceInfo', + 'IoTEdgeAgentInfo', + 'IoTRole', + 'Ipv4Config', + 'Ipv6Config', + 'Job', + 'JobErrorDetails', + 'JobErrorItem', + 'KubernetesClusterInfo', + 'KubernetesIPConfiguration', + 'KubernetesRole', + 'KubernetesRoleCompute', + 'KubernetesRoleNetwork', + 'KubernetesRoleResources', + 'KubernetesRoleStorage', + 'KubernetesRoleStorageClassInfo', + 'LoadBalancerConfig', + 'MECRole', + 'MetricConfiguration', + 'MetricCounter', + 'MetricCounterSet', + 'MetricDimension', + 'MetricDimensionV1', + 'MetricSpecificationV1', + 'MonitoringMetricConfiguration', + 'MonitoringMetricConfigurationList', + 'MountPointMap', + 'NetworkAdapter', + 'NetworkAdapterPosition', + 'NetworkSettings', + 'Node', + 'NodeInfo', + 'NodeList', + 'Operation', + 'OperationDisplay', + 'OperationsList', + 'Order', + 'OrderList', + 'OrderStatus', + 'PeriodicTimerEventTrigger', + 'PeriodicTimerSourceInfo', + 'RefreshDetails', + 'ResourceIdentity', + 'ResourceMoveDetails', + 'ResourceTypeSku', + 'Role', + 'RoleList', + 'RoleSinkInfo', + 'SecuritySettings', + 'ServiceSpecification', + 'Share', + 'ShareAccessRight', + 'ShareList', + 'Sku', + 'SkuCost', + 'SkuInformation', + 'SkuInformationList', + 'SkuLocationInfo', + 'StorageAccount', + 'StorageAccountCredential', + 'StorageAccountCredentialList', + 'StorageAccountList', + 'SubscriptionRegisteredFeatures', + 'SymmetricKey', + 'SystemData', + 'TrackingInfo', + 'Trigger', + 'TriggerList', + 'UpdateDownloadProgress', + 'UpdateInstallProgress', + 'UpdateSummary', + 'UploadCertificateRequest', + 'UploadCertificateResponse', + 'User', + 'UserAccessRight', + 'UserList', + 'AccountType', + 'AddonState', + 'AddonType', + 'AlertSeverity', + 'AuthenticationType', + 'AzureContainerDataFormat', + 'ClientPermissionType', + 'ContainerStatus', + 'CreatedByType', + 'DataBoxEdgeDeviceKind', + 'DataBoxEdgeDeviceStatus', + 'DataPolicy', + 'DayOfWeek', + 'DeviceType', + 'DownloadPhase', + 'EncryptionAlgorithm', + 'HostPlatformType', + 'InstallRebootBehavior', + 'JobStatus', + 'JobType', + 'KubernetesNodeType', + 'KubernetesState', + 'MetricAggregationType', + 'MetricCategory', + 'MetricUnit', + 'MonitoringStatus', + 'MountType', + 'MsiIdentityType', + 'NetworkAdapterDHCPStatus', + 'NetworkAdapterRDMAStatus', + 'NetworkAdapterStatus', + 'NetworkGroup', + 'NodeStatus', + 'OrderState', + 'PlatformType', + 'PosixComplianceStatus', + 'ResourceMoveStatus', + 'RoleStatus', + 'RoleTypes', + 'SSLStatus', + 'ShareAccessProtocol', + 'ShareAccessType', + 'ShareStatus', + 'ShipmentType', + 'SkuAvailability', + 'SkuName', + 'SkuSignupOption', + 'SkuTier', + 'SkuVersion', + 'StorageAccountStatus', + 'SubscriptionState', + 'TimeGrain', + 'TriggerEventType', + 'UpdateOperation', + 'UpdateOperationStage', + 'UserType', +] diff --git a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_09_01_preview/models/_data_box_edge_management_client_enums.py b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_09_01_preview/models/_data_box_edge_management_client_enums.py new file mode 100644 index 000000000000..0cec6392e961 --- /dev/null +++ b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_09_01_preview/models/_data_box_edge_management_client_enums.py @@ -0,0 +1,546 @@ +# 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 AddonState(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Addon Provisioning State + """ + + INVALID = "Invalid" + CREATING = "Creating" + CREATED = "Created" + UPDATING = "Updating" + RECONFIGURING = "Reconfiguring" + FAILED = "Failed" + DELETING = "Deleting" + +class AddonType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Addon type. + """ + + IOT_EDGE = "IotEdge" + ARC_FOR_KUBERNETES = "ArcForKubernetes" + +class AlertSeverity(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Severity of the alert. + """ + + INFORMATIONAL = "Informational" + WARNING = "Warning" + CRITICAL = "Critical" + +class AuthenticationType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """The authentication type. + """ + + INVALID = "Invalid" + AZURE_ACTIVE_DIRECTORY = "AzureActiveDirectory" + +class AzureContainerDataFormat(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Storage format used for the file represented by the share. + """ + + BLOCK_BLOB = "BlockBlob" + PAGE_BLOB = "PageBlob" + AZURE_FILE = "AzureFile" + +class ClientPermissionType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Type of access to be allowed for the client. + """ + + NO_ACCESS = "NoAccess" + READ_ONLY = "ReadOnly" + READ_WRITE = "ReadWrite" + +class ContainerStatus(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Current status of the container. + """ + + OK = "OK" + OFFLINE = "Offline" + UNKNOWN = "Unknown" + UPDATING = "Updating" + NEEDS_ATTENTION = "NeedsAttention" + +class CreatedByType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """The type of identity that created the resource. + """ + + USER = "User" + APPLICATION = "Application" + MANAGED_IDENTITY = "ManagedIdentity" + KEY = "Key" + +class DataBoxEdgeDeviceKind(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """The etag for the devices. + """ + + AZURE_DATA_BOX_GATEWAY = "AzureDataBoxGateway" + AZURE_STACK_EDGE = "AzureStackEdge" + AZURE_STACK_HUB = "AzureStackHub" + AZURE_MODULAR_DATA_CENTRE = "AzureModularDataCentre" + +class DataBoxEdgeDeviceStatus(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """The status of the Data Box Edge/Gateway device. + """ + + READY_TO_SETUP = "ReadyToSetup" + ONLINE = "Online" + OFFLINE = "Offline" + NEEDS_ATTENTION = "NeedsAttention" + DISCONNECTED = "Disconnected" + PARTIALLY_DISCONNECTED = "PartiallyDisconnected" + MAINTENANCE = "Maintenance" + +class DataPolicy(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Data policy of the share. + """ + + CLOUD = "Cloud" + LOCAL = "Local" + +class DayOfWeek(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + + SUNDAY = "Sunday" + MONDAY = "Monday" + TUESDAY = "Tuesday" + WEDNESDAY = "Wednesday" + THURSDAY = "Thursday" + FRIDAY = "Friday" + SATURDAY = "Saturday" + +class DeviceType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """The type of the Data Box Edge/Gateway device. + """ + + DATA_BOX_EDGE_DEVICE = "DataBoxEdgeDevice" + +class DownloadPhase(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """The download phase. + """ + + UNKNOWN = "Unknown" + INITIALIZING = "Initializing" + DOWNLOADING = "Downloading" + VERIFYING = "Verifying" + +class EncryptionAlgorithm(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """The algorithm used to encrypt "Value". + """ + + NONE = "None" + AES256 = "AES256" + RSAES_PKCS1_V1_5 = "RSAES_PKCS1_v_1_5" + +class HostPlatformType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Platform where the runtime is hosted. + """ + + KUBERNETES_CLUSTER = "KubernetesCluster" + LINUX_VM = "LinuxVM" + +class InstallRebootBehavior(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Indicates if updates are available and at least one of the updates needs a reboot. + """ + + NEVER_REBOOTS = "NeverReboots" + REQUIRES_REBOOT = "RequiresReboot" + REQUEST_REBOOT = "RequestReboot" + +class JobStatus(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """The current status of the job. + """ + + INVALID = "Invalid" + RUNNING = "Running" + SUCCEEDED = "Succeeded" + FAILED = "Failed" + CANCELED = "Canceled" + PAUSED = "Paused" + SCHEDULED = "Scheduled" + +class JobType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """The type of the job. + """ + + INVALID = "Invalid" + SCAN_FOR_UPDATES = "ScanForUpdates" + DOWNLOAD_UPDATES = "DownloadUpdates" + INSTALL_UPDATES = "InstallUpdates" + REFRESH_SHARE = "RefreshShare" + REFRESH_CONTAINER = "RefreshContainer" + BACKUP = "Backup" + RESTORE = "Restore" + TRIGGER_SUPPORT_PACKAGE = "TriggerSupportPackage" + +class KubernetesNodeType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Node type - Master/Worker + """ + + INVALID = "Invalid" + MASTER = "Master" + WORKER = "Worker" + +class KubernetesState(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """State of Kubernetes deployment + """ + + INVALID = "Invalid" + CREATING = "Creating" + CREATED = "Created" + UPDATING = "Updating" + RECONFIGURING = "Reconfiguring" + FAILED = "Failed" + DELETING = "Deleting" + +class MetricAggregationType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Metric aggregation type. + """ + + NOT_SPECIFIED = "NotSpecified" + NONE = "None" + AVERAGE = "Average" + MINIMUM = "Minimum" + MAXIMUM = "Maximum" + TOTAL = "Total" + COUNT = "Count" + +class MetricCategory(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Metric category. + """ + + CAPACITY = "Capacity" + TRANSACTION = "Transaction" + +class MetricUnit(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Metric units. + """ + + NOT_SPECIFIED = "NotSpecified" + PERCENT = "Percent" + COUNT = "Count" + SECONDS = "Seconds" + MILLISECONDS = "Milliseconds" + BYTES = "Bytes" + BYTES_PER_SECOND = "BytesPerSecond" + COUNT_PER_SECOND = "CountPerSecond" + +class MonitoringStatus(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Current monitoring status of the share. + """ + + ENABLED = "Enabled" + DISABLED = "Disabled" + +class MountType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Mounting type. + """ + + VOLUME = "Volume" + HOST_PATH = "HostPath" + +class MsiIdentityType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Identity type + """ + + NONE = "None" + SYSTEM_ASSIGNED = "SystemAssigned" + USER_ASSIGNED = "UserAssigned" + +class NetworkAdapterDHCPStatus(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Value indicating whether this adapter has DHCP enabled. + """ + + DISABLED = "Disabled" + ENABLED = "Enabled" + +class NetworkAdapterRDMAStatus(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Value indicating whether this adapter is RDMA capable. + """ + + INCAPABLE = "Incapable" + CAPABLE = "Capable" + +class NetworkAdapterStatus(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Value indicating whether this adapter is valid. + """ + + INACTIVE = "Inactive" + ACTIVE = "Active" + +class NetworkGroup(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """The network group. + """ + + NONE = "None" + NON_RDMA = "NonRDMA" + RDMA = "RDMA" + +class NodeStatus(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """The current status of the individual node + """ + + UNKNOWN = "Unknown" + UP = "Up" + DOWN = "Down" + REBOOTING = "Rebooting" + SHUTTING_DOWN = "ShuttingDown" + +class OrderState(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Status of the order as per the allowed status types. + """ + + UNTRACKED = "Untracked" + AWAITING_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" + AWAITING_PICKUP = "AwaitingPickup" + PICKUP_COMPLETED = "PickupCompleted" + AWAITING_DROP = "AwaitingDrop" + +class PlatformType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Host OS supported by the Arc addon. + """ + + WINDOWS = "Windows" + LINUX = "Linux" + +class PosixComplianceStatus(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """If provisioned storage is posix compliant. + """ + + INVALID = "Invalid" + ENABLED = "Enabled" + DISABLED = "Disabled" + +class ResourceMoveStatus(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Denotes whether move operation is in progress + """ + + NONE = "None" + RESOURCE_MOVE_IN_PROGRESS = "ResourceMoveInProgress" + RESOURCE_MOVE_FAILED = "ResourceMoveFailed" + +class RoleStatus(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Local Edge Management Status + """ + + ENABLED = "Enabled" + DISABLED = "Disabled" + +class RoleTypes(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + + IOT = "IOT" + ASA = "ASA" + FUNCTIONS = "Functions" + COGNITIVE = "Cognitive" + MEC = "MEC" + CLOUD_EDGE_MANAGEMENT = "CloudEdgeManagement" + KUBERNETES = "Kubernetes" + +class ShareAccessProtocol(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Access protocol to be used by the share. + """ + + SMB = "SMB" + NFS = "NFS" + +class ShareAccessType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Type of access to be allowed on the share for this user. + """ + + CHANGE = "Change" + READ = "Read" + CUSTOM = "Custom" + +class ShareStatus(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Current status of the share. + """ + + OFFLINE = "Offline" + UNKNOWN = "Unknown" + OK = "OK" + UPDATING = "Updating" + NEEDS_ATTENTION = "NeedsAttention" + +class ShipmentType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + + NOT_APPLICABLE = "NotApplicable" + SHIPPED_TO_CUSTOMER = "ShippedToCustomer" + SELF_PICKUP = "SelfPickup" + +class SkuAvailability(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Links to the next set of results + """ + + AVAILABLE = "Available" + UNAVAILABLE = "Unavailable" + +class SkuName(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """The Sku name. + """ + + GATEWAY = "Gateway" + EDGE = "Edge" + TEA1_NODE = "TEA_1Node" + TEA1_NODE_UPS = "TEA_1Node_UPS" + TEA1_NODE_HEATER = "TEA_1Node_Heater" + TEA1_NODE_UPS_HEATER = "TEA_1Node_UPS_Heater" + TEA4_NODE_HEATER = "TEA_4Node_Heater" + TEA4_NODE_UPS_HEATER = "TEA_4Node_UPS_Heater" + TMA = "TMA" + TDC = "TDC" + TCA_SMALL = "TCA_Small" + GPU = "GPU" + TCA_LARGE = "TCA_Large" + EDGE_P_BASE = "EdgeP_Base" + EDGE_P_HIGH = "EdgeP_High" + EDGE_PR_BASE = "EdgePR_Base" + EDGE_PR_BASE_UPS = "EdgePR_Base_UPS" + EDGE_MR_MINI = "EdgeMR_Mini" + RCA_SMALL = "RCA_Small" + RCA_LARGE = "RCA_Large" + RDC = "RDC" + +class SkuSignupOption(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Sku can be signed up by customer or not. + """ + + NONE = "None" + AVAILABLE = "Available" + +class SkuTier(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """The Sku tier. + """ + + STANDARD = "Standard" + +class SkuVersion(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Availability of the Sku as preview/stable. + """ + + STABLE = "Stable" + PREVIEW = "Preview" + +class SSLStatus(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Signifies whether SSL needs to be enabled or not. + """ + + ENABLED = "Enabled" + DISABLED = "Disabled" + +class StorageAccountStatus(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Current status of the storage account + """ + + OK = "OK" + OFFLINE = "Offline" + UNKNOWN = "Unknown" + UPDATING = "Updating" + NEEDS_ATTENTION = "NeedsAttention" + +class SubscriptionState(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + + REGISTERED = "Registered" + WARNED = "Warned" + SUSPENDED = "Suspended" + DELETED = "Deleted" + UNREGISTERED = "Unregistered" + +class TimeGrain(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + + PT1_M = "PT1M" + PT5_M = "PT5M" + PT15_M = "PT15M" + PT30_M = "PT30M" + PT1_H = "PT1H" + PT6_H = "PT6H" + PT12_H = "PT12H" + PT1_D = "PT1D" + +class TriggerEventType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Trigger Kind. + """ + + FILE_EVENT = "FileEvent" + PERIODIC_TIMER_EVENT = "PeriodicTimerEvent" + +class UpdateOperation(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """The current update operation. + """ + + NONE = "None" + SCAN = "Scan" + DOWNLOAD = "Download" + INSTALL = "Install" + +class UpdateOperationStage(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Current stage of the update operation. + """ + + UNKNOWN = "Unknown" + INITIAL = "Initial" + SCAN_STARTED = "ScanStarted" + SCAN_COMPLETE = "ScanComplete" + SCAN_FAILED = "ScanFailed" + DOWNLOAD_STARTED = "DownloadStarted" + DOWNLOAD_COMPLETE = "DownloadComplete" + DOWNLOAD_FAILED = "DownloadFailed" + INSTALL_STARTED = "InstallStarted" + INSTALL_COMPLETE = "InstallComplete" + INSTALL_FAILED = "InstallFailed" + REBOOT_INITIATED = "RebootInitiated" + SUCCESS = "Success" + FAILURE = "Failure" + RESCAN_STARTED = "RescanStarted" + RESCAN_COMPLETE = "RescanComplete" + RESCAN_FAILED = "RescanFailed" + +class UserType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Type of the user. + """ + + SHARE = "Share" + LOCAL_MANAGEMENT = "LocalManagement" + ARM = "ARM" diff --git a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_09_01_preview/models/_models.py b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_09_01_preview/models/_models.py new file mode 100644 index 000000000000..d4b0f61fd347 --- /dev/null +++ b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_09_01_preview/models/_models.py @@ -0,0 +1,5037 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +import msrest.serialization + + +class ARMBaseModel(msrest.serialization.Model): + """Represents the base class for all object models. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: The path ID that uniquely identifies the object. + :vartype id: str + :ivar name: The object name. + :vartype name: str + :ivar type: The hierarchical type of the object. + :vartype type: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ARMBaseModel, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None + + +class Addon(ARMBaseModel): + """Role Addon. + + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: ArcAddon, IoTAddon. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: The path ID that uniquely identifies the object. + :vartype id: str + :ivar name: The object name. + :vartype name: str + :ivar type: The hierarchical type of the object. + :vartype type: str + :param kind: Required. Addon type.Constant filled by server. Possible values include: + "IotEdge", "ArcForKubernetes". + :type kind: str or ~azure.mgmt.databoxedge.v2020_09_01_preview.models.AddonType + :ivar system_data: Addon type. + :vartype system_data: ~azure.mgmt.databoxedge.v2020_09_01_preview.models.SystemData + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'kind': {'required': True}, + 'system_data': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + } + + _subtype_map = { + 'kind': {'ArcForKubernetes': 'ArcAddon', 'IotEdge': 'IoTAddon'} + } + + def __init__( + self, + **kwargs + ): + super(Addon, self).__init__(**kwargs) + self.kind = 'Addon' # type: str + self.system_data = None + + +class AddonList(msrest.serialization.Model): + """Collection of all the Role addon on the Azure Stack Edge device. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar value: The Value. + :vartype value: list[~azure.mgmt.databoxedge.v2020_09_01_preview.models.Addon] + :ivar next_link: Link to the next set of results. + :vartype next_link: str + """ + + _validation = { + 'value': {'readonly': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[Addon]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(AddonList, self).__init__(**kwargs) + self.value = None + self.next_link = None + + +class Address(msrest.serialization.Model): + """The shipping address of the customer. + + All required parameters must be populated in order to send to Azure. + + :param address_line1: The address line1. + :type address_line1: str + :param address_line2: The address line2. + :type address_line2: str + :param address_line3: The address line3. + :type address_line3: str + :param postal_code: The postal code. + :type postal_code: str + :param city: The city name. + :type city: str + :param state: The state name. + :type state: str + :param country: Required. The country name. + :type country: str + """ + + _validation = { + 'country': {'required': True}, + } + + _attribute_map = { + 'address_line1': {'key': 'addressLine1', 'type': 'str'}, + 'address_line2': {'key': 'addressLine2', 'type': 'str'}, + 'address_line3': {'key': 'addressLine3', 'type': 'str'}, + 'postal_code': {'key': 'postalCode', 'type': 'str'}, + 'city': {'key': 'city', 'type': 'str'}, + 'state': {'key': 'state', 'type': 'str'}, + 'country': {'key': 'country', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(Address, self).__init__(**kwargs) + self.address_line1 = kwargs.get('address_line1', None) + self.address_line2 = kwargs.get('address_line2', None) + self.address_line3 = kwargs.get('address_line3', None) + self.postal_code = kwargs.get('postal_code', None) + self.city = kwargs.get('city', None) + self.state = kwargs.get('state', None) + self.country = kwargs['country'] + + +class Alert(ARMBaseModel): + """Alert on the data box edge/gateway device. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: The path ID that uniquely identifies the object. + :vartype id: str + :ivar name: The object name. + :vartype name: str + :ivar type: The hierarchical type of the object. + :vartype type: str + :ivar system_data: Alert generated in the resource. + :vartype system_data: ~azure.mgmt.databoxedge.v2020_09_01_preview.models.SystemData + :ivar title: Alert title. + :vartype title: str + :ivar alert_type: Alert type. + :vartype alert_type: str + :ivar appeared_at_date_time: UTC time when the alert appeared. + :vartype appeared_at_date_time: ~datetime.datetime + :ivar recommendation: Alert recommendation. + :vartype recommendation: str + :ivar severity: Severity of the alert. Possible values include: "Informational", "Warning", + "Critical". + :vartype severity: str or ~azure.mgmt.databoxedge.v2020_09_01_preview.models.AlertSeverity + :ivar error_details: Error details of the alert. + :vartype error_details: ~azure.mgmt.databoxedge.v2020_09_01_preview.models.AlertErrorDetails + :ivar detailed_information: Alert details. + :vartype detailed_information: dict[str, str] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'system_data': {'readonly': True}, + 'title': {'readonly': True}, + 'alert_type': {'readonly': True}, + 'appeared_at_date_time': {'readonly': True}, + 'recommendation': {'readonly': True}, + 'severity': {'readonly': True}, + 'error_details': {'readonly': True}, + 'detailed_information': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'title': {'key': 'properties.title', 'type': 'str'}, + 'alert_type': {'key': 'properties.alertType', 'type': 'str'}, + 'appeared_at_date_time': {'key': 'properties.appearedAtDateTime', 'type': 'iso-8601'}, + 'recommendation': {'key': 'properties.recommendation', 'type': 'str'}, + 'severity': {'key': 'properties.severity', 'type': 'str'}, + 'error_details': {'key': 'properties.errorDetails', 'type': 'AlertErrorDetails'}, + 'detailed_information': {'key': 'properties.detailedInformation', 'type': '{str}'}, + } + + def __init__( + self, + **kwargs + ): + super(Alert, self).__init__(**kwargs) + self.system_data = None + self.title = None + self.alert_type = None + self.appeared_at_date_time = None + self.recommendation = None + self.severity = None + self.error_details = None + self.detailed_information = None + + +class AlertErrorDetails(msrest.serialization.Model): + """Error details for the alert. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar error_code: Error code. + :vartype error_code: str + :ivar error_message: Error Message. + :vartype error_message: str + :ivar occurrences: Number of occurrences. + :vartype occurrences: int + """ + + _validation = { + 'error_code': {'readonly': True}, + 'error_message': {'readonly': True}, + 'occurrences': {'readonly': True}, + } + + _attribute_map = { + 'error_code': {'key': 'errorCode', 'type': 'str'}, + 'error_message': {'key': 'errorMessage', 'type': 'str'}, + 'occurrences': {'key': 'occurrences', 'type': 'int'}, + } + + def __init__( + self, + **kwargs + ): + super(AlertErrorDetails, self).__init__(**kwargs) + self.error_code = None + self.error_message = None + self.occurrences = None + + +class AlertList(msrest.serialization.Model): + """Collection of alerts. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar value: The value. + :vartype value: list[~azure.mgmt.databoxedge.v2020_09_01_preview.models.Alert] + :ivar next_link: Link to the next set of results. + :vartype next_link: str + """ + + _validation = { + 'value': {'readonly': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[Alert]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(AlertList, self).__init__(**kwargs) + self.value = None + self.next_link = None + + +class ArcAddon(Addon): + """Arc Addon. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: The path ID that uniquely identifies the object. + :vartype id: str + :ivar name: The object name. + :vartype name: str + :ivar type: The hierarchical type of the object. + :vartype type: str + :param kind: Required. Addon type.Constant filled by server. Possible values include: + "IotEdge", "ArcForKubernetes". + :type kind: str or ~azure.mgmt.databoxedge.v2020_09_01_preview.models.AddonType + :ivar system_data: Addon type. + :vartype system_data: ~azure.mgmt.databoxedge.v2020_09_01_preview.models.SystemData + :param subscription_id: Required. Arc resource subscription Id. + :type subscription_id: str + :param resource_group_name: Required. Arc resource group name. + :type resource_group_name: str + :param resource_name: Required. Arc resource Name. + :type resource_name: str + :param resource_location: Required. Arc resource location. + :type resource_location: str + :ivar version: Arc resource version. + :vartype version: str + :ivar host_platform: Host OS supported by the Arc addon. Possible values include: "Windows", + "Linux". + :vartype host_platform: str or ~azure.mgmt.databoxedge.v2020_09_01_preview.models.PlatformType + :ivar host_platform_type: Platform where the runtime is hosted. Possible values include: + "KubernetesCluster", "LinuxVM". + :vartype host_platform_type: str or + ~azure.mgmt.databoxedge.v2020_09_01_preview.models.HostPlatformType + :ivar provisioning_state: Addon Provisioning State. Possible values include: "Invalid", + "Creating", "Created", "Updating", "Reconfiguring", "Failed", "Deleting". + :vartype provisioning_state: str or + ~azure.mgmt.databoxedge.v2020_09_01_preview.models.AddonState + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'kind': {'required': True}, + 'system_data': {'readonly': True}, + 'subscription_id': {'required': True}, + 'resource_group_name': {'required': True}, + 'resource_name': {'required': True}, + 'resource_location': {'required': True}, + 'version': {'readonly': True}, + 'host_platform': {'readonly': True}, + 'host_platform_type': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'subscription_id': {'key': 'properties.subscriptionId', 'type': 'str'}, + 'resource_group_name': {'key': 'properties.resourceGroupName', 'type': 'str'}, + 'resource_name': {'key': 'properties.resourceName', 'type': 'str'}, + 'resource_location': {'key': 'properties.resourceLocation', 'type': 'str'}, + 'version': {'key': 'properties.version', 'type': 'str'}, + 'host_platform': {'key': 'properties.hostPlatform', 'type': 'str'}, + 'host_platform_type': {'key': 'properties.hostPlatformType', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ArcAddon, self).__init__(**kwargs) + self.kind = 'ArcForKubernetes' # type: str + self.subscription_id = kwargs['subscription_id'] + self.resource_group_name = kwargs['resource_group_name'] + self.resource_name = kwargs['resource_name'] + self.resource_location = kwargs['resource_location'] + self.version = None + self.host_platform = None + self.host_platform_type = None + self.provisioning_state = None + + +class AsymmetricEncryptedSecret(msrest.serialization.Model): + """Represent the secrets intended for encryption with asymmetric key pair. + + All required parameters must be populated in order to send to Azure. + + :param value: Required. The value of the secret. + :type value: str + :param encryption_cert_thumbprint: Thumbprint certificate used to encrypt \"Value\". If the + value is unencrypted, it will be null. + :type encryption_cert_thumbprint: str + :param encryption_algorithm: Required. The algorithm used to encrypt "Value". Possible values + include: "None", "AES256", "RSAES_PKCS1_v_1_5". + :type encryption_algorithm: str or + ~azure.mgmt.databoxedge.v2020_09_01_preview.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: ~azure.mgmt.databoxedge.v2020_09_01_preview.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 + ~azure.mgmt.databoxedge.v2020_09_01_preview.models.AzureContainerDataFormat + """ + + _validation = { + 'storage_account_credential_id': {'required': True}, + 'container_name': {'required': True}, + 'data_format': {'required': True}, + } + + _attribute_map = { + 'storage_account_credential_id': {'key': 'storageAccountCredentialId', 'type': 'str'}, + 'container_name': {'key': 'containerName', 'type': 'str'}, + 'data_format': {'key': 'dataFormat', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(AzureContainerInfo, self).__init__(**kwargs) + self.storage_account_credential_id = kwargs['storage_account_credential_id'] + self.container_name = kwargs['container_name'] + self.data_format = kwargs['data_format'] + + +class BandwidthSchedule(ARMBaseModel): + """The bandwidth schedule details. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: The path ID that uniquely identifies the object. + :vartype id: str + :ivar name: The object name. + :vartype name: str + :ivar type: The hierarchical type of the object. + :vartype type: str + :ivar system_data: Bandwidth object related to ASE resource. + :vartype system_data: ~azure.mgmt.databoxedge.v2020_09_01_preview.models.SystemData + :param start: Required. The start time of the schedule in UTC. + :type start: str + :param stop: Required. The stop time of the schedule in UTC. + :type stop: str + :param rate_in_mbps: Required. The bandwidth rate in Mbps. + :type rate_in_mbps: int + :param days: Required. The days of the week when this schedule is applicable. + :type days: list[str or ~azure.mgmt.databoxedge.v2020_09_01_preview.models.DayOfWeek] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'system_data': {'readonly': True}, + 'start': {'required': True}, + 'stop': {'required': True}, + 'rate_in_mbps': {'required': True}, + 'days': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'start': {'key': 'properties.start', 'type': 'str'}, + 'stop': {'key': 'properties.stop', 'type': 'str'}, + 'rate_in_mbps': {'key': 'properties.rateInMbps', 'type': 'int'}, + 'days': {'key': 'properties.days', 'type': '[str]'}, + } + + def __init__( + self, + **kwargs + ): + super(BandwidthSchedule, self).__init__(**kwargs) + self.system_data = None + self.start = kwargs['start'] + self.stop = kwargs['stop'] + self.rate_in_mbps = kwargs['rate_in_mbps'] + self.days = kwargs['days'] + + +class BandwidthSchedulesList(msrest.serialization.Model): + """The collection of bandwidth schedules. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar value: The list of bandwidth schedules. + :vartype value: list[~azure.mgmt.databoxedge.v2020_09_01_preview.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 + ~azure.mgmt.databoxedge.v2020_09_01_preview.models.ClientPermissionType + """ + + _validation = { + 'client': {'required': True}, + 'access_permission': {'required': True}, + } + + _attribute_map = { + 'client': {'key': 'client', 'type': 'str'}, + 'access_permission': {'key': 'accessPermission', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ClientAccessRight, self).__init__(**kwargs) + self.client = kwargs['client'] + self.access_permission = kwargs['access_permission'] + + +class Role(ARMBaseModel): + """Compute role. + + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: CloudEdgeManagementRole, IoTRole, KubernetesRole, MECRole. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: The path ID that uniquely identifies the object. + :vartype id: str + :ivar name: The object name. + :vartype name: str + :ivar type: The hierarchical type of the object. + :vartype type: str + :param kind: Required. Role type.Constant filled by server. Possible values include: "IOT", + "ASA", "Functions", "Cognitive", "MEC", "CloudEdgeManagement", "Kubernetes". + :type kind: str or ~azure.mgmt.databoxedge.v2020_09_01_preview.models.RoleTypes + :ivar system_data: Role configured on ASE resource. + :vartype system_data: ~azure.mgmt.databoxedge.v2020_09_01_preview.models.SystemData + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'kind': {'required': True}, + 'system_data': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + } + + _subtype_map = { + 'kind': {'CloudEdgeManagement': 'CloudEdgeManagementRole', 'IOT': 'IoTRole', 'Kubernetes': 'KubernetesRole', 'MEC': 'MECRole'} + } + + def __init__( + self, + **kwargs + ): + super(Role, self).__init__(**kwargs) + self.kind = 'Role' # type: str + self.system_data = None + + +class CloudEdgeManagementRole(Role): + """CloudEdgeManagementRole role. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: The path ID that uniquely identifies the object. + :vartype id: str + :ivar name: The object name. + :vartype name: str + :ivar type: The hierarchical type of the object. + :vartype type: str + :param kind: Required. Role type.Constant filled by server. Possible values include: "IOT", + "ASA", "Functions", "Cognitive", "MEC", "CloudEdgeManagement", "Kubernetes". + :type kind: str or ~azure.mgmt.databoxedge.v2020_09_01_preview.models.RoleTypes + :ivar system_data: Role configured on ASE resource. + :vartype system_data: ~azure.mgmt.databoxedge.v2020_09_01_preview.models.SystemData + :ivar local_management_status: Local Edge Management Status. Possible values include: + "Enabled", "Disabled". + :vartype local_management_status: str or + ~azure.mgmt.databoxedge.v2020_09_01_preview.models.RoleStatus + :ivar edge_profile: Edge Profile of the resource. + :vartype edge_profile: ~azure.mgmt.databoxedge.v2020_09_01_preview.models.EdgeProfile + :param role_status: Role status. Possible values include: "Enabled", "Disabled". + :type role_status: str or ~azure.mgmt.databoxedge.v2020_09_01_preview.models.RoleStatus + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'kind': {'required': True}, + 'system_data': {'readonly': True}, + 'local_management_status': {'readonly': True}, + 'edge_profile': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'local_management_status': {'key': 'properties.localManagementStatus', 'type': 'str'}, + 'edge_profile': {'key': 'properties.edgeProfile', 'type': 'EdgeProfile'}, + 'role_status': {'key': 'properties.roleStatus', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(CloudEdgeManagementRole, self).__init__(**kwargs) + self.kind = 'CloudEdgeManagement' # type: str + self.local_management_status = None + self.edge_profile = None + self.role_status = kwargs.get('role_status', None) + + +class CloudErrorBody(msrest.serialization.Model): + """An error response from the service. + + :param code: An identifier for the error. Codes are invariant and are intended to be consumed + programmatically. + :type code: str + :param message: A message describing the error, intended to be suitable for display in a user + interface. + :type message: str + :param details: A list of additional details about the error. + :type details: list[~azure.mgmt.databoxedge.v2020_09_01_preview.models.CloudErrorBody] + """ + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + 'details': {'key': 'details', 'type': '[CloudErrorBody]'}, + } + + def __init__( + self, + **kwargs + ): + super(CloudErrorBody, self).__init__(**kwargs) + self.code = kwargs.get('code', None) + self.message = kwargs.get('message', None) + self.details = kwargs.get('details', None) + + +class CniConfig(msrest.serialization.Model): + """Cni configuration. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar type: Cni type. + :vartype type: str + :ivar version: Cni version. + :vartype version: str + :ivar pod_subnet: Pod Subnet. + :vartype pod_subnet: str + :ivar service_subnet: Service subnet. + :vartype service_subnet: str + """ + + _validation = { + 'type': {'readonly': True}, + 'version': {'readonly': True}, + 'pod_subnet': {'readonly': True}, + 'service_subnet': {'readonly': True}, + } + + _attribute_map = { + 'type': {'key': 'type', 'type': 'str'}, + 'version': {'key': 'version', 'type': 'str'}, + 'pod_subnet': {'key': 'podSubnet', 'type': 'str'}, + 'service_subnet': {'key': 'serviceSubnet', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(CniConfig, self).__init__(**kwargs) + self.type = None + self.version = None + self.pod_subnet = None + self.service_subnet = None + + +class ComputeResource(msrest.serialization.Model): + """Compute infrastructure Resource. + + All required parameters must be populated in order to send to Azure. + + :param processor_count: Required. Processor count. + :type processor_count: int + :param memory_in_gb: Required. Memory in GB. + :type memory_in_gb: long + """ + + _validation = { + 'processor_count': {'required': True}, + 'memory_in_gb': {'required': True}, + } + + _attribute_map = { + 'processor_count': {'key': 'processorCount', 'type': 'int'}, + 'memory_in_gb': {'key': 'memoryInGB', 'type': 'long'}, + } + + def __init__( + self, + **kwargs + ): + super(ComputeResource, self).__init__(**kwargs) + self.processor_count = kwargs['processor_count'] + self.memory_in_gb = kwargs['memory_in_gb'] + + +class ContactDetails(msrest.serialization.Model): + """Contains all the contact details of the customer. + + All required parameters must be populated in order to send to Azure. + + :param contact_person: Required. The contact person name. + :type contact_person: str + :param company_name: Required. The name of the company. + :type company_name: str + :param phone: Required. The phone number. + :type phone: str + :param email_list: Required. The email list. + :type email_list: list[str] + """ + + _validation = { + 'contact_person': {'required': True}, + 'company_name': {'required': True}, + 'phone': {'required': True}, + 'email_list': {'required': True}, + } + + _attribute_map = { + 'contact_person': {'key': 'contactPerson', 'type': 'str'}, + 'company_name': {'key': 'companyName', 'type': 'str'}, + 'phone': {'key': 'phone', 'type': 'str'}, + 'email_list': {'key': 'emailList', 'type': '[str]'}, + } + + def __init__( + self, + **kwargs + ): + super(ContactDetails, self).__init__(**kwargs) + self.contact_person = kwargs['contact_person'] + self.company_name = kwargs['company_name'] + self.phone = kwargs['phone'] + self.email_list = kwargs['email_list'] + + +class Container(ARMBaseModel): + """Represents a container on the Data Box Edge/Gateway device. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: The path ID that uniquely identifies the object. + :vartype id: str + :ivar name: The object name. + :vartype name: str + :ivar type: The hierarchical type of the object. + :vartype type: str + :ivar system_data: Container in DataBoxEdge Resource. + :vartype system_data: ~azure.mgmt.databoxedge.v2020_09_01_preview.models.SystemData + :ivar container_status: Current status of the container. Possible values include: "OK", + "Offline", "Unknown", "Updating", "NeedsAttention". + :vartype container_status: str or + ~azure.mgmt.databoxedge.v2020_09_01_preview.models.ContainerStatus + :param data_format: Required. DataFormat for Container. Possible values include: "BlockBlob", + "PageBlob", "AzureFile". + :type data_format: str or + ~azure.mgmt.databoxedge.v2020_09_01_preview.models.AzureContainerDataFormat + :ivar refresh_details: Details of the refresh job on this container. + :vartype refresh_details: ~azure.mgmt.databoxedge.v2020_09_01_preview.models.RefreshDetails + :ivar created_date_time: The UTC time when container got created. + :vartype created_date_time: ~datetime.datetime + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'system_data': {'readonly': True}, + 'container_status': {'readonly': True}, + 'data_format': {'required': True}, + 'refresh_details': {'readonly': True}, + 'created_date_time': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'container_status': {'key': 'properties.containerStatus', 'type': 'str'}, + 'data_format': {'key': 'properties.dataFormat', 'type': 'str'}, + 'refresh_details': {'key': 'properties.refreshDetails', 'type': 'RefreshDetails'}, + 'created_date_time': {'key': 'properties.createdDateTime', 'type': 'iso-8601'}, + } + + def __init__( + self, + **kwargs + ): + super(Container, self).__init__(**kwargs) + self.system_data = None + self.container_status = None + self.data_format = kwargs['data_format'] + self.refresh_details = None + self.created_date_time = None + + +class ContainerList(msrest.serialization.Model): + """Collection of all the containers on the Data Box Edge/Gateway device. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar value: The list of containers. + :vartype value: list[~azure.mgmt.databoxedge.v2020_09_01_preview.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: ~azure.mgmt.databoxedge.v2020_09_01_preview.models.Sku + :param etag: The etag for the devices. + :type etag: str + :param identity: Msi identity of the resource. + :type identity: ~azure.mgmt.databoxedge.v2020_09_01_preview.models.ResourceIdentity + :ivar kind: The etag for the devices. Possible values include: "AzureDataBoxGateway", + "AzureStackEdge", "AzureStackHub", "AzureModularDataCentre". + :vartype kind: str or ~azure.mgmt.databoxedge.v2020_09_01_preview.models.DataBoxEdgeDeviceKind + :ivar system_data: DataBoxEdge Resource. + :vartype system_data: ~azure.mgmt.databoxedge.v2020_09_01_preview.models.SystemData + :param data_box_edge_device_status: The status of the Data Box Edge/Gateway device. Possible + values include: "ReadyToSetup", "Online", "Offline", "NeedsAttention", "Disconnected", + "PartiallyDisconnected", "Maintenance". + :type data_box_edge_device_status: str or + ~azure.mgmt.databoxedge.v2020_09_01_preview.models.DataBoxEdgeDeviceStatus + :ivar serial_number: The Serial Number of Data Box Edge/Gateway device. + :vartype serial_number: str + :ivar description: The Description of the Data Box Edge/Gateway device. + :vartype description: str + :ivar model_description: The description of the Data Box Edge/Gateway device model. + :vartype model_description: str + :ivar device_type: The type of the Data Box Edge/Gateway device. Possible values include: + "DataBoxEdgeDevice". + :vartype device_type: str or ~azure.mgmt.databoxedge.v2020_09_01_preview.models.DeviceType + :ivar friendly_name: The Data Box Edge/Gateway device name. + :vartype friendly_name: str + :ivar culture: The Data Box Edge/Gateway device culture. + :vartype culture: str + :ivar device_model: The Data Box Edge/Gateway device model. + :vartype device_model: str + :ivar device_software_version: The Data Box Edge/Gateway device software version. + :vartype device_software_version: str + :ivar device_local_capacity: The Data Box Edge/Gateway device local capacity in MB. + :vartype device_local_capacity: long + :ivar time_zone: The Data Box Edge/Gateway device timezone. + :vartype time_zone: str + :ivar device_hcs_version: The device software version number of the device (eg: 1.2.18105.6). + :vartype device_hcs_version: str + :ivar configured_role_types: Type of compute roles configured. + :vartype configured_role_types: list[str or + ~azure.mgmt.databoxedge.v2020_09_01_preview.models.RoleTypes] + :ivar node_count: The number of nodes in the cluster. + :vartype node_count: int + :ivar resource_move_details: The details of the move operation on this resource. + :vartype resource_move_details: + ~azure.mgmt.databoxedge.v2020_09_01_preview.models.ResourceMoveDetails + :ivar edge_profile: The details of Edge Profile for this resource. + :vartype edge_profile: ~azure.mgmt.databoxedge.v2020_09_01_preview.models.EdgeProfile + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': True}, + 'kind': {'readonly': True}, + 'system_data': {'readonly': True}, + 'serial_number': {'readonly': True}, + 'description': {'readonly': True}, + 'model_description': {'readonly': True}, + 'device_type': {'readonly': True}, + 'friendly_name': {'readonly': True}, + 'culture': {'readonly': True}, + 'device_model': {'readonly': True}, + 'device_software_version': {'readonly': True}, + 'device_local_capacity': {'readonly': True}, + 'time_zone': {'readonly': True}, + 'device_hcs_version': {'readonly': True}, + 'configured_role_types': {'readonly': True}, + 'node_count': {'readonly': True}, + 'resource_move_details': {'readonly': True}, + 'edge_profile': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'sku': {'key': 'sku', 'type': 'Sku'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'identity': {'key': 'identity', 'type': 'ResourceIdentity'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'data_box_edge_device_status': {'key': 'properties.dataBoxEdgeDeviceStatus', 'type': 'str'}, + 'serial_number': {'key': 'properties.serialNumber', 'type': 'str'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + 'model_description': {'key': 'properties.modelDescription', 'type': 'str'}, + 'device_type': {'key': 'properties.deviceType', 'type': 'str'}, + 'friendly_name': {'key': 'properties.friendlyName', 'type': 'str'}, + 'culture': {'key': 'properties.culture', 'type': 'str'}, + 'device_model': {'key': 'properties.deviceModel', 'type': 'str'}, + 'device_software_version': {'key': 'properties.deviceSoftwareVersion', 'type': 'str'}, + 'device_local_capacity': {'key': 'properties.deviceLocalCapacity', 'type': 'long'}, + 'time_zone': {'key': 'properties.timeZone', 'type': 'str'}, + 'device_hcs_version': {'key': 'properties.deviceHcsVersion', 'type': 'str'}, + 'configured_role_types': {'key': 'properties.configuredRoleTypes', 'type': '[str]'}, + 'node_count': {'key': 'properties.nodeCount', 'type': 'int'}, + 'resource_move_details': {'key': 'properties.resourceMoveDetails', 'type': 'ResourceMoveDetails'}, + 'edge_profile': {'key': 'properties.edgeProfile', 'type': 'EdgeProfile'}, + } + + def __init__( + self, + **kwargs + ): + super(DataBoxEdgeDevice, self).__init__(**kwargs) + self.location = kwargs['location'] + self.tags = kwargs.get('tags', None) + self.sku = kwargs.get('sku', None) + self.etag = kwargs.get('etag', None) + self.identity = kwargs.get('identity', None) + self.kind = None + self.system_data = None + self.data_box_edge_device_status = kwargs.get('data_box_edge_device_status', None) + self.serial_number = None + self.description = None + self.model_description = None + self.device_type = None + self.friendly_name = None + self.culture = None + self.device_model = None + self.device_software_version = None + self.device_local_capacity = None + self.time_zone = None + self.device_hcs_version = None + self.configured_role_types = None + self.node_count = None + self.resource_move_details = None + self.edge_profile = None + + +class DataBoxEdgeDeviceExtendedInfo(ARMBaseModel): + """The extended Info of the Data Box Edge/Gateway device. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: The path ID that uniquely identifies the object. + :vartype id: str + :ivar name: The object name. + :vartype name: str + :ivar type: The hierarchical type of the object. + :vartype type: str + :param encryption_key_thumbprint: The digital signature of encrypted certificate. + :type encryption_key_thumbprint: str + :param encryption_key: The public part of the encryption certificate. Client uses this to + encrypt any secret. + :type encryption_key: str + :ivar resource_key: The Resource ID of the Resource. + :vartype resource_key: str + :param client_secret_store_id: The Key Vault ARM Id for client secrets. + :type client_secret_store_id: str + :param client_secret_store_url: The url to access the Client Key Vault. + :type client_secret_store_url: str + :param channel_integrity_key_name: The name of Channel Integrity Key stored in the Client Key + Vault. + :type channel_integrity_key_name: str + :param channel_integrity_key_version: The version of Channel Integrity Key stored in the Client + Key Vault. + :type channel_integrity_key_version: str + """ + + _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'}, + 'client_secret_store_id': {'key': 'properties.clientSecretStoreId', 'type': 'str'}, + 'client_secret_store_url': {'key': 'properties.clientSecretStoreUrl', 'type': 'str'}, + 'channel_integrity_key_name': {'key': 'properties.channelIntegrityKeyName', 'type': 'str'}, + 'channel_integrity_key_version': {'key': 'properties.channelIntegrityKeyVersion', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(DataBoxEdgeDeviceExtendedInfo, self).__init__(**kwargs) + self.encryption_key_thumbprint = kwargs.get('encryption_key_thumbprint', None) + self.encryption_key = kwargs.get('encryption_key', None) + self.resource_key = None + self.client_secret_store_id = kwargs.get('client_secret_store_id', None) + self.client_secret_store_url = kwargs.get('client_secret_store_url', None) + self.channel_integrity_key_name = kwargs.get('channel_integrity_key_name', None) + self.channel_integrity_key_version = kwargs.get('channel_integrity_key_version', None) + + +class DataBoxEdgeDeviceExtendedInfoPatch(msrest.serialization.Model): + """The Data Box Edge/Gateway device extended info patch. + + :param client_secret_store_id: The Key Vault ARM Id for client secrets. + :type client_secret_store_id: str + :param client_secret_store_url: The url to access the Client Key Vault. + :type client_secret_store_url: str + :param channel_integrity_key_name: The name for Channel Integrity Key stored in the Client Key + Vault. + :type channel_integrity_key_name: str + :param channel_integrity_key_version: The version of Channel Integrity Key stored in the Client + Key Vault. + :type channel_integrity_key_version: str + """ + + _attribute_map = { + 'client_secret_store_id': {'key': 'clientSecretStoreId', 'type': 'str'}, + 'client_secret_store_url': {'key': 'clientSecretStoreUrl', 'type': 'str'}, + 'channel_integrity_key_name': {'key': 'channelIntegrityKeyName', 'type': 'str'}, + 'channel_integrity_key_version': {'key': 'channelIntegrityKeyVersion', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(DataBoxEdgeDeviceExtendedInfoPatch, self).__init__(**kwargs) + self.client_secret_store_id = kwargs.get('client_secret_store_id', None) + self.client_secret_store_url = kwargs.get('client_secret_store_url', None) + self.channel_integrity_key_name = kwargs.get('channel_integrity_key_name', None) + self.channel_integrity_key_version = kwargs.get('channel_integrity_key_version', None) + + +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[~azure.mgmt.databoxedge.v2020_09_01_preview.models.DataBoxEdgeDevice] + :ivar next_link: Link to the next set of results. + :vartype next_link: str + """ + + _validation = { + 'value': {'readonly': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[DataBoxEdgeDevice]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(DataBoxEdgeDeviceList, self).__init__(**kwargs) + self.value = None + self.next_link = None + + +class DataBoxEdgeDevicePatch(msrest.serialization.Model): + """The Data Box Edge/Gateway device patch. + + :param tags: A set of tags. The tags attached to the Data Box Edge/Gateway resource. + :type tags: dict[str, str] + :param identity: Msi identity of the resource. + :type identity: ~azure.mgmt.databoxedge.v2020_09_01_preview.models.ResourceIdentity + :param edge_profile: Edge Profile property of the Data Box Edge/Gateway device. + :type edge_profile: ~azure.mgmt.databoxedge.v2020_09_01_preview.models.EdgeProfilePatch + """ + + _attribute_map = { + 'tags': {'key': 'tags', 'type': '{str}'}, + 'identity': {'key': 'identity', 'type': 'ResourceIdentity'}, + 'edge_profile': {'key': 'properties.edgeProfile', 'type': 'EdgeProfilePatch'}, + } + + def __init__( + self, + **kwargs + ): + super(DataBoxEdgeDevicePatch, self).__init__(**kwargs) + self.tags = kwargs.get('tags', None) + self.identity = kwargs.get('identity', None) + self.edge_profile = kwargs.get('edge_profile', None) + + +class DataBoxEdgeMoveRequest(msrest.serialization.Model): + """Resource Move details. + + All required parameters must be populated in order to send to Azure. + + :param target_resource_group: Required. Target resource group ARMId. + :type target_resource_group: str + :param resources: Required. List of resources to be moved. + :type resources: list[str] + """ + + _validation = { + 'target_resource_group': {'required': True}, + 'resources': {'required': True}, + } + + _attribute_map = { + 'target_resource_group': {'key': 'targetResourceGroup', 'type': 'str'}, + 'resources': {'key': 'resources', 'type': '[str]'}, + } + + def __init__( + self, + **kwargs + ): + super(DataBoxEdgeMoveRequest, self).__init__(**kwargs) + self.target_resource_group = kwargs['target_resource_group'] + self.resources = kwargs['resources'] + + +class DataBoxEdgeSku(msrest.serialization.Model): + """The Sku information. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar resource_type: The type of the resource. + :vartype resource_type: str + :ivar name: The Sku name. Possible values include: "Gateway", "Edge", "TEA_1Node", + "TEA_1Node_UPS", "TEA_1Node_Heater", "TEA_1Node_UPS_Heater", "TEA_4Node_Heater", + "TEA_4Node_UPS_Heater", "TMA", "TDC", "TCA_Small", "GPU", "TCA_Large", "EdgeP_Base", + "EdgeP_High", "EdgePR_Base", "EdgePR_Base_UPS", "EdgeMR_Mini", "RCA_Small", "RCA_Large", "RDC". + :vartype name: str or ~azure.mgmt.databoxedge.v2020_09_01_preview.models.SkuName + :ivar kind: The Sku kind. + :vartype kind: str + :ivar tier: The Sku tier. Possible values include: "Standard". + :vartype tier: str or ~azure.mgmt.databoxedge.v2020_09_01_preview.models.SkuTier + :ivar size: The Sku kind. + :vartype size: str + :ivar family: The Sku family. + :vartype family: str + :ivar locations: Availability of the Sku for the region. + :vartype locations: list[str] + :ivar api_versions: The API versions in which Sku is available. + :vartype api_versions: list[str] + :ivar location_info: Availability of the Sku for the location/zone/site. + :vartype location_info: + list[~azure.mgmt.databoxedge.v2020_09_01_preview.models.SkuLocationInfo] + :ivar costs: The pricing info of the Sku. + :vartype costs: list[~azure.mgmt.databoxedge.v2020_09_01_preview.models.SkuCost] + :ivar signup_option: Sku can be signed up by customer or not. Possible values include: "None", + "Available". + :vartype signup_option: str or + ~azure.mgmt.databoxedge.v2020_09_01_preview.models.SkuSignupOption + :ivar version: Availability of the Sku as preview/stable. Possible values include: "Stable", + "Preview". + :vartype version: str or ~azure.mgmt.databoxedge.v2020_09_01_preview.models.SkuVersion + :ivar availability: Links to the next set of results. Possible values include: "Available", + "Unavailable". + :vartype availability: str or + ~azure.mgmt.databoxedge.v2020_09_01_preview.models.SkuAvailability + :ivar shipment_types: List of Shipment Types supported by this SKU. + :vartype shipment_types: list[str or + ~azure.mgmt.databoxedge.v2020_09_01_preview.models.ShipmentType] + """ + + _validation = { + 'resource_type': {'readonly': True}, + 'name': {'readonly': True}, + 'kind': {'readonly': True}, + 'tier': {'readonly': True}, + 'size': {'readonly': True}, + 'family': {'readonly': True}, + 'locations': {'readonly': True}, + 'api_versions': {'readonly': True}, + 'location_info': {'readonly': True}, + 'costs': {'readonly': True}, + 'signup_option': {'readonly': True}, + 'version': {'readonly': True}, + 'availability': {'readonly': True}, + 'shipment_types': {'readonly': True}, + } + + _attribute_map = { + 'resource_type': {'key': 'resourceType', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'tier': {'key': 'tier', 'type': 'str'}, + 'size': {'key': 'size', 'type': 'str'}, + 'family': {'key': 'family', 'type': 'str'}, + 'locations': {'key': 'locations', 'type': '[str]'}, + 'api_versions': {'key': 'apiVersions', 'type': '[str]'}, + 'location_info': {'key': 'locationInfo', 'type': '[SkuLocationInfo]'}, + 'costs': {'key': 'costs', 'type': '[SkuCost]'}, + 'signup_option': {'key': 'signupOption', 'type': 'str'}, + 'version': {'key': 'version', 'type': 'str'}, + 'availability': {'key': 'availability', 'type': 'str'}, + 'shipment_types': {'key': 'shipmentTypes', 'type': '[str]'}, + } + + def __init__( + self, + **kwargs + ): + super(DataBoxEdgeSku, self).__init__(**kwargs) + self.resource_type = None + self.name = None + self.kind = None + self.tier = None + self.size = None + self.family = None + self.locations = None + self.api_versions = None + self.location_info = None + self.costs = None + self.signup_option = None + self.version = None + self.availability = None + self.shipment_types = None + + +class DataBoxEdgeSkuList(msrest.serialization.Model): + """List of SKU Information objects. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar value: List of ResourceType Sku. + :vartype value: list[~azure.mgmt.databoxedge.v2020_09_01_preview.models.DataBoxEdgeSku] + :ivar next_link: Links to the next set of results. + :vartype next_link: str + """ + + _validation = { + 'value': {'readonly': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[DataBoxEdgeSku]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(DataBoxEdgeSkuList, self).__init__(**kwargs) + self.value = None + self.next_link = None + + +class DCAccessCode(msrest.serialization.Model): + """DC Access code in the case of Self Managed Shipping. + + :param auth_code: DCAccess Code for the Self Managed shipment. + :type auth_code: str + """ + + _attribute_map = { + 'auth_code': {'key': 'properties.authCode', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(DCAccessCode, self).__init__(**kwargs) + self.auth_code = kwargs.get('auth_code', None) + + +class EdgeProfile(msrest.serialization.Model): + """Details about Edge Profile for the resource. + + :param subscription: Edge Profile Subscription. + :type subscription: ~azure.mgmt.databoxedge.v2020_09_01_preview.models.EdgeProfileSubscription + """ + + _attribute_map = { + 'subscription': {'key': 'subscription', 'type': 'EdgeProfileSubscription'}, + } + + def __init__( + self, + **kwargs + ): + super(EdgeProfile, self).__init__(**kwargs) + self.subscription = kwargs.get('subscription', None) + + +class EdgeProfilePatch(msrest.serialization.Model): + """The Data Box Edge/Gateway Edge Profile patch. + + :param subscription: The Data Box Edge/Gateway Edge Profile Subscription patch. + :type subscription: + ~azure.mgmt.databoxedge.v2020_09_01_preview.models.EdgeProfileSubscriptionPatch + """ + + _attribute_map = { + 'subscription': {'key': 'subscription', 'type': 'EdgeProfileSubscriptionPatch'}, + } + + def __init__( + self, + **kwargs + ): + super(EdgeProfilePatch, self).__init__(**kwargs) + self.subscription = kwargs.get('subscription', None) + + +class EdgeProfileSubscription(msrest.serialization.Model): + """Subscription details for the Edge Profile. + + :param registration_id: Edge Subscription Registration ID. + :type registration_id: str + :param id: ARM ID of the subscription. + :type id: str + :param state: Possible values include: "Registered", "Warned", "Suspended", "Deleted", + "Unregistered". + :type state: str or ~azure.mgmt.databoxedge.v2020_09_01_preview.models.SubscriptionState + :param registration_date: + :type registration_date: str + :param subscription_id: + :type subscription_id: str + :param tenant_id: + :type tenant_id: str + :param location_placement_id: + :type location_placement_id: str + :param quota_id: + :type quota_id: str + :param serialized_details: + :type serialized_details: str + :param registered_features: + :type registered_features: + list[~azure.mgmt.databoxedge.v2020_09_01_preview.models.SubscriptionRegisteredFeatures] + """ + + _attribute_map = { + 'registration_id': {'key': 'registrationId', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + 'state': {'key': 'state', 'type': 'str'}, + 'registration_date': {'key': 'registrationDate', 'type': 'str'}, + 'subscription_id': {'key': 'subscriptionId', 'type': 'str'}, + 'tenant_id': {'key': 'properties.tenantId', 'type': 'str'}, + 'location_placement_id': {'key': 'properties.locationPlacementId', 'type': 'str'}, + 'quota_id': {'key': 'properties.quotaId', 'type': 'str'}, + 'serialized_details': {'key': 'properties.serializedDetails', 'type': 'str'}, + 'registered_features': {'key': 'properties.registeredFeatures', 'type': '[SubscriptionRegisteredFeatures]'}, + } + + def __init__( + self, + **kwargs + ): + super(EdgeProfileSubscription, self).__init__(**kwargs) + self.registration_id = kwargs.get('registration_id', None) + self.id = kwargs.get('id', None) + self.state = kwargs.get('state', None) + self.registration_date = kwargs.get('registration_date', None) + self.subscription_id = kwargs.get('subscription_id', None) + self.tenant_id = kwargs.get('tenant_id', None) + self.location_placement_id = kwargs.get('location_placement_id', None) + self.quota_id = kwargs.get('quota_id', None) + self.serialized_details = kwargs.get('serialized_details', None) + self.registered_features = kwargs.get('registered_features', None) + + +class EdgeProfileSubscriptionPatch(msrest.serialization.Model): + """The Data Box Edge/Gateway Edge Profile Subscription patch. + + :param id: The path ID that uniquely identifies the subscription of the edge profile. + :type id: str + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(EdgeProfileSubscriptionPatch, self).__init__(**kwargs) + self.id = kwargs.get('id', None) + + +class EtcdInfo(msrest.serialization.Model): + """Etcd configuration. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar type: Etcd type. + :vartype type: str + :ivar version: Etcd version. + :vartype version: str + """ + + _validation = { + 'type': {'readonly': True}, + 'version': {'readonly': True}, + } + + _attribute_map = { + 'type': {'key': 'type', 'type': 'str'}, + 'version': {'key': 'version', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(EtcdInfo, self).__init__(**kwargs) + self.type = None + self.version = None + + +class Trigger(ARMBaseModel): + """Trigger details. + + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: FileEventTrigger, PeriodicTimerEventTrigger. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: The path ID that uniquely identifies the object. + :vartype id: str + :ivar name: The object name. + :vartype name: str + :ivar type: The hierarchical type of the object. + :vartype type: str + :ivar system_data: Trigger in DataBoxEdge Resource. + :vartype system_data: ~azure.mgmt.databoxedge.v2020_09_01_preview.models.SystemData + :param kind: Required. Trigger Kind.Constant filled by server. Possible values include: + "FileEvent", "PeriodicTimerEvent". + :type kind: str or ~azure.mgmt.databoxedge.v2020_09_01_preview.models.TriggerEventType + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'system_data': {'readonly': True}, + 'kind': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'kind': {'key': 'kind', 'type': 'str'}, + } + + _subtype_map = { + 'kind': {'FileEvent': 'FileEventTrigger', 'PeriodicTimerEvent': 'PeriodicTimerEventTrigger'} + } + + def __init__( + self, + **kwargs + ): + super(Trigger, self).__init__(**kwargs) + self.system_data = None + self.kind = 'Trigger' # type: str + + +class FileEventTrigger(Trigger): + """Trigger details. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: The path ID that uniquely identifies the object. + :vartype id: str + :ivar name: The object name. + :vartype name: str + :ivar type: The hierarchical type of the object. + :vartype type: str + :ivar system_data: Trigger in DataBoxEdge Resource. + :vartype system_data: ~azure.mgmt.databoxedge.v2020_09_01_preview.models.SystemData + :param kind: Required. Trigger Kind.Constant filled by server. Possible values include: + "FileEvent", "PeriodicTimerEvent". + :type kind: str or ~azure.mgmt.databoxedge.v2020_09_01_preview.models.TriggerEventType + :param source_info: Required. File event source details. + :type source_info: ~azure.mgmt.databoxedge.v2020_09_01_preview.models.FileSourceInfo + :param sink_info: Required. Role sink info. + :type sink_info: ~azure.mgmt.databoxedge.v2020_09_01_preview.models.RoleSinkInfo + :param custom_context_tag: A custom context tag typically used to correlate the trigger against + its usage. For example, if a periodic timer trigger is intended for certain specific IoT + modules in the device, the tag can be the name or the image URL of the module. + :type custom_context_tag: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'system_data': {'readonly': True}, + 'kind': {'required': True}, + 'source_info': {'required': True}, + 'sink_info': {'required': True}, + 'custom_context_tag': {'max_length': 192, 'min_length': 0}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'source_info': {'key': 'properties.sourceInfo', 'type': 'FileSourceInfo'}, + 'sink_info': {'key': 'properties.sinkInfo', 'type': 'RoleSinkInfo'}, + 'custom_context_tag': {'key': 'properties.customContextTag', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(FileEventTrigger, self).__init__(**kwargs) + self.kind = 'FileEvent' # type: str + self.source_info = kwargs['source_info'] + self.sink_info = kwargs['sink_info'] + self.custom_context_tag = kwargs.get('custom_context_tag', None) + + +class FileSourceInfo(msrest.serialization.Model): + """File source details. + + All required parameters must be populated in order to send to Azure. + + :param share_id: Required. File share ID. + :type share_id: str + """ + + _validation = { + 'share_id': {'required': True}, + } + + _attribute_map = { + 'share_id': {'key': 'shareId', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(FileSourceInfo, self).__init__(**kwargs) + self.share_id = kwargs['share_id'] + + +class GenerateCertResponse(msrest.serialization.Model): + """Used in activation key generation flow. + + :param public_key: Gets or sets base64 encoded certificate raw data, + this is the public part needed to be uploaded to cert vault. + :type public_key: str + :param private_key: Gets or sets base64 encoded private part of the certificate, + needed to form the activation key. + :type private_key: str + :param expiry_time_in_utc: Gets or sets expiry time in UTC. + :type expiry_time_in_utc: str + """ + + _attribute_map = { + 'public_key': {'key': 'publicKey', 'type': 'str'}, + 'private_key': {'key': 'privateKey', 'type': 'str'}, + 'expiry_time_in_utc': {'key': 'expiryTimeInUTC', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(GenerateCertResponse, self).__init__(**kwargs) + self.public_key = kwargs.get('public_key', None) + self.private_key = kwargs.get('private_key', None) + self.expiry_time_in_utc = kwargs.get('expiry_time_in_utc', None) + + +class ImageRepositoryCredential(msrest.serialization.Model): + """Image repository credential. + + All required parameters must be populated in order to send to Azure. + + :param image_repository_url: Required. Image repository url (e.g.: mcr.microsoft.com). + :type image_repository_url: str + :param user_name: Required. Repository user name. + :type user_name: str + :param password: Repository user password. + :type password: ~azure.mgmt.databoxedge.v2020_09_01_preview.models.AsymmetricEncryptedSecret + """ + + _validation = { + 'image_repository_url': {'required': True}, + 'user_name': {'required': True}, + } + + _attribute_map = { + 'image_repository_url': {'key': 'imageRepositoryUrl', 'type': 'str'}, + 'user_name': {'key': 'userName', 'type': 'str'}, + 'password': {'key': 'password', 'type': 'AsymmetricEncryptedSecret'}, + } + + def __init__( + self, + **kwargs + ): + super(ImageRepositoryCredential, self).__init__(**kwargs) + self.image_repository_url = kwargs['image_repository_url'] + self.user_name = kwargs['user_name'] + self.password = kwargs.get('password', None) + + +class IoTAddon(Addon): + """IoT Addon. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: The path ID that uniquely identifies the object. + :vartype id: str + :ivar name: The object name. + :vartype name: str + :ivar type: The hierarchical type of the object. + :vartype type: str + :param kind: Required. Addon type.Constant filled by server. Possible values include: + "IotEdge", "ArcForKubernetes". + :type kind: str or ~azure.mgmt.databoxedge.v2020_09_01_preview.models.AddonType + :ivar system_data: Addon type. + :vartype system_data: ~azure.mgmt.databoxedge.v2020_09_01_preview.models.SystemData + :param io_t_device_details: Required. IoT device metadata to which appliance needs to be + connected. + :type io_t_device_details: ~azure.mgmt.databoxedge.v2020_09_01_preview.models.IoTDeviceInfo + :param io_t_edge_device_details: Required. IoT edge device to which the IoT Addon needs to be + configured. + :type io_t_edge_device_details: + ~azure.mgmt.databoxedge.v2020_09_01_preview.models.IoTDeviceInfo + :ivar version: Version of IoT running on the appliance. + :vartype version: str + :ivar host_platform: Host OS supported by the IoT addon. Possible values include: "Windows", + "Linux". + :vartype host_platform: str or ~azure.mgmt.databoxedge.v2020_09_01_preview.models.PlatformType + :ivar host_platform_type: Platform where the runtime is hosted. Possible values include: + "KubernetesCluster", "LinuxVM". + :vartype host_platform_type: str or + ~azure.mgmt.databoxedge.v2020_09_01_preview.models.HostPlatformType + :ivar provisioning_state: Addon Provisioning State. Possible values include: "Invalid", + "Creating", "Created", "Updating", "Reconfiguring", "Failed", "Deleting". + :vartype provisioning_state: str or + ~azure.mgmt.databoxedge.v2020_09_01_preview.models.AddonState + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'kind': {'required': True}, + 'system_data': {'readonly': True}, + 'io_t_device_details': {'required': True}, + 'io_t_edge_device_details': {'required': True}, + 'version': {'readonly': True}, + 'host_platform': {'readonly': True}, + 'host_platform_type': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'io_t_device_details': {'key': 'properties.ioTDeviceDetails', 'type': 'IoTDeviceInfo'}, + 'io_t_edge_device_details': {'key': 'properties.ioTEdgeDeviceDetails', 'type': 'IoTDeviceInfo'}, + 'version': {'key': 'properties.version', 'type': 'str'}, + 'host_platform': {'key': 'properties.hostPlatform', 'type': 'str'}, + 'host_platform_type': {'key': 'properties.hostPlatformType', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(IoTAddon, self).__init__(**kwargs) + self.kind = 'IotEdge' # type: str + self.io_t_device_details = kwargs['io_t_device_details'] + self.io_t_edge_device_details = kwargs['io_t_edge_device_details'] + self.version = None + self.host_platform = None + self.host_platform_type = None + self.provisioning_state = None + + +class IoTDeviceInfo(msrest.serialization.Model): + """Metadata of IoT device/IoT Edge device to be configured. + + All required parameters must be populated in order to send to Azure. + + :param device_id: Required. ID of the IoT device/edge device. + :type device_id: str + :param io_t_host_hub: Required. Host name for the IoT hub associated to the device. + :type io_t_host_hub: str + :param io_t_host_hub_id: Id for the IoT hub associated to the device. + :type io_t_host_hub_id: str + :param authentication: Encrypted IoT device/IoT edge device connection string. + :type authentication: ~azure.mgmt.databoxedge.v2020_09_01_preview.models.Authentication + """ + + _validation = { + 'device_id': {'required': True}, + 'io_t_host_hub': {'required': True}, + } + + _attribute_map = { + 'device_id': {'key': 'deviceId', 'type': 'str'}, + 'io_t_host_hub': {'key': 'ioTHostHub', 'type': 'str'}, + 'io_t_host_hub_id': {'key': 'ioTHostHubId', 'type': 'str'}, + 'authentication': {'key': 'authentication', 'type': 'Authentication'}, + } + + def __init__( + self, + **kwargs + ): + super(IoTDeviceInfo, self).__init__(**kwargs) + self.device_id = kwargs['device_id'] + self.io_t_host_hub = kwargs['io_t_host_hub'] + self.io_t_host_hub_id = kwargs.get('io_t_host_hub_id', None) + self.authentication = kwargs.get('authentication', None) + + +class IoTEdgeAgentInfo(msrest.serialization.Model): + """IoT edge agent details is optional, this will be used for download system Agent module while bootstrapping IoT Role if specified. + + All required parameters must be populated in order to send to Azure. + + :param image_name: Required. Name of the IoT edge agent image. + :type image_name: str + :param tag: Required. Image Tag. + :type tag: str + :param image_repository: Image repository details. + :type image_repository: + ~azure.mgmt.databoxedge.v2020_09_01_preview.models.ImageRepositoryCredential + """ + + _validation = { + 'image_name': {'required': True}, + 'tag': {'required': True}, + } + + _attribute_map = { + 'image_name': {'key': 'imageName', 'type': 'str'}, + 'tag': {'key': 'tag', 'type': 'str'}, + 'image_repository': {'key': 'imageRepository', 'type': 'ImageRepositoryCredential'}, + } + + def __init__( + self, + **kwargs + ): + super(IoTEdgeAgentInfo, self).__init__(**kwargs) + self.image_name = kwargs['image_name'] + self.tag = kwargs['tag'] + self.image_repository = kwargs.get('image_repository', None) + + +class IoTRole(Role): + """Compute role. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: The path ID that uniquely identifies the object. + :vartype id: str + :ivar name: The object name. + :vartype name: str + :ivar type: The hierarchical type of the object. + :vartype type: str + :param kind: Required. Role type.Constant filled by server. Possible values include: "IOT", + "ASA", "Functions", "Cognitive", "MEC", "CloudEdgeManagement", "Kubernetes". + :type kind: str or ~azure.mgmt.databoxedge.v2020_09_01_preview.models.RoleTypes + :ivar system_data: Role configured on ASE resource. + :vartype system_data: ~azure.mgmt.databoxedge.v2020_09_01_preview.models.SystemData + :param host_platform: Host OS supported by the IoT role. Possible values include: "Windows", + "Linux". + :type host_platform: str or ~azure.mgmt.databoxedge.v2020_09_01_preview.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: ~azure.mgmt.databoxedge.v2020_09_01_preview.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: + ~azure.mgmt.databoxedge.v2020_09_01_preview.models.IoTDeviceInfo + :param share_mappings: Mount points of shares in role(s). + :type share_mappings: list[~azure.mgmt.databoxedge.v2020_09_01_preview.models.MountPointMap] + :param io_t_edge_agent_info: Iot edge agent details to download the agent and bootstrap iot + runtime. + :type io_t_edge_agent_info: ~azure.mgmt.databoxedge.v2020_09_01_preview.models.IoTEdgeAgentInfo + :ivar host_platform_type: Platform where the Iot runtime is hosted. Possible values include: + "KubernetesCluster", "LinuxVM". + :vartype host_platform_type: str or + ~azure.mgmt.databoxedge.v2020_09_01_preview.models.HostPlatformType + :param compute_resource: Resource allocation. + :type compute_resource: ~azure.mgmt.databoxedge.v2020_09_01_preview.models.ComputeResource + :param role_status: Role status. Possible values include: "Enabled", "Disabled". + :type role_status: str or ~azure.mgmt.databoxedge.v2020_09_01_preview.models.RoleStatus + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'kind': {'required': True}, + 'system_data': {'readonly': True}, + 'host_platform_type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'host_platform': {'key': 'properties.hostPlatform', 'type': 'str'}, + 'io_t_device_details': {'key': 'properties.ioTDeviceDetails', 'type': 'IoTDeviceInfo'}, + 'io_t_edge_device_details': {'key': 'properties.ioTEdgeDeviceDetails', 'type': 'IoTDeviceInfo'}, + 'share_mappings': {'key': 'properties.shareMappings', 'type': '[MountPointMap]'}, + 'io_t_edge_agent_info': {'key': 'properties.ioTEdgeAgentInfo', 'type': 'IoTEdgeAgentInfo'}, + 'host_platform_type': {'key': 'properties.hostPlatformType', 'type': 'str'}, + 'compute_resource': {'key': 'properties.computeResource', 'type': 'ComputeResource'}, + 'role_status': {'key': 'properties.roleStatus', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(IoTRole, self).__init__(**kwargs) + self.kind = 'IOT' # type: str + self.host_platform = kwargs.get('host_platform', None) + self.io_t_device_details = kwargs.get('io_t_device_details', None) + self.io_t_edge_device_details = kwargs.get('io_t_edge_device_details', None) + self.share_mappings = kwargs.get('share_mappings', None) + self.io_t_edge_agent_info = kwargs.get('io_t_edge_agent_info', None) + self.host_platform_type = None + self.compute_resource = kwargs.get('compute_resource', None) + self.role_status = kwargs.get('role_status', None) + + +class Ipv4Config(msrest.serialization.Model): + """Details related to the IPv4 address configuration. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar ip_address: The IPv4 address of the network adapter. + :vartype ip_address: str + :ivar subnet: The IPv4 subnet of the network adapter. + :vartype subnet: str + :ivar gateway: The IPv4 gateway of the network adapter. + :vartype gateway: str + """ + + _validation = { + 'ip_address': {'readonly': True}, + 'subnet': {'readonly': True}, + 'gateway': {'readonly': True}, + } + + _attribute_map = { + 'ip_address': {'key': 'ipAddress', 'type': 'str'}, + 'subnet': {'key': 'subnet', 'type': 'str'}, + 'gateway': {'key': 'gateway', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(Ipv4Config, self).__init__(**kwargs) + self.ip_address = None + self.subnet = None + self.gateway = None + + +class Ipv6Config(msrest.serialization.Model): + """Details related to the IPv6 address configuration. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar ip_address: The IPv6 address of the network adapter. + :vartype ip_address: str + :ivar prefix_length: The IPv6 prefix of the network adapter. + :vartype prefix_length: int + :ivar gateway: The IPv6 gateway of the network adapter. + :vartype gateway: str + """ + + _validation = { + 'ip_address': {'readonly': True}, + 'prefix_length': {'readonly': True}, + 'gateway': {'readonly': True}, + } + + _attribute_map = { + 'ip_address': {'key': 'ipAddress', 'type': 'str'}, + 'prefix_length': {'key': 'prefixLength', 'type': 'int'}, + 'gateway': {'key': 'gateway', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(Ipv6Config, self).__init__(**kwargs) + self.ip_address = None + self.prefix_length = None + self.gateway = None + + +class Job(msrest.serialization.Model): + """A device job. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: The path ID that uniquely identifies the object. + :vartype id: str + :ivar name: The name of the object. + :vartype name: str + :ivar type: The hierarchical type of the object. + :vartype type: str + :ivar status: The current status of the job. Possible values include: "Invalid", "Running", + "Succeeded", "Failed", "Canceled", "Paused", "Scheduled". + :vartype status: str or ~azure.mgmt.databoxedge.v2020_09_01_preview.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: ~azure.mgmt.databoxedge.v2020_09_01_preview.models.JobErrorDetails + :ivar job_type: The type of the job. Possible values include: "Invalid", "ScanForUpdates", + "DownloadUpdates", "InstallUpdates", "RefreshShare", "RefreshContainer", "Backup", "Restore", + "TriggerSupportPackage". + :vartype job_type: str or ~azure.mgmt.databoxedge.v2020_09_01_preview.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 + ~azure.mgmt.databoxedge.v2020_09_01_preview.models.UpdateOperationStage + :ivar download_progress: The download progress. + :vartype download_progress: + ~azure.mgmt.databoxedge.v2020_09_01_preview.models.UpdateDownloadProgress + :ivar install_progress: The install progress. + :vartype install_progress: + ~azure.mgmt.databoxedge.v2020_09_01_preview.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[~azure.mgmt.databoxedge.v2020_09_01_preview.models.JobErrorItem] + :ivar code: The code intended for programmatic access. + :vartype code: str + :ivar message: The message that describes the error in detail. + :vartype message: str + """ + + _validation = { + 'error_details': {'readonly': True}, + 'code': {'readonly': True}, + 'message': {'readonly': True}, + } + + _attribute_map = { + 'error_details': {'key': 'errorDetails', 'type': '[JobErrorItem]'}, + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(JobErrorDetails, self).__init__(**kwargs) + self.error_details = None + self.code = None + self.message = None + + +class JobErrorItem(msrest.serialization.Model): + """The job error items. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar recommendations: The recommended actions. + :vartype recommendations: list[str] + :ivar code: The code intended for programmatic access. + :vartype code: str + :ivar message: The message that describes the error in detail. + :vartype message: str + """ + + _validation = { + 'recommendations': {'readonly': True}, + 'code': {'readonly': True}, + 'message': {'readonly': True}, + } + + _attribute_map = { + 'recommendations': {'key': 'recommendations', 'type': '[str]'}, + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(JobErrorItem, self).__init__(**kwargs) + self.recommendations = None + self.code = None + self.message = None + + +class KubernetesClusterInfo(msrest.serialization.Model): + """Kubernetes cluster configuration. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar etcd_info: Etcd configuration. + :vartype etcd_info: ~azure.mgmt.databoxedge.v2020_09_01_preview.models.EtcdInfo + :ivar nodes: Kubernetes cluster nodes. + :vartype nodes: list[~azure.mgmt.databoxedge.v2020_09_01_preview.models.NodeInfo] + :param version: Required. Kubernetes cluster version. + :type version: str + """ + + _validation = { + 'etcd_info': {'readonly': True}, + 'nodes': {'readonly': True}, + 'version': {'required': True}, + } + + _attribute_map = { + 'etcd_info': {'key': 'etcdInfo', 'type': 'EtcdInfo'}, + 'nodes': {'key': 'nodes', 'type': '[NodeInfo]'}, + 'version': {'key': 'version', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(KubernetesClusterInfo, self).__init__(**kwargs) + self.etcd_info = None + self.nodes = None + self.version = kwargs['version'] + + +class KubernetesIPConfiguration(msrest.serialization.Model): + """Kubernetes node IP configuration. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar port: Port of the Kubernetes node. + :vartype port: str + :param ip_address: IP address of the Kubernetes node. + :type ip_address: str + """ + + _validation = { + 'port': {'readonly': True}, + } + + _attribute_map = { + 'port': {'key': 'port', 'type': 'str'}, + 'ip_address': {'key': 'ipAddress', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(KubernetesIPConfiguration, self).__init__(**kwargs) + self.port = None + self.ip_address = kwargs.get('ip_address', None) + + +class KubernetesRole(Role): + """Kubernetes role. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: The path ID that uniquely identifies the object. + :vartype id: str + :ivar name: The object name. + :vartype name: str + :ivar type: The hierarchical type of the object. + :vartype type: str + :param kind: Required. Role type.Constant filled by server. Possible values include: "IOT", + "ASA", "Functions", "Cognitive", "MEC", "CloudEdgeManagement", "Kubernetes". + :type kind: str or ~azure.mgmt.databoxedge.v2020_09_01_preview.models.RoleTypes + :ivar system_data: Role configured on ASE resource. + :vartype system_data: ~azure.mgmt.databoxedge.v2020_09_01_preview.models.SystemData + :param host_platform: Host OS supported by the Kubernetes role. Possible values include: + "Windows", "Linux". + :type host_platform: str or ~azure.mgmt.databoxedge.v2020_09_01_preview.models.PlatformType + :ivar provisioning_state: State of Kubernetes deployment. Possible values include: "Invalid", + "Creating", "Created", "Updating", "Reconfiguring", "Failed", "Deleting". + :vartype provisioning_state: str or + ~azure.mgmt.databoxedge.v2020_09_01_preview.models.KubernetesState + :ivar host_platform_type: Platform where the runtime is hosted. Possible values include: + "KubernetesCluster", "LinuxVM". + :vartype host_platform_type: str or + ~azure.mgmt.databoxedge.v2020_09_01_preview.models.HostPlatformType + :param kubernetes_cluster_info: Kubernetes cluster configuration. + :type kubernetes_cluster_info: + ~azure.mgmt.databoxedge.v2020_09_01_preview.models.KubernetesClusterInfo + :param kubernetes_role_resources: Kubernetes role resources. + :type kubernetes_role_resources: + ~azure.mgmt.databoxedge.v2020_09_01_preview.models.KubernetesRoleResources + :param role_status: Role status. Possible values include: "Enabled", "Disabled". + :type role_status: str or ~azure.mgmt.databoxedge.v2020_09_01_preview.models.RoleStatus + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'kind': {'required': True}, + 'system_data': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + 'host_platform_type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'host_platform': {'key': 'properties.hostPlatform', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'host_platform_type': {'key': 'properties.hostPlatformType', 'type': 'str'}, + 'kubernetes_cluster_info': {'key': 'properties.kubernetesClusterInfo', 'type': 'KubernetesClusterInfo'}, + 'kubernetes_role_resources': {'key': 'properties.kubernetesRoleResources', 'type': 'KubernetesRoleResources'}, + 'role_status': {'key': 'properties.roleStatus', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(KubernetesRole, self).__init__(**kwargs) + self.kind = 'Kubernetes' # type: str + self.host_platform = kwargs.get('host_platform', None) + self.provisioning_state = None + self.host_platform_type = None + self.kubernetes_cluster_info = kwargs.get('kubernetes_cluster_info', None) + self.kubernetes_role_resources = kwargs.get('kubernetes_role_resources', None) + self.role_status = kwargs.get('role_status', None) + + +class KubernetesRoleCompute(msrest.serialization.Model): + """Kubernetes role compute resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :param vm_profile: Required. VM profile. + :type vm_profile: str + :ivar memory_in_bytes: Memory in bytes. + :vartype memory_in_bytes: long + :ivar processor_count: Processor count. + :vartype processor_count: int + """ + + _validation = { + 'vm_profile': {'required': True}, + 'memory_in_bytes': {'readonly': True}, + 'processor_count': {'readonly': True}, + } + + _attribute_map = { + 'vm_profile': {'key': 'vmProfile', 'type': 'str'}, + 'memory_in_bytes': {'key': 'memoryInBytes', 'type': 'long'}, + 'processor_count': {'key': 'processorCount', 'type': 'int'}, + } + + def __init__( + self, + **kwargs + ): + super(KubernetesRoleCompute, self).__init__(**kwargs) + self.vm_profile = kwargs['vm_profile'] + self.memory_in_bytes = None + self.processor_count = None + + +class KubernetesRoleNetwork(msrest.serialization.Model): + """Kubernetes role network resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar cni_config: Cni configuration. + :vartype cni_config: ~azure.mgmt.databoxedge.v2020_09_01_preview.models.CniConfig + :ivar load_balancer_config: Load balancer configuration. + :vartype load_balancer_config: + ~azure.mgmt.databoxedge.v2020_09_01_preview.models.LoadBalancerConfig + """ + + _validation = { + 'cni_config': {'readonly': True}, + 'load_balancer_config': {'readonly': True}, + } + + _attribute_map = { + 'cni_config': {'key': 'cniConfig', 'type': 'CniConfig'}, + 'load_balancer_config': {'key': 'loadBalancerConfig', 'type': 'LoadBalancerConfig'}, + } + + def __init__( + self, + **kwargs + ): + super(KubernetesRoleNetwork, self).__init__(**kwargs) + self.cni_config = None + self.load_balancer_config = None + + +class KubernetesRoleResources(msrest.serialization.Model): + """Kubernetes role resources. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :param storage: Kubernetes role storage resource. + :type storage: ~azure.mgmt.databoxedge.v2020_09_01_preview.models.KubernetesRoleStorage + :param compute: Required. Kubernetes role compute resource. + :type compute: ~azure.mgmt.databoxedge.v2020_09_01_preview.models.KubernetesRoleCompute + :ivar network: Kubernetes role network resource. + :vartype network: ~azure.mgmt.databoxedge.v2020_09_01_preview.models.KubernetesRoleNetwork + """ + + _validation = { + 'compute': {'required': True}, + 'network': {'readonly': True}, + } + + _attribute_map = { + 'storage': {'key': 'storage', 'type': 'KubernetesRoleStorage'}, + 'compute': {'key': 'compute', 'type': 'KubernetesRoleCompute'}, + 'network': {'key': 'network', 'type': 'KubernetesRoleNetwork'}, + } + + def __init__( + self, + **kwargs + ): + super(KubernetesRoleResources, self).__init__(**kwargs) + self.storage = kwargs.get('storage', None) + self.compute = kwargs['compute'] + self.network = None + + +class KubernetesRoleStorage(msrest.serialization.Model): + """Kubernetes role storage resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar storage_classes: Kubernetes storage class info. + :vartype storage_classes: + list[~azure.mgmt.databoxedge.v2020_09_01_preview.models.KubernetesRoleStorageClassInfo] + :param endpoints: Mount points of shares in role(s). + :type endpoints: list[~azure.mgmt.databoxedge.v2020_09_01_preview.models.MountPointMap] + """ + + _validation = { + 'storage_classes': {'readonly': True}, + } + + _attribute_map = { + 'storage_classes': {'key': 'storageClasses', 'type': '[KubernetesRoleStorageClassInfo]'}, + 'endpoints': {'key': 'endpoints', 'type': '[MountPointMap]'}, + } + + def __init__( + self, + **kwargs + ): + super(KubernetesRoleStorage, self).__init__(**kwargs) + self.storage_classes = None + self.endpoints = kwargs.get('endpoints', None) + + +class KubernetesRoleStorageClassInfo(msrest.serialization.Model): + """Kubernetes storage class info. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar name: Storage class name. + :vartype name: str + :ivar type: Storage class type. + :vartype type: str + :ivar posix_compliant: If provisioned storage is posix compliant. Possible values include: + "Invalid", "Enabled", "Disabled". + :vartype posix_compliant: str or + ~azure.mgmt.databoxedge.v2020_09_01_preview.models.PosixComplianceStatus + """ + + _validation = { + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'posix_compliant': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'posix_compliant': {'key': 'posixCompliant', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(KubernetesRoleStorageClassInfo, self).__init__(**kwargs) + self.name = None + self.type = None + self.posix_compliant = None + + +class LoadBalancerConfig(msrest.serialization.Model): + """Load balancer configuration. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar type: Load balancer type. + :vartype type: str + :ivar version: Load balancer version. + :vartype version: str + """ + + _validation = { + 'type': {'readonly': True}, + 'version': {'readonly': True}, + } + + _attribute_map = { + 'type': {'key': 'type', 'type': 'str'}, + 'version': {'key': 'version', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(LoadBalancerConfig, self).__init__(**kwargs) + self.type = None + self.version = None + + +class MECRole(Role): + """MEC role. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: The path ID that uniquely identifies the object. + :vartype id: str + :ivar name: The object name. + :vartype name: str + :ivar type: The hierarchical type of the object. + :vartype type: str + :param kind: Required. Role type.Constant filled by server. Possible values include: "IOT", + "ASA", "Functions", "Cognitive", "MEC", "CloudEdgeManagement", "Kubernetes". + :type kind: str or ~azure.mgmt.databoxedge.v2020_09_01_preview.models.RoleTypes + :ivar system_data: Role configured on ASE resource. + :vartype system_data: ~azure.mgmt.databoxedge.v2020_09_01_preview.models.SystemData + :param connection_string: Activation key of the MEC. + :type connection_string: + ~azure.mgmt.databoxedge.v2020_09_01_preview.models.AsymmetricEncryptedSecret + :param role_status: Role status. Possible values include: "Enabled", "Disabled". + :type role_status: str or ~azure.mgmt.databoxedge.v2020_09_01_preview.models.RoleStatus + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'kind': {'required': True}, + 'system_data': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'connection_string': {'key': 'properties.connectionString', 'type': 'AsymmetricEncryptedSecret'}, + 'role_status': {'key': 'properties.roleStatus', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(MECRole, self).__init__(**kwargs) + self.kind = 'MEC' # type: str + self.connection_string = kwargs.get('connection_string', None) + self.role_status = kwargs.get('role_status', None) + + +class MetricConfiguration(msrest.serialization.Model): + """Metric configuration. + + All required parameters must be populated in order to send to Azure. + + :param resource_id: Required. The Resource ID on which the metrics should be pushed. + :type resource_id: str + :param mdm_account: The MDM account to which the counters should be pushed. + :type mdm_account: str + :param metric_name_space: The MDM namespace to which the counters should be pushed. This is + required if MDMAccount is specified. + :type metric_name_space: str + :param counter_sets: Required. Host name for the IoT hub associated to the device. + :type counter_sets: list[~azure.mgmt.databoxedge.v2020_09_01_preview.models.MetricCounterSet] + """ + + _validation = { + 'resource_id': {'required': True}, + 'counter_sets': {'required': True}, + } + + _attribute_map = { + 'resource_id': {'key': 'resourceId', 'type': 'str'}, + 'mdm_account': {'key': 'mdmAccount', 'type': 'str'}, + 'metric_name_space': {'key': 'metricNameSpace', 'type': 'str'}, + 'counter_sets': {'key': 'counterSets', 'type': '[MetricCounterSet]'}, + } + + def __init__( + self, + **kwargs + ): + super(MetricConfiguration, self).__init__(**kwargs) + self.resource_id = kwargs['resource_id'] + self.mdm_account = kwargs.get('mdm_account', None) + self.metric_name_space = kwargs.get('metric_name_space', None) + self.counter_sets = kwargs['counter_sets'] + + +class MetricCounter(msrest.serialization.Model): + """The metric counter. + + All required parameters must be populated in order to send to Azure. + + :param name: Required. The counter name. + :type name: str + :param instance: The instance from which counter should be collected. + :type instance: str + :param dimension_filter: The dimension filter. + :type dimension_filter: + list[~azure.mgmt.databoxedge.v2020_09_01_preview.models.MetricDimension] + :param additional_dimensions: The additional dimensions to be added to metric. + :type additional_dimensions: + list[~azure.mgmt.databoxedge.v2020_09_01_preview.models.MetricDimension] + """ + + _validation = { + 'name': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'instance': {'key': 'instance', 'type': 'str'}, + 'dimension_filter': {'key': 'dimensionFilter', 'type': '[MetricDimension]'}, + 'additional_dimensions': {'key': 'additionalDimensions', 'type': '[MetricDimension]'}, + } + + def __init__( + self, + **kwargs + ): + super(MetricCounter, self).__init__(**kwargs) + self.name = kwargs['name'] + self.instance = kwargs.get('instance', None) + self.dimension_filter = kwargs.get('dimension_filter', None) + self.additional_dimensions = kwargs.get('additional_dimensions', None) + + +class MetricCounterSet(msrest.serialization.Model): + """The metric counter set. + + All required parameters must be populated in order to send to Azure. + + :param counters: Required. The counters that should be collected in this set. + :type counters: list[~azure.mgmt.databoxedge.v2020_09_01_preview.models.MetricCounter] + """ + + _validation = { + 'counters': {'required': True}, + } + + _attribute_map = { + 'counters': {'key': 'counters', 'type': '[MetricCounter]'}, + } + + def __init__( + self, + **kwargs + ): + super(MetricCounterSet, self).__init__(**kwargs) + self.counters = kwargs['counters'] + + +class MetricDimension(msrest.serialization.Model): + """The metric dimension. + + All required parameters must be populated in order to send to Azure. + + :param source_type: Required. The dimension type. + :type source_type: str + :param source_name: Required. The dimension value. + :type source_name: str + """ + + _validation = { + 'source_type': {'required': True}, + 'source_name': {'required': True}, + } + + _attribute_map = { + 'source_type': {'key': 'sourceType', 'type': 'str'}, + 'source_name': {'key': 'sourceName', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(MetricDimension, self).__init__(**kwargs) + self.source_type = kwargs['source_type'] + self.source_name = kwargs['source_name'] + + +class MetricDimensionV1(msrest.serialization.Model): + """Metric Dimension v1. + + :param name: Name of the metrics dimension. + :type name: str + :param display_name: Display name of the metrics dimension. + :type display_name: str + :param to_be_exported_for_shoebox: To be exported to shoe box. + :type to_be_exported_for_shoebox: bool + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'display_name': {'key': 'displayName', 'type': 'str'}, + 'to_be_exported_for_shoebox': {'key': 'toBeExportedForShoebox', 'type': 'bool'}, + } + + def __init__( + self, + **kwargs + ): + super(MetricDimensionV1, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.display_name = kwargs.get('display_name', None) + self.to_be_exported_for_shoebox = kwargs.get('to_be_exported_for_shoebox', None) + + +class MetricSpecificationV1(msrest.serialization.Model): + """Metric specification version 1. + + :param name: Name of the metric. + :type name: str + :param display_name: Display name of the metric. + :type display_name: str + :param display_description: Description of the metric to be displayed. + :type display_description: str + :param unit: Metric units. Possible values include: "NotSpecified", "Percent", "Count", + "Seconds", "Milliseconds", "Bytes", "BytesPerSecond", "CountPerSecond". + :type unit: str or ~azure.mgmt.databoxedge.v2020_09_01_preview.models.MetricUnit + :param aggregation_type: Metric aggregation type. Possible values include: "NotSpecified", + "None", "Average", "Minimum", "Maximum", "Total", "Count". + :type aggregation_type: str or + ~azure.mgmt.databoxedge.v2020_09_01_preview.models.MetricAggregationType + :param dimensions: Metric dimensions, other than default dimension which is resource. + :type dimensions: list[~azure.mgmt.databoxedge.v2020_09_01_preview.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 ~azure.mgmt.databoxedge.v2020_09_01_preview.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 + ~azure.mgmt.databoxedge.v2020_09_01_preview.models.TimeGrain] + :param supported_aggregation_types: Support metric aggregation type. + :type supported_aggregation_types: list[str or + ~azure.mgmt.databoxedge.v2020_09_01_preview.models.MetricAggregationType] + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'display_name': {'key': 'displayName', 'type': 'str'}, + 'display_description': {'key': 'displayDescription', 'type': 'str'}, + 'unit': {'key': 'unit', 'type': 'str'}, + 'aggregation_type': {'key': 'aggregationType', 'type': 'str'}, + 'dimensions': {'key': 'dimensions', 'type': '[MetricDimensionV1]'}, + 'fill_gap_with_zero': {'key': 'fillGapWithZero', 'type': 'bool'}, + 'category': {'key': 'category', 'type': 'str'}, + 'resource_id_dimension_name_override': {'key': 'resourceIdDimensionNameOverride', 'type': 'str'}, + 'supported_time_grain_types': {'key': 'supportedTimeGrainTypes', 'type': '[str]'}, + 'supported_aggregation_types': {'key': 'supportedAggregationTypes', 'type': '[str]'}, + } + + def __init__( + self, + **kwargs + ): + super(MetricSpecificationV1, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.display_name = kwargs.get('display_name', None) + self.display_description = kwargs.get('display_description', None) + self.unit = kwargs.get('unit', None) + self.aggregation_type = kwargs.get('aggregation_type', None) + self.dimensions = kwargs.get('dimensions', None) + self.fill_gap_with_zero = kwargs.get('fill_gap_with_zero', None) + self.category = kwargs.get('category', None) + self.resource_id_dimension_name_override = kwargs.get('resource_id_dimension_name_override', None) + self.supported_time_grain_types = kwargs.get('supported_time_grain_types', None) + self.supported_aggregation_types = kwargs.get('supported_aggregation_types', None) + + +class MonitoringMetricConfiguration(ARMBaseModel): + """The metric setting details for the role. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: The path ID that uniquely identifies the object. + :vartype id: str + :ivar name: The object name. + :vartype name: str + :ivar type: The hierarchical type of the object. + :vartype type: str + :param metric_configurations: Required. The metrics configuration details. + :type metric_configurations: + list[~azure.mgmt.databoxedge.v2020_09_01_preview.models.MetricConfiguration] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'metric_configurations': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'metric_configurations': {'key': 'properties.metricConfigurations', 'type': '[MetricConfiguration]'}, + } + + def __init__( + self, + **kwargs + ): + super(MonitoringMetricConfiguration, self).__init__(**kwargs) + self.metric_configurations = kwargs['metric_configurations'] + + +class MonitoringMetricConfigurationList(msrest.serialization.Model): + """Collection of metric configurations. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar value: The list of metric configurations. + :vartype value: + list[~azure.mgmt.databoxedge.v2020_09_01_preview.models.MonitoringMetricConfiguration] + :ivar next_link: Link to the next set of results. + :vartype next_link: str + """ + + _validation = { + 'value': {'readonly': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[MonitoringMetricConfiguration]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(MonitoringMetricConfigurationList, self).__init__(**kwargs) + self.value = None + self.next_link = None + + +class MountPointMap(msrest.serialization.Model): + """The share mount point. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :param share_id: Required. ID of the share mounted to the role VM. + :type share_id: str + :ivar role_id: ID of the role to which share is mounted. + :vartype role_id: str + :ivar mount_point: Mount point for the share. + :vartype mount_point: str + :ivar mount_type: Mounting type. Possible values include: "Volume", "HostPath". + :vartype mount_type: str or ~azure.mgmt.databoxedge.v2020_09_01_preview.models.MountType + :ivar role_type: Role type. Possible values include: "IOT", "ASA", "Functions", "Cognitive", + "MEC", "CloudEdgeManagement", "Kubernetes". + :vartype role_type: str or ~azure.mgmt.databoxedge.v2020_09_01_preview.models.RoleTypes + """ + + _validation = { + 'share_id': {'required': True}, + 'role_id': {'readonly': True}, + 'mount_point': {'readonly': True}, + 'mount_type': {'readonly': True}, + 'role_type': {'readonly': True}, + } + + _attribute_map = { + 'share_id': {'key': 'shareId', 'type': 'str'}, + 'role_id': {'key': 'roleId', 'type': 'str'}, + 'mount_point': {'key': 'mountPoint', 'type': 'str'}, + 'mount_type': {'key': 'mountType', 'type': 'str'}, + 'role_type': {'key': 'roleType', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(MountPointMap, self).__init__(**kwargs) + self.share_id = kwargs['share_id'] + self.role_id = None + self.mount_point = None + self.mount_type = None + self.role_type = None + + +class NetworkAdapter(msrest.serialization.Model): + """Represents the networkAdapter on a device. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar adapter_id: Instance ID of network adapter. + :vartype adapter_id: str + :ivar adapter_position: Hardware position of network adapter. + :vartype adapter_position: + ~azure.mgmt.databoxedge.v2020_09_01_preview.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 ~azure.mgmt.databoxedge.v2020_09_01_preview.models.NetworkAdapterStatus + :param rdma_status: Value indicating whether this adapter is RDMA capable. Possible values + include: "Incapable", "Capable". + :type rdma_status: str or + ~azure.mgmt.databoxedge.v2020_09_01_preview.models.NetworkAdapterRDMAStatus + :param dhcp_status: Value indicating whether this adapter has DHCP enabled. Possible values + include: "Disabled", "Enabled". + :type dhcp_status: str or + ~azure.mgmt.databoxedge.v2020_09_01_preview.models.NetworkAdapterDHCPStatus + :ivar ipv4_configuration: The IPv4 configuration of the network adapter. + :vartype ipv4_configuration: ~azure.mgmt.databoxedge.v2020_09_01_preview.models.Ipv4Config + :ivar ipv6_configuration: The IPv6 configuration of the network adapter. + :vartype ipv6_configuration: ~azure.mgmt.databoxedge.v2020_09_01_preview.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 ~azure.mgmt.databoxedge.v2020_09_01_preview.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[~azure.mgmt.databoxedge.v2020_09_01_preview.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 ~azure.mgmt.databoxedge.v2020_09_01_preview.models.NodeStatus + :ivar node_chassis_serial_number: Serial number of the Chassis. + :vartype node_chassis_serial_number: str + :ivar node_serial_number: Serial number of the individual node. + :vartype node_serial_number: str + :ivar node_display_name: Display Name of the individual node. + :vartype node_display_name: str + :ivar node_friendly_software_version: Friendly software version name that is currently + installed on the node. + :vartype node_friendly_software_version: str + :ivar node_hcs_version: HCS version that is currently installed on the node. + :vartype node_hcs_version: str + :ivar node_instance_id: Guid instance id of the node. + :vartype node_instance_id: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'node_status': {'readonly': True}, + 'node_chassis_serial_number': {'readonly': True}, + 'node_serial_number': {'readonly': True}, + 'node_display_name': {'readonly': True}, + 'node_friendly_software_version': {'readonly': True}, + 'node_hcs_version': {'readonly': True}, + 'node_instance_id': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'node_status': {'key': 'properties.nodeStatus', 'type': 'str'}, + 'node_chassis_serial_number': {'key': 'properties.nodeChassisSerialNumber', 'type': 'str'}, + 'node_serial_number': {'key': 'properties.nodeSerialNumber', 'type': 'str'}, + 'node_display_name': {'key': 'properties.nodeDisplayName', 'type': 'str'}, + 'node_friendly_software_version': {'key': 'properties.nodeFriendlySoftwareVersion', 'type': 'str'}, + 'node_hcs_version': {'key': 'properties.nodeHcsVersion', 'type': 'str'}, + 'node_instance_id': {'key': 'properties.nodeInstanceId', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(Node, self).__init__(**kwargs) + self.node_status = None + self.node_chassis_serial_number = None + self.node_serial_number = None + self.node_display_name = None + self.node_friendly_software_version = None + self.node_hcs_version = None + self.node_instance_id = None + + +class NodeInfo(msrest.serialization.Model): + """Kubernetes node info. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar name: Node name. + :vartype name: str + :ivar type: Node type - Master/Worker. Possible values include: "Invalid", "Master", "Worker". + :vartype type: str or ~azure.mgmt.databoxedge.v2020_09_01_preview.models.KubernetesNodeType + :param ip_configuration: IP Configuration of the Kubernetes node. + :type ip_configuration: + list[~azure.mgmt.databoxedge.v2020_09_01_preview.models.KubernetesIPConfiguration] + """ + + _validation = { + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'ip_configuration': {'key': 'ipConfiguration', 'type': '[KubernetesIPConfiguration]'}, + } + + def __init__( + self, + **kwargs + ): + super(NodeInfo, self).__init__(**kwargs) + self.name = None + self.type = None + self.ip_configuration = kwargs.get('ip_configuration', None) + + +class NodeList(msrest.serialization.Model): + """Collection of Nodes. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar value: The list of Nodes. + :vartype value: list[~azure.mgmt.databoxedge.v2020_09_01_preview.models.Node] + :param next_link: Link to the next set of results. + :type next_link: str + """ + + _validation = { + 'value': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[Node]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(NodeList, self).__init__(**kwargs) + self.value = None + self.next_link = kwargs.get('next_link', 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: ~azure.mgmt.databoxedge.v2020_09_01_preview.models.OperationDisplay + :param origin: Origin of the operation. + :type origin: str + :param is_data_action: Indicates whether the operation is a data action. + :type is_data_action: bool + :param service_specification: Service specification. + :type service_specification: + ~azure.mgmt.databoxedge.v2020_09_01_preview.models.ServiceSpecification + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'display': {'key': 'display', 'type': 'OperationDisplay'}, + 'origin': {'key': 'origin', 'type': 'str'}, + 'is_data_action': {'key': 'isDataAction', 'type': 'bool'}, + '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.is_data_action = kwargs.get('is_data_action', 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[~azure.mgmt.databoxedge.v2020_09_01_preview.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: ~azure.mgmt.databoxedge.v2020_09_01_preview.models.ContactDetails + :param shipping_address: The shipping address. + :type shipping_address: ~azure.mgmt.databoxedge.v2020_09_01_preview.models.Address + :ivar current_status: Current status of the order. + :vartype current_status: ~azure.mgmt.databoxedge.v2020_09_01_preview.models.OrderStatus + :ivar order_history: List of status changes in the order. + :vartype order_history: list[~azure.mgmt.databoxedge.v2020_09_01_preview.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[~azure.mgmt.databoxedge.v2020_09_01_preview.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[~azure.mgmt.databoxedge.v2020_09_01_preview.models.TrackingInfo] + :param shipment_type: ShipmentType of the order. Possible values include: "NotApplicable", + "ShippedToCustomer", "SelfPickup". + :type shipment_type: str or ~azure.mgmt.databoxedge.v2020_09_01_preview.models.ShipmentType + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'current_status': {'readonly': True}, + 'order_history': {'readonly': True}, + 'serial_number': {'readonly': True}, + 'delivery_tracking_info': {'readonly': True}, + 'return_tracking_info': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'contact_information': {'key': 'properties.contactInformation', 'type': 'ContactDetails'}, + 'shipping_address': {'key': 'properties.shippingAddress', 'type': 'Address'}, + 'current_status': {'key': 'properties.currentStatus', 'type': 'OrderStatus'}, + 'order_history': {'key': 'properties.orderHistory', 'type': '[OrderStatus]'}, + 'serial_number': {'key': 'properties.serialNumber', 'type': 'str'}, + 'delivery_tracking_info': {'key': 'properties.deliveryTrackingInfo', 'type': '[TrackingInfo]'}, + 'return_tracking_info': {'key': 'properties.returnTrackingInfo', 'type': '[TrackingInfo]'}, + 'shipment_type': {'key': 'properties.shipmentType', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(Order, self).__init__(**kwargs) + self.contact_information = kwargs.get('contact_information', None) + self.shipping_address = kwargs.get('shipping_address', None) + self.current_status = None + self.order_history = None + self.serial_number = None + self.delivery_tracking_info = None + self.return_tracking_info = None + self.shipment_type = kwargs.get('shipment_type', None) + + +class OrderList(msrest.serialization.Model): + """List of order entities. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar value: The list of orders. + :vartype value: list[~azure.mgmt.databoxedge.v2020_09_01_preview.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", + "AwaitingPickup", "PickupCompleted", "AwaitingDrop". + :type status: str or ~azure.mgmt.databoxedge.v2020_09_01_preview.models.OrderState + :ivar update_date_time: Time of status update. + :vartype update_date_time: ~datetime.datetime + :param comments: Comments related to this status change. + :type comments: str + :ivar tracking_information: Tracking information related to the state in the ordering flow. + :vartype tracking_information: ~azure.mgmt.databoxedge.v2020_09_01_preview.models.TrackingInfo + :ivar additional_order_details: Dictionary to hold generic information which is not stored + by the already existing properties. + :vartype additional_order_details: dict[str, str] + """ + + _validation = { + 'status': {'required': True}, + 'update_date_time': {'readonly': True}, + 'tracking_information': {'readonly': True}, + 'additional_order_details': {'readonly': True}, + } + + _attribute_map = { + 'status': {'key': 'status', 'type': 'str'}, + 'update_date_time': {'key': 'updateDateTime', 'type': 'iso-8601'}, + 'comments': {'key': 'comments', 'type': 'str'}, + 'tracking_information': {'key': 'trackingInformation', 'type': 'TrackingInfo'}, + 'additional_order_details': {'key': 'additionalOrderDetails', 'type': '{str}'}, + } + + def __init__( + self, + **kwargs + ): + super(OrderStatus, self).__init__(**kwargs) + self.status = kwargs['status'] + self.update_date_time = None + self.comments = kwargs.get('comments', None) + self.tracking_information = None + self.additional_order_details = None + + +class PeriodicTimerEventTrigger(Trigger): + """Trigger details. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: The path ID that uniquely identifies the object. + :vartype id: str + :ivar name: The object name. + :vartype name: str + :ivar type: The hierarchical type of the object. + :vartype type: str + :ivar system_data: Trigger in DataBoxEdge Resource. + :vartype system_data: ~azure.mgmt.databoxedge.v2020_09_01_preview.models.SystemData + :param kind: Required. Trigger Kind.Constant filled by server. Possible values include: + "FileEvent", "PeriodicTimerEvent". + :type kind: str or ~azure.mgmt.databoxedge.v2020_09_01_preview.models.TriggerEventType + :param source_info: Required. Periodic timer details. + :type source_info: ~azure.mgmt.databoxedge.v2020_09_01_preview.models.PeriodicTimerSourceInfo + :param sink_info: Required. Role Sink information. + :type sink_info: ~azure.mgmt.databoxedge.v2020_09_01_preview.models.RoleSinkInfo + :param custom_context_tag: A custom context tag typically used to correlate the trigger against + its usage. For example, if a periodic timer trigger is intended for certain specific IoT + modules in the device, the tag can be the name or the image URL of the module. + :type custom_context_tag: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'system_data': {'readonly': True}, + 'kind': {'required': True}, + 'source_info': {'required': True}, + 'sink_info': {'required': True}, + 'custom_context_tag': {'max_length': 192, 'min_length': 0}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'source_info': {'key': 'properties.sourceInfo', 'type': 'PeriodicTimerSourceInfo'}, + 'sink_info': {'key': 'properties.sinkInfo', 'type': 'RoleSinkInfo'}, + 'custom_context_tag': {'key': 'properties.customContextTag', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(PeriodicTimerEventTrigger, self).__init__(**kwargs) + self.kind = 'PeriodicTimerEvent' # type: str + self.source_info = kwargs['source_info'] + self.sink_info = kwargs['sink_info'] + self.custom_context_tag = kwargs.get('custom_context_tag', None) + + +class PeriodicTimerSourceInfo(msrest.serialization.Model): + """Periodic timer event source. + + All required parameters must be populated in order to send to Azure. + + :param start_time: Required. The time of the day that results in a valid trigger. Schedule is + computed with reference to the time specified upto seconds. If timezone is not specified the + time will considered to be in device timezone. The value will always be returned as UTC time. + :type start_time: ~datetime.datetime + :param schedule: Required. Periodic frequency at which timer event needs to be raised. Supports + daily, hourly, minutes, and seconds. + :type schedule: str + :param topic: Topic where periodic events are published to IoT device. + :type topic: str + """ + + _validation = { + 'start_time': {'required': True}, + 'schedule': {'required': True}, + } + + _attribute_map = { + 'start_time': {'key': 'startTime', 'type': 'iso-8601'}, + 'schedule': {'key': 'schedule', 'type': 'str'}, + 'topic': {'key': 'topic', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(PeriodicTimerSourceInfo, self).__init__(**kwargs) + self.start_time = kwargs['start_time'] + self.schedule = kwargs['schedule'] + self.topic = kwargs.get('topic', None) + + +class RefreshDetails(msrest.serialization.Model): + """Fields for tracking refresh job on the share or container. + + :param in_progress_refresh_job_id: If a refresh job is currently in progress on this share or + container, this field indicates the ARM resource ID of that job. The field is empty if no job + is in progress. + :type in_progress_refresh_job_id: str + :param last_completed_refresh_job_time_in_utc: Indicates the completed time for the last + refresh job on this particular share or container, if any.This could be a failed job or a + successful job. + :type last_completed_refresh_job_time_in_utc: ~datetime.datetime + :param error_manifest_file: Indicates the relative path of the error xml for the last refresh + job on this particular share or container, if any. This could be a failed job or a successful + job. + :type error_manifest_file: str + :param last_job: Indicates the id of the last refresh job on this particular share or + container,if any. This could be a failed job or a successful job. + :type last_job: str + """ + + _attribute_map = { + 'in_progress_refresh_job_id': {'key': 'inProgressRefreshJobId', 'type': 'str'}, + 'last_completed_refresh_job_time_in_utc': {'key': 'lastCompletedRefreshJobTimeInUTC', 'type': 'iso-8601'}, + 'error_manifest_file': {'key': 'errorManifestFile', 'type': 'str'}, + 'last_job': {'key': 'lastJob', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(RefreshDetails, self).__init__(**kwargs) + self.in_progress_refresh_job_id = kwargs.get('in_progress_refresh_job_id', None) + self.last_completed_refresh_job_time_in_utc = kwargs.get('last_completed_refresh_job_time_in_utc', None) + self.error_manifest_file = kwargs.get('error_manifest_file', None) + self.last_job = kwargs.get('last_job', None) + + +class ResourceIdentity(msrest.serialization.Model): + """Msi identity details of the resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param type: Identity type. Possible values include: "None", "SystemAssigned", "UserAssigned". + :type type: str or ~azure.mgmt.databoxedge.v2020_09_01_preview.models.MsiIdentityType + :ivar principal_id: Service Principal Id backing the Msi. + :vartype principal_id: str + :ivar tenant_id: Home Tenant Id. + :vartype tenant_id: str + """ + + _validation = { + 'principal_id': {'readonly': True}, + 'tenant_id': {'readonly': True}, + } + + _attribute_map = { + 'type': {'key': 'type', 'type': 'str'}, + 'principal_id': {'key': 'principalId', 'type': 'str'}, + 'tenant_id': {'key': 'tenantId', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ResourceIdentity, self).__init__(**kwargs) + self.type = kwargs.get('type', None) + self.principal_id = None + self.tenant_id = None + + +class ResourceMoveDetails(msrest.serialization.Model): + """Fields for tracking resource move. + + :param operation_in_progress: Denotes whether move operation is in progress. Possible values + include: "None", "ResourceMoveInProgress", "ResourceMoveFailed". + :type operation_in_progress: str or + ~azure.mgmt.databoxedge.v2020_09_01_preview.models.ResourceMoveStatus + :param operation_in_progress_lock_timeout_in_utc: Denotes the timeout of the operation to + finish. + :type operation_in_progress_lock_timeout_in_utc: ~datetime.datetime + """ + + _attribute_map = { + 'operation_in_progress': {'key': 'operationInProgress', 'type': 'str'}, + 'operation_in_progress_lock_timeout_in_utc': {'key': 'operationInProgressLockTimeoutInUTC', 'type': 'iso-8601'}, + } + + def __init__( + self, + **kwargs + ): + super(ResourceMoveDetails, self).__init__(**kwargs) + self.operation_in_progress = kwargs.get('operation_in_progress', None) + self.operation_in_progress_lock_timeout_in_utc = kwargs.get('operation_in_progress_lock_timeout_in_utc', None) + + +class ResourceTypeSku(msrest.serialization.Model): + """Resource type Sku object. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar resource_type: The resource type. + :vartype resource_type: str + :ivar skus: The skus. + :vartype skus: list[~azure.mgmt.databoxedge.v2020_09_01_preview.models.SkuInformation] + """ + + _validation = { + 'resource_type': {'readonly': True}, + 'skus': {'readonly': True}, + } + + _attribute_map = { + 'resource_type': {'key': 'resourceType', 'type': 'str'}, + 'skus': {'key': 'skus', 'type': '[SkuInformation]'}, + } + + def __init__( + self, + **kwargs + ): + super(ResourceTypeSku, self).__init__(**kwargs) + self.resource_type = None + self.skus = None + + +class RoleList(msrest.serialization.Model): + """Collection of all the roles on the Data Box Edge device. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar value: The Value. + :vartype value: list[~azure.mgmt.databoxedge.v2020_09_01_preview.models.Role] + :ivar next_link: Link to the next set of results. + :vartype next_link: str + """ + + _validation = { + 'value': {'readonly': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[Role]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(RoleList, self).__init__(**kwargs) + self.value = None + self.next_link = None + + +class RoleSinkInfo(msrest.serialization.Model): + """Compute role against which events will be raised. + + All required parameters must be populated in order to send to Azure. + + :param role_id: Required. Compute role ID. + :type role_id: str + """ + + _validation = { + 'role_id': {'required': True}, + } + + _attribute_map = { + 'role_id': {'key': 'roleId', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(RoleSinkInfo, self).__init__(**kwargs) + self.role_id = kwargs['role_id'] + + +class 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: + ~azure.mgmt.databoxedge.v2020_09_01_preview.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[~azure.mgmt.databoxedge.v2020_09_01_preview.models.MetricSpecificationV1] + """ + + _attribute_map = { + 'metric_specifications': {'key': 'metricSpecifications', 'type': '[MetricSpecificationV1]'}, + } + + def __init__( + self, + **kwargs + ): + super(ServiceSpecification, self).__init__(**kwargs) + self.metric_specifications = kwargs.get('metric_specifications', None) + + +class Share(ARMBaseModel): + """Represents a share on the Data Box Edge/Gateway device. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: The path ID that uniquely identifies the object. + :vartype id: str + :ivar name: The object name. + :vartype name: str + :ivar type: The hierarchical type of the object. + :vartype type: str + :ivar system_data: Share on ASE device. + :vartype system_data: ~azure.mgmt.databoxedge.v2020_09_01_preview.models.SystemData + :param description: Description for the share. + :type description: str + :param share_status: Required. Current status of the share. Possible values include: "Offline", + "Unknown", "OK", "Updating", "NeedsAttention". + :type share_status: str or ~azure.mgmt.databoxedge.v2020_09_01_preview.models.ShareStatus + :param monitoring_status: Required. Current monitoring status of the share. Possible values + include: "Enabled", "Disabled". + :type monitoring_status: str or + ~azure.mgmt.databoxedge.v2020_09_01_preview.models.MonitoringStatus + :param azure_container_info: Azure container mapping for the share. + :type azure_container_info: + ~azure.mgmt.databoxedge.v2020_09_01_preview.models.AzureContainerInfo + :param access_protocol: Required. Access protocol to be used by the share. Possible values + include: "SMB", "NFS". + :type access_protocol: str or + ~azure.mgmt.databoxedge.v2020_09_01_preview.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[~azure.mgmt.databoxedge.v2020_09_01_preview.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[~azure.mgmt.databoxedge.v2020_09_01_preview.models.ClientAccessRight] + :param refresh_details: Details of the refresh job on this share. + :type refresh_details: ~azure.mgmt.databoxedge.v2020_09_01_preview.models.RefreshDetails + :ivar share_mappings: Share mount point to the role. + :vartype share_mappings: list[~azure.mgmt.databoxedge.v2020_09_01_preview.models.MountPointMap] + :param data_policy: Data policy of the share. Possible values include: "Cloud", "Local". + :type data_policy: str or ~azure.mgmt.databoxedge.v2020_09_01_preview.models.DataPolicy + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'system_data': {'readonly': True}, + 'share_status': {'required': True}, + 'monitoring_status': {'required': True}, + 'access_protocol': {'required': True}, + 'share_mappings': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + 'share_status': {'key': 'properties.shareStatus', 'type': 'str'}, + 'monitoring_status': {'key': 'properties.monitoringStatus', 'type': 'str'}, + 'azure_container_info': {'key': 'properties.azureContainerInfo', 'type': 'AzureContainerInfo'}, + 'access_protocol': {'key': 'properties.accessProtocol', 'type': 'str'}, + 'user_access_rights': {'key': 'properties.userAccessRights', 'type': '[UserAccessRight]'}, + 'client_access_rights': {'key': 'properties.clientAccessRights', 'type': '[ClientAccessRight]'}, + 'refresh_details': {'key': 'properties.refreshDetails', 'type': 'RefreshDetails'}, + 'share_mappings': {'key': 'properties.shareMappings', 'type': '[MountPointMap]'}, + 'data_policy': {'key': 'properties.dataPolicy', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(Share, self).__init__(**kwargs) + self.system_data = None + self.description = kwargs.get('description', None) + self.share_status = kwargs['share_status'] + self.monitoring_status = kwargs['monitoring_status'] + self.azure_container_info = kwargs.get('azure_container_info', None) + self.access_protocol = kwargs['access_protocol'] + self.user_access_rights = kwargs.get('user_access_rights', None) + self.client_access_rights = kwargs.get('client_access_rights', None) + self.refresh_details = kwargs.get('refresh_details', None) + self.share_mappings = None + self.data_policy = kwargs.get('data_policy', None) + + +class ShareAccessRight(msrest.serialization.Model): + """Specifies the mapping between this particular user and the type of access he has on shares on this device. + + All required parameters must be populated in order to send to Azure. + + :param share_id: Required. The share ID. + :type share_id: str + :param access_type: Required. Type of access to be allowed on the share for this user. Possible + values include: "Change", "Read", "Custom". + :type access_type: str or ~azure.mgmt.databoxedge.v2020_09_01_preview.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[~azure.mgmt.databoxedge.v2020_09_01_preview.models.Share] + :ivar next_link: Link to the next set of results. + :vartype next_link: str + """ + + _validation = { + 'value': {'readonly': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[Share]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ShareList, self).__init__(**kwargs) + self.value = None + self.next_link = None + + +class Sku(msrest.serialization.Model): + """The SKU type. + + :param name: SKU name. Possible values include: "Gateway", "Edge", "TEA_1Node", + "TEA_1Node_UPS", "TEA_1Node_Heater", "TEA_1Node_UPS_Heater", "TEA_4Node_Heater", + "TEA_4Node_UPS_Heater", "TMA", "TDC", "TCA_Small", "GPU", "TCA_Large", "EdgeP_Base", + "EdgeP_High", "EdgePR_Base", "EdgePR_Base_UPS", "EdgeMR_Mini", "RCA_Small", "RCA_Large", "RDC". + :type name: str or ~azure.mgmt.databoxedge.v2020_09_01_preview.models.SkuName + :param tier: The SKU tier. This is based on the SKU name. Possible values include: "Standard". + :type tier: str or ~azure.mgmt.databoxedge.v2020_09_01_preview.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: The extended unit. + :vartype extended_unit: str + """ + + _validation = { + 'meter_id': {'readonly': True}, + 'quantity': {'readonly': True}, + 'extended_unit': {'readonly': True}, + } + + _attribute_map = { + 'meter_id': {'key': 'meterId', 'type': 'str'}, + 'quantity': {'key': 'quantity', 'type': 'long'}, + 'extended_unit': {'key': 'extendedUnit', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(SkuCost, self).__init__(**kwargs) + self.meter_id = None + self.quantity = None + self.extended_unit = None + + +class SkuInformation(msrest.serialization.Model): + """Sku information. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar name: The sku name. + :vartype name: str + :ivar tier: The sku tier. + :vartype tier: str + :ivar kind: The sku kind. + :vartype kind: str + :ivar family: The Sku family. + :vartype family: str + :ivar costs: The pricing info of the Sku. + :vartype costs: list[~azure.mgmt.databoxedge.v2020_09_01_preview.models.SkuCost] + :ivar locations: The locations where Sku is available. + :vartype locations: list[str] + :ivar location_info: The locations where Sku is available with zones and sites info. + :vartype location_info: + list[~azure.mgmt.databoxedge.v2020_09_01_preview.models.SkuLocationInfo] + :ivar required_quota_ids: The required quotaIds for the sku to be available. + :vartype required_quota_ids: list[str] + :ivar required_features: The required features for the sku to be available. + :vartype required_features: list[str] + """ + + _validation = { + 'name': {'readonly': True}, + 'tier': {'readonly': True}, + 'kind': {'readonly': True}, + 'family': {'readonly': True}, + 'costs': {'readonly': True}, + 'locations': {'readonly': True}, + 'location_info': {'readonly': True}, + 'required_quota_ids': {'readonly': True}, + 'required_features': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'tier': {'key': 'tier', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'family': {'key': 'family', 'type': 'str'}, + 'costs': {'key': 'costs', 'type': '[SkuCost]'}, + 'locations': {'key': 'locations', 'type': '[str]'}, + 'location_info': {'key': 'locationInfo', 'type': '[SkuLocationInfo]'}, + 'required_quota_ids': {'key': 'requiredQuotaIds', 'type': '[str]'}, + 'required_features': {'key': 'requiredFeatures', 'type': '[str]'}, + } + + def __init__( + self, + **kwargs + ): + super(SkuInformation, self).__init__(**kwargs) + self.name = None + self.tier = None + self.kind = None + self.family = None + self.costs = None + self.locations = None + self.location_info = None + self.required_quota_ids = None + self.required_features = None + + +class SkuInformationList(msrest.serialization.Model): + """List of SKU Information objects. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar value: List of ResourceTypeSku objects. + :vartype value: list[~azure.mgmt.databoxedge.v2020_09_01_preview.models.ResourceTypeSku] + :ivar next_link: Links to the next set of results. + :vartype next_link: str + """ + + _validation = { + 'value': {'readonly': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[ResourceTypeSku]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(SkuInformationList, self).__init__(**kwargs) + self.value = None + self.next_link = None + + +class SkuLocationInfo(msrest.serialization.Model): + """The location info. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar location: The location. + :vartype location: str + :ivar zones: The zones. + :vartype zones: list[str] + :ivar sites: The sites. + :vartype sites: list[str] + """ + + _validation = { + 'location': {'readonly': True}, + 'zones': {'readonly': True}, + 'sites': {'readonly': True}, + } + + _attribute_map = { + 'location': {'key': 'location', 'type': 'str'}, + 'zones': {'key': 'zones', 'type': '[str]'}, + 'sites': {'key': 'sites', 'type': '[str]'}, + } + + def __init__( + self, + **kwargs + ): + super(SkuLocationInfo, self).__init__(**kwargs) + self.location = None + self.zones = None + self.sites = None + + +class StorageAccount(ARMBaseModel): + """Represents a Storage Account on the Data Box Edge/Gateway device. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: The path ID that uniquely identifies the object. + :vartype id: str + :ivar name: The object name. + :vartype name: str + :ivar type: The hierarchical type of the object. + :vartype type: str + :ivar system_data: StorageAccount object on ASE device. + :vartype system_data: ~azure.mgmt.databoxedge.v2020_09_01_preview.models.SystemData + :param description: Description for the storage Account. + :type description: str + :param storage_account_status: Current status of the storage account. Possible values include: + "OK", "Offline", "Unknown", "Updating", "NeedsAttention". + :type storage_account_status: str or + ~azure.mgmt.databoxedge.v2020_09_01_preview.models.StorageAccountStatus + :param data_policy: Required. Data policy of the storage Account. Possible values include: + "Cloud", "Local". + :type data_policy: str or ~azure.mgmt.databoxedge.v2020_09_01_preview.models.DataPolicy + :param storage_account_credential_id: Storage Account Credential Id. + :type storage_account_credential_id: str + :ivar blob_endpoint: BlobEndpoint of Storage Account. + :vartype blob_endpoint: str + :ivar container_count: The Container Count. Present only for Storage Accounts with DataPolicy + set to Cloud. + :vartype container_count: int + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'system_data': {'readonly': True}, + 'data_policy': {'required': True}, + 'blob_endpoint': {'readonly': True}, + 'container_count': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + 'storage_account_status': {'key': 'properties.storageAccountStatus', 'type': 'str'}, + 'data_policy': {'key': 'properties.dataPolicy', 'type': 'str'}, + 'storage_account_credential_id': {'key': 'properties.storageAccountCredentialId', 'type': 'str'}, + 'blob_endpoint': {'key': 'properties.blobEndpoint', 'type': 'str'}, + 'container_count': {'key': 'properties.containerCount', 'type': 'int'}, + } + + def __init__( + self, + **kwargs + ): + super(StorageAccount, self).__init__(**kwargs) + self.system_data = None + self.description = kwargs.get('description', None) + self.storage_account_status = kwargs.get('storage_account_status', None) + self.data_policy = kwargs['data_policy'] + self.storage_account_credential_id = kwargs.get('storage_account_credential_id', None) + self.blob_endpoint = None + self.container_count = None + + +class StorageAccountCredential(ARMBaseModel): + """The storage account credential. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: The path ID that uniquely identifies the object. + :vartype id: str + :ivar name: The object name. + :vartype name: str + :ivar type: The hierarchical type of the object. + :vartype type: str + :ivar system_data: StorageAccountCredential object. + :vartype system_data: ~azure.mgmt.databoxedge.v2020_09_01_preview.models.SystemData + :param alias: Required. Alias for the storage account. + :type alias: str + :param user_name: Username for the storage account. + :type user_name: str + :param account_key: Encrypted storage key. + :type account_key: ~azure.mgmt.databoxedge.v2020_09_01_preview.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 ~azure.mgmt.databoxedge.v2020_09_01_preview.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 ~azure.mgmt.databoxedge.v2020_09_01_preview.models.AccountType + :param storage_account_id: Id of the storage account. + :type storage_account_id: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'system_data': {'readonly': True}, + 'alias': {'required': True}, + 'ssl_status': {'required': True}, + 'account_type': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'alias': {'key': 'properties.alias', 'type': 'str'}, + 'user_name': {'key': 'properties.userName', 'type': 'str'}, + 'account_key': {'key': 'properties.accountKey', 'type': 'AsymmetricEncryptedSecret'}, + 'connection_string': {'key': 'properties.connectionString', 'type': 'str'}, + 'ssl_status': {'key': 'properties.sslStatus', 'type': 'str'}, + 'blob_domain_name': {'key': 'properties.blobDomainName', 'type': 'str'}, + 'account_type': {'key': 'properties.accountType', 'type': 'str'}, + 'storage_account_id': {'key': 'properties.storageAccountId', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(StorageAccountCredential, self).__init__(**kwargs) + self.system_data = None + self.alias = kwargs['alias'] + self.user_name = kwargs.get('user_name', None) + self.account_key = kwargs.get('account_key', None) + self.connection_string = kwargs.get('connection_string', None) + self.ssl_status = kwargs['ssl_status'] + self.blob_domain_name = kwargs.get('blob_domain_name', None) + self.account_type = kwargs['account_type'] + self.storage_account_id = kwargs.get('storage_account_id', None) + + +class StorageAccountCredentialList(msrest.serialization.Model): + """The collection of storage account credentials. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar value: The value. + :vartype value: + list[~azure.mgmt.databoxedge.v2020_09_01_preview.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[~azure.mgmt.databoxedge.v2020_09_01_preview.models.StorageAccount] + :ivar next_link: Link to the next set of results. + :vartype next_link: str + """ + + _validation = { + 'value': {'readonly': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[StorageAccount]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(StorageAccountList, self).__init__(**kwargs) + self.value = None + self.next_link = None + + +class SubscriptionRegisteredFeatures(msrest.serialization.Model): + """SubscriptionRegisteredFeatures. + + :param name: + :type name: str + :param state: + :type state: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'state': {'key': 'state', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(SubscriptionRegisteredFeatures, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.state = kwargs.get('state', None) + + +class SymmetricKey(msrest.serialization.Model): + """Symmetric key for authentication. + + :param connection_string: Connection string based on the symmetric key. + :type connection_string: + ~azure.mgmt.databoxedge.v2020_09_01_preview.models.AsymmetricEncryptedSecret + """ + + _attribute_map = { + 'connection_string': {'key': 'connectionString', 'type': 'AsymmetricEncryptedSecret'}, + } + + def __init__( + self, + **kwargs + ): + super(SymmetricKey, self).__init__(**kwargs) + self.connection_string = kwargs.get('connection_string', None) + + +class SystemData(msrest.serialization.Model): + """Metadata pertaining to creation and last modification of the resource. + + :param created_by: The identity that created the resource. + :type created_by: str + :param created_by_type: The type of identity that created the resource. Possible values + include: "User", "Application", "ManagedIdentity", "Key". + :type created_by_type: str or ~azure.mgmt.databoxedge.v2020_09_01_preview.models.CreatedByType + :param created_at: The timestamp of resource creation (UTC). + :type created_at: ~datetime.datetime + :param last_modified_by: The identity that last modified the resource. + :type last_modified_by: str + :param last_modified_by_type: The type of identity that last modified the resource. Possible + values include: "User", "Application", "ManagedIdentity", "Key". + :type last_modified_by_type: str or + ~azure.mgmt.databoxedge.v2020_09_01_preview.models.CreatedByType + :param last_modified_at: The type of identity that last modified the resource. + :type last_modified_at: ~datetime.datetime + """ + + _attribute_map = { + 'created_by': {'key': 'createdBy', 'type': 'str'}, + 'created_by_type': {'key': 'createdByType', 'type': 'str'}, + 'created_at': {'key': 'createdAt', 'type': 'iso-8601'}, + 'last_modified_by': {'key': 'lastModifiedBy', 'type': 'str'}, + 'last_modified_by_type': {'key': 'lastModifiedByType', 'type': 'str'}, + 'last_modified_at': {'key': 'lastModifiedAt', 'type': 'iso-8601'}, + } + + def __init__( + self, + **kwargs + ): + super(SystemData, self).__init__(**kwargs) + self.created_by = kwargs.get('created_by', None) + self.created_by_type = kwargs.get('created_by_type', None) + self.created_at = kwargs.get('created_at', None) + self.last_modified_by = kwargs.get('last_modified_by', None) + self.last_modified_by_type = kwargs.get('last_modified_by_type', None) + self.last_modified_at = kwargs.get('last_modified_at', None) + + +class TrackingInfo(msrest.serialization.Model): + """Tracking courier information. + + :param serial_number: Serial number of the device being tracked. + :type serial_number: str + :param carrier_name: Name of the carrier used in the delivery. + :type carrier_name: str + :param tracking_id: Tracking ID of the shipment. + :type tracking_id: str + :param tracking_url: Tracking URL of the shipment. + :type tracking_url: str + """ + + _attribute_map = { + 'serial_number': {'key': 'serialNumber', 'type': 'str'}, + 'carrier_name': {'key': 'carrierName', 'type': 'str'}, + 'tracking_id': {'key': 'trackingId', 'type': 'str'}, + 'tracking_url': {'key': 'trackingUrl', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(TrackingInfo, self).__init__(**kwargs) + self.serial_number = kwargs.get('serial_number', None) + self.carrier_name = kwargs.get('carrier_name', None) + self.tracking_id = kwargs.get('tracking_id', None) + self.tracking_url = kwargs.get('tracking_url', None) + + +class TriggerList(msrest.serialization.Model): + """Collection of all trigger on the data box edge device. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar value: The list of triggers. + :vartype value: list[~azure.mgmt.databoxedge.v2020_09_01_preview.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 + ~azure.mgmt.databoxedge.v2020_09_01_preview.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 + ~azure.mgmt.databoxedge.v2020_09_01_preview.models.InstallRebootBehavior + :ivar ongoing_update_operation: The current update operation. Possible values include: "None", + "Scan", "Download", "Install". + :vartype ongoing_update_operation: str or + ~azure.mgmt.databoxedge.v2020_09_01_preview.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 + ~azure.mgmt.databoxedge.v2020_09_01_preview.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 ~azure.mgmt.databoxedge.v2020_09_01_preview.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. + + :ivar id: The path ID that uniquely identifies the object. + :vartype id: str + :ivar name: The object name. + :vartype name: str + :ivar type: The hierarchical type of the object. + :vartype type: str + :ivar system_data: User in DataBoxEdge Resource. + :vartype system_data: ~azure.mgmt.databoxedge.v2020_09_01_preview.models.SystemData + :param encrypted_password: The password details. + :type encrypted_password: + ~azure.mgmt.databoxedge.v2020_09_01_preview.models.AsymmetricEncryptedSecret + :ivar share_access_rights: List of shares that the user has rights on. This field should not be + specified during user creation. + :vartype share_access_rights: + list[~azure.mgmt.databoxedge.v2020_09_01_preview.models.ShareAccessRight] + :param user_type: Type of the user. Possible values include: "Share", "LocalManagement", "ARM". + :type user_type: str or ~azure.mgmt.databoxedge.v2020_09_01_preview.models.UserType + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'system_data': {'readonly': True}, + 'share_access_rights': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'encrypted_password': {'key': 'properties.encryptedPassword', 'type': 'AsymmetricEncryptedSecret'}, + 'share_access_rights': {'key': 'properties.shareAccessRights', 'type': '[ShareAccessRight]'}, + 'user_type': {'key': 'properties.userType', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(User, self).__init__(**kwargs) + self.system_data = None + self.encrypted_password = kwargs.get('encrypted_password', None) + self.share_access_rights = None + self.user_type = kwargs.get('user_type', None) + + +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 ~azure.mgmt.databoxedge.v2020_09_01_preview.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[~azure.mgmt.databoxedge.v2020_09_01_preview.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/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_09_01_preview/models/_models_py3.py b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_09_01_preview/models/_models_py3.py new file mode 100644 index 000000000000..3ee92825fd2d --- /dev/null +++ b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_09_01_preview/models/_models_py3.py @@ -0,0 +1,5339 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +import datetime +from typing import Dict, List, Optional, Union + +import msrest.serialization + +from ._data_box_edge_management_client_enums import * + + +class ARMBaseModel(msrest.serialization.Model): + """Represents the base class for all object models. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: The path ID that uniquely identifies the object. + :vartype id: str + :ivar name: The object name. + :vartype name: str + :ivar type: The hierarchical type of the object. + :vartype type: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ARMBaseModel, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None + + +class Addon(ARMBaseModel): + """Role Addon. + + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: ArcAddon, IoTAddon. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: The path ID that uniquely identifies the object. + :vartype id: str + :ivar name: The object name. + :vartype name: str + :ivar type: The hierarchical type of the object. + :vartype type: str + :param kind: Required. Addon type.Constant filled by server. Possible values include: + "IotEdge", "ArcForKubernetes". + :type kind: str or ~azure.mgmt.databoxedge.v2020_09_01_preview.models.AddonType + :ivar system_data: Addon type. + :vartype system_data: ~azure.mgmt.databoxedge.v2020_09_01_preview.models.SystemData + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'kind': {'required': True}, + 'system_data': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + } + + _subtype_map = { + 'kind': {'ArcForKubernetes': 'ArcAddon', 'IotEdge': 'IoTAddon'} + } + + def __init__( + self, + **kwargs + ): + super(Addon, self).__init__(**kwargs) + self.kind = 'Addon' # type: str + self.system_data = None + + +class AddonList(msrest.serialization.Model): + """Collection of all the Role addon on the Azure Stack Edge device. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar value: The Value. + :vartype value: list[~azure.mgmt.databoxedge.v2020_09_01_preview.models.Addon] + :ivar next_link: Link to the next set of results. + :vartype next_link: str + """ + + _validation = { + 'value': {'readonly': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[Addon]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(AddonList, self).__init__(**kwargs) + self.value = None + self.next_link = None + + +class Address(msrest.serialization.Model): + """The shipping address of the customer. + + All required parameters must be populated in order to send to Azure. + + :param address_line1: The address line1. + :type address_line1: str + :param address_line2: The address line2. + :type address_line2: str + :param address_line3: The address line3. + :type address_line3: str + :param postal_code: The postal code. + :type postal_code: str + :param city: The city name. + :type city: str + :param state: The state name. + :type state: str + :param country: Required. The country name. + :type country: str + """ + + _validation = { + 'country': {'required': True}, + } + + _attribute_map = { + 'address_line1': {'key': 'addressLine1', 'type': 'str'}, + 'address_line2': {'key': 'addressLine2', 'type': 'str'}, + 'address_line3': {'key': 'addressLine3', 'type': 'str'}, + 'postal_code': {'key': 'postalCode', 'type': 'str'}, + 'city': {'key': 'city', 'type': 'str'}, + 'state': {'key': 'state', 'type': 'str'}, + 'country': {'key': 'country', 'type': 'str'}, + } + + def __init__( + self, + *, + country: str, + address_line1: Optional[str] = None, + address_line2: Optional[str] = None, + address_line3: Optional[str] = None, + postal_code: Optional[str] = None, + city: Optional[str] = None, + state: Optional[str] = None, + **kwargs + ): + super(Address, self).__init__(**kwargs) + self.address_line1 = address_line1 + self.address_line2 = address_line2 + self.address_line3 = address_line3 + self.postal_code = postal_code + self.city = city + self.state = state + self.country = country + + +class Alert(ARMBaseModel): + """Alert on the data box edge/gateway device. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: The path ID that uniquely identifies the object. + :vartype id: str + :ivar name: The object name. + :vartype name: str + :ivar type: The hierarchical type of the object. + :vartype type: str + :ivar system_data: Alert generated in the resource. + :vartype system_data: ~azure.mgmt.databoxedge.v2020_09_01_preview.models.SystemData + :ivar title: Alert title. + :vartype title: str + :ivar alert_type: Alert type. + :vartype alert_type: str + :ivar appeared_at_date_time: UTC time when the alert appeared. + :vartype appeared_at_date_time: ~datetime.datetime + :ivar recommendation: Alert recommendation. + :vartype recommendation: str + :ivar severity: Severity of the alert. Possible values include: "Informational", "Warning", + "Critical". + :vartype severity: str or ~azure.mgmt.databoxedge.v2020_09_01_preview.models.AlertSeverity + :ivar error_details: Error details of the alert. + :vartype error_details: ~azure.mgmt.databoxedge.v2020_09_01_preview.models.AlertErrorDetails + :ivar detailed_information: Alert details. + :vartype detailed_information: dict[str, str] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'system_data': {'readonly': True}, + 'title': {'readonly': True}, + 'alert_type': {'readonly': True}, + 'appeared_at_date_time': {'readonly': True}, + 'recommendation': {'readonly': True}, + 'severity': {'readonly': True}, + 'error_details': {'readonly': True}, + 'detailed_information': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'title': {'key': 'properties.title', 'type': 'str'}, + 'alert_type': {'key': 'properties.alertType', 'type': 'str'}, + 'appeared_at_date_time': {'key': 'properties.appearedAtDateTime', 'type': 'iso-8601'}, + 'recommendation': {'key': 'properties.recommendation', 'type': 'str'}, + 'severity': {'key': 'properties.severity', 'type': 'str'}, + 'error_details': {'key': 'properties.errorDetails', 'type': 'AlertErrorDetails'}, + 'detailed_information': {'key': 'properties.detailedInformation', 'type': '{str}'}, + } + + def __init__( + self, + **kwargs + ): + super(Alert, self).__init__(**kwargs) + self.system_data = None + self.title = None + self.alert_type = None + self.appeared_at_date_time = None + self.recommendation = None + self.severity = None + self.error_details = None + self.detailed_information = None + + +class AlertErrorDetails(msrest.serialization.Model): + """Error details for the alert. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar error_code: Error code. + :vartype error_code: str + :ivar error_message: Error Message. + :vartype error_message: str + :ivar occurrences: Number of occurrences. + :vartype occurrences: int + """ + + _validation = { + 'error_code': {'readonly': True}, + 'error_message': {'readonly': True}, + 'occurrences': {'readonly': True}, + } + + _attribute_map = { + 'error_code': {'key': 'errorCode', 'type': 'str'}, + 'error_message': {'key': 'errorMessage', 'type': 'str'}, + 'occurrences': {'key': 'occurrences', 'type': 'int'}, + } + + def __init__( + self, + **kwargs + ): + super(AlertErrorDetails, self).__init__(**kwargs) + self.error_code = None + self.error_message = None + self.occurrences = None + + +class AlertList(msrest.serialization.Model): + """Collection of alerts. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar value: The value. + :vartype value: list[~azure.mgmt.databoxedge.v2020_09_01_preview.models.Alert] + :ivar next_link: Link to the next set of results. + :vartype next_link: str + """ + + _validation = { + 'value': {'readonly': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[Alert]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(AlertList, self).__init__(**kwargs) + self.value = None + self.next_link = None + + +class ArcAddon(Addon): + """Arc Addon. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: The path ID that uniquely identifies the object. + :vartype id: str + :ivar name: The object name. + :vartype name: str + :ivar type: The hierarchical type of the object. + :vartype type: str + :param kind: Required. Addon type.Constant filled by server. Possible values include: + "IotEdge", "ArcForKubernetes". + :type kind: str or ~azure.mgmt.databoxedge.v2020_09_01_preview.models.AddonType + :ivar system_data: Addon type. + :vartype system_data: ~azure.mgmt.databoxedge.v2020_09_01_preview.models.SystemData + :param subscription_id: Required. Arc resource subscription Id. + :type subscription_id: str + :param resource_group_name: Required. Arc resource group name. + :type resource_group_name: str + :param resource_name: Required. Arc resource Name. + :type resource_name: str + :param resource_location: Required. Arc resource location. + :type resource_location: str + :ivar version: Arc resource version. + :vartype version: str + :ivar host_platform: Host OS supported by the Arc addon. Possible values include: "Windows", + "Linux". + :vartype host_platform: str or ~azure.mgmt.databoxedge.v2020_09_01_preview.models.PlatformType + :ivar host_platform_type: Platform where the runtime is hosted. Possible values include: + "KubernetesCluster", "LinuxVM". + :vartype host_platform_type: str or + ~azure.mgmt.databoxedge.v2020_09_01_preview.models.HostPlatformType + :ivar provisioning_state: Addon Provisioning State. Possible values include: "Invalid", + "Creating", "Created", "Updating", "Reconfiguring", "Failed", "Deleting". + :vartype provisioning_state: str or + ~azure.mgmt.databoxedge.v2020_09_01_preview.models.AddonState + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'kind': {'required': True}, + 'system_data': {'readonly': True}, + 'subscription_id': {'required': True}, + 'resource_group_name': {'required': True}, + 'resource_name': {'required': True}, + 'resource_location': {'required': True}, + 'version': {'readonly': True}, + 'host_platform': {'readonly': True}, + 'host_platform_type': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'subscription_id': {'key': 'properties.subscriptionId', 'type': 'str'}, + 'resource_group_name': {'key': 'properties.resourceGroupName', 'type': 'str'}, + 'resource_name': {'key': 'properties.resourceName', 'type': 'str'}, + 'resource_location': {'key': 'properties.resourceLocation', 'type': 'str'}, + 'version': {'key': 'properties.version', 'type': 'str'}, + 'host_platform': {'key': 'properties.hostPlatform', 'type': 'str'}, + 'host_platform_type': {'key': 'properties.hostPlatformType', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + } + + def __init__( + self, + *, + subscription_id: str, + resource_group_name: str, + resource_name: str, + resource_location: str, + **kwargs + ): + super(ArcAddon, self).__init__(**kwargs) + self.kind = 'ArcForKubernetes' # type: str + self.subscription_id = subscription_id + self.resource_group_name = resource_group_name + self.resource_name = resource_name + self.resource_location = resource_location + self.version = None + self.host_platform = None + self.host_platform_type = None + self.provisioning_state = None + + +class AsymmetricEncryptedSecret(msrest.serialization.Model): + """Represent the secrets intended for encryption with asymmetric key pair. + + All required parameters must be populated in order to send to Azure. + + :param value: Required. The value of the secret. + :type value: str + :param encryption_cert_thumbprint: Thumbprint certificate used to encrypt \"Value\". If the + value is unencrypted, it will be null. + :type encryption_cert_thumbprint: str + :param encryption_algorithm: Required. The algorithm used to encrypt "Value". Possible values + include: "None", "AES256", "RSAES_PKCS1_v_1_5". + :type encryption_algorithm: str or + ~azure.mgmt.databoxedge.v2020_09_01_preview.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: ~azure.mgmt.databoxedge.v2020_09_01_preview.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 + ~azure.mgmt.databoxedge.v2020_09_01_preview.models.AzureContainerDataFormat + """ + + _validation = { + 'storage_account_credential_id': {'required': True}, + 'container_name': {'required': True}, + 'data_format': {'required': True}, + } + + _attribute_map = { + 'storage_account_credential_id': {'key': 'storageAccountCredentialId', 'type': 'str'}, + 'container_name': {'key': 'containerName', 'type': 'str'}, + 'data_format': {'key': 'dataFormat', 'type': 'str'}, + } + + def __init__( + self, + *, + storage_account_credential_id: str, + container_name: str, + data_format: Union[str, "AzureContainerDataFormat"], + **kwargs + ): + super(AzureContainerInfo, self).__init__(**kwargs) + self.storage_account_credential_id = storage_account_credential_id + self.container_name = container_name + self.data_format = data_format + + +class BandwidthSchedule(ARMBaseModel): + """The bandwidth schedule details. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: The path ID that uniquely identifies the object. + :vartype id: str + :ivar name: The object name. + :vartype name: str + :ivar type: The hierarchical type of the object. + :vartype type: str + :ivar system_data: Bandwidth object related to ASE resource. + :vartype system_data: ~azure.mgmt.databoxedge.v2020_09_01_preview.models.SystemData + :param start: Required. The start time of the schedule in UTC. + :type start: str + :param stop: Required. The stop time of the schedule in UTC. + :type stop: str + :param rate_in_mbps: Required. The bandwidth rate in Mbps. + :type rate_in_mbps: int + :param days: Required. The days of the week when this schedule is applicable. + :type days: list[str or ~azure.mgmt.databoxedge.v2020_09_01_preview.models.DayOfWeek] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'system_data': {'readonly': True}, + 'start': {'required': True}, + 'stop': {'required': True}, + 'rate_in_mbps': {'required': True}, + 'days': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'start': {'key': 'properties.start', 'type': 'str'}, + 'stop': {'key': 'properties.stop', 'type': 'str'}, + 'rate_in_mbps': {'key': 'properties.rateInMbps', 'type': 'int'}, + 'days': {'key': 'properties.days', 'type': '[str]'}, + } + + def __init__( + self, + *, + start: str, + stop: str, + rate_in_mbps: int, + days: List[Union[str, "DayOfWeek"]], + **kwargs + ): + super(BandwidthSchedule, self).__init__(**kwargs) + self.system_data = None + self.start = start + self.stop = stop + self.rate_in_mbps = rate_in_mbps + self.days = days + + +class BandwidthSchedulesList(msrest.serialization.Model): + """The collection of bandwidth schedules. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar value: The list of bandwidth schedules. + :vartype value: list[~azure.mgmt.databoxedge.v2020_09_01_preview.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 + ~azure.mgmt.databoxedge.v2020_09_01_preview.models.ClientPermissionType + """ + + _validation = { + 'client': {'required': True}, + 'access_permission': {'required': True}, + } + + _attribute_map = { + 'client': {'key': 'client', 'type': 'str'}, + 'access_permission': {'key': 'accessPermission', 'type': 'str'}, + } + + def __init__( + self, + *, + client: str, + access_permission: Union[str, "ClientPermissionType"], + **kwargs + ): + super(ClientAccessRight, self).__init__(**kwargs) + self.client = client + self.access_permission = access_permission + + +class Role(ARMBaseModel): + """Compute role. + + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: CloudEdgeManagementRole, IoTRole, KubernetesRole, MECRole. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: The path ID that uniquely identifies the object. + :vartype id: str + :ivar name: The object name. + :vartype name: str + :ivar type: The hierarchical type of the object. + :vartype type: str + :param kind: Required. Role type.Constant filled by server. Possible values include: "IOT", + "ASA", "Functions", "Cognitive", "MEC", "CloudEdgeManagement", "Kubernetes". + :type kind: str or ~azure.mgmt.databoxedge.v2020_09_01_preview.models.RoleTypes + :ivar system_data: Role configured on ASE resource. + :vartype system_data: ~azure.mgmt.databoxedge.v2020_09_01_preview.models.SystemData + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'kind': {'required': True}, + 'system_data': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + } + + _subtype_map = { + 'kind': {'CloudEdgeManagement': 'CloudEdgeManagementRole', 'IOT': 'IoTRole', 'Kubernetes': 'KubernetesRole', 'MEC': 'MECRole'} + } + + def __init__( + self, + **kwargs + ): + super(Role, self).__init__(**kwargs) + self.kind = 'Role' # type: str + self.system_data = None + + +class CloudEdgeManagementRole(Role): + """CloudEdgeManagementRole role. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: The path ID that uniquely identifies the object. + :vartype id: str + :ivar name: The object name. + :vartype name: str + :ivar type: The hierarchical type of the object. + :vartype type: str + :param kind: Required. Role type.Constant filled by server. Possible values include: "IOT", + "ASA", "Functions", "Cognitive", "MEC", "CloudEdgeManagement", "Kubernetes". + :type kind: str or ~azure.mgmt.databoxedge.v2020_09_01_preview.models.RoleTypes + :ivar system_data: Role configured on ASE resource. + :vartype system_data: ~azure.mgmt.databoxedge.v2020_09_01_preview.models.SystemData + :ivar local_management_status: Local Edge Management Status. Possible values include: + "Enabled", "Disabled". + :vartype local_management_status: str or + ~azure.mgmt.databoxedge.v2020_09_01_preview.models.RoleStatus + :ivar edge_profile: Edge Profile of the resource. + :vartype edge_profile: ~azure.mgmt.databoxedge.v2020_09_01_preview.models.EdgeProfile + :param role_status: Role status. Possible values include: "Enabled", "Disabled". + :type role_status: str or ~azure.mgmt.databoxedge.v2020_09_01_preview.models.RoleStatus + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'kind': {'required': True}, + 'system_data': {'readonly': True}, + 'local_management_status': {'readonly': True}, + 'edge_profile': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'local_management_status': {'key': 'properties.localManagementStatus', 'type': 'str'}, + 'edge_profile': {'key': 'properties.edgeProfile', 'type': 'EdgeProfile'}, + 'role_status': {'key': 'properties.roleStatus', 'type': 'str'}, + } + + def __init__( + self, + *, + role_status: Optional[Union[str, "RoleStatus"]] = None, + **kwargs + ): + super(CloudEdgeManagementRole, self).__init__(**kwargs) + self.kind = 'CloudEdgeManagement' # type: str + self.local_management_status = None + self.edge_profile = None + self.role_status = role_status + + +class CloudErrorBody(msrest.serialization.Model): + """An error response from the service. + + :param code: An identifier for the error. Codes are invariant and are intended to be consumed + programmatically. + :type code: str + :param message: A message describing the error, intended to be suitable for display in a user + interface. + :type message: str + :param details: A list of additional details about the error. + :type details: list[~azure.mgmt.databoxedge.v2020_09_01_preview.models.CloudErrorBody] + """ + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + 'details': {'key': 'details', 'type': '[CloudErrorBody]'}, + } + + def __init__( + self, + *, + code: Optional[str] = None, + message: Optional[str] = None, + details: Optional[List["CloudErrorBody"]] = None, + **kwargs + ): + super(CloudErrorBody, self).__init__(**kwargs) + self.code = code + self.message = message + self.details = details + + +class CniConfig(msrest.serialization.Model): + """Cni configuration. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar type: Cni type. + :vartype type: str + :ivar version: Cni version. + :vartype version: str + :ivar pod_subnet: Pod Subnet. + :vartype pod_subnet: str + :ivar service_subnet: Service subnet. + :vartype service_subnet: str + """ + + _validation = { + 'type': {'readonly': True}, + 'version': {'readonly': True}, + 'pod_subnet': {'readonly': True}, + 'service_subnet': {'readonly': True}, + } + + _attribute_map = { + 'type': {'key': 'type', 'type': 'str'}, + 'version': {'key': 'version', 'type': 'str'}, + 'pod_subnet': {'key': 'podSubnet', 'type': 'str'}, + 'service_subnet': {'key': 'serviceSubnet', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(CniConfig, self).__init__(**kwargs) + self.type = None + self.version = None + self.pod_subnet = None + self.service_subnet = None + + +class ComputeResource(msrest.serialization.Model): + """Compute infrastructure Resource. + + All required parameters must be populated in order to send to Azure. + + :param processor_count: Required. Processor count. + :type processor_count: int + :param memory_in_gb: Required. Memory in GB. + :type memory_in_gb: long + """ + + _validation = { + 'processor_count': {'required': True}, + 'memory_in_gb': {'required': True}, + } + + _attribute_map = { + 'processor_count': {'key': 'processorCount', 'type': 'int'}, + 'memory_in_gb': {'key': 'memoryInGB', 'type': 'long'}, + } + + def __init__( + self, + *, + processor_count: int, + memory_in_gb: int, + **kwargs + ): + super(ComputeResource, self).__init__(**kwargs) + self.processor_count = processor_count + self.memory_in_gb = memory_in_gb + + +class ContactDetails(msrest.serialization.Model): + """Contains all the contact details of the customer. + + All required parameters must be populated in order to send to Azure. + + :param contact_person: Required. The contact person name. + :type contact_person: str + :param company_name: Required. The name of the company. + :type company_name: str + :param phone: Required. The phone number. + :type phone: str + :param email_list: Required. The email list. + :type email_list: list[str] + """ + + _validation = { + 'contact_person': {'required': True}, + 'company_name': {'required': True}, + 'phone': {'required': True}, + 'email_list': {'required': True}, + } + + _attribute_map = { + 'contact_person': {'key': 'contactPerson', 'type': 'str'}, + 'company_name': {'key': 'companyName', 'type': 'str'}, + 'phone': {'key': 'phone', 'type': 'str'}, + 'email_list': {'key': 'emailList', 'type': '[str]'}, + } + + def __init__( + self, + *, + contact_person: str, + company_name: str, + phone: str, + email_list: List[str], + **kwargs + ): + super(ContactDetails, self).__init__(**kwargs) + self.contact_person = contact_person + self.company_name = company_name + self.phone = phone + self.email_list = email_list + + +class Container(ARMBaseModel): + """Represents a container on the Data Box Edge/Gateway device. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: The path ID that uniquely identifies the object. + :vartype id: str + :ivar name: The object name. + :vartype name: str + :ivar type: The hierarchical type of the object. + :vartype type: str + :ivar system_data: Container in DataBoxEdge Resource. + :vartype system_data: ~azure.mgmt.databoxedge.v2020_09_01_preview.models.SystemData + :ivar container_status: Current status of the container. Possible values include: "OK", + "Offline", "Unknown", "Updating", "NeedsAttention". + :vartype container_status: str or + ~azure.mgmt.databoxedge.v2020_09_01_preview.models.ContainerStatus + :param data_format: Required. DataFormat for Container. Possible values include: "BlockBlob", + "PageBlob", "AzureFile". + :type data_format: str or + ~azure.mgmt.databoxedge.v2020_09_01_preview.models.AzureContainerDataFormat + :ivar refresh_details: Details of the refresh job on this container. + :vartype refresh_details: ~azure.mgmt.databoxedge.v2020_09_01_preview.models.RefreshDetails + :ivar created_date_time: The UTC time when container got created. + :vartype created_date_time: ~datetime.datetime + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'system_data': {'readonly': True}, + 'container_status': {'readonly': True}, + 'data_format': {'required': True}, + 'refresh_details': {'readonly': True}, + 'created_date_time': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'container_status': {'key': 'properties.containerStatus', 'type': 'str'}, + 'data_format': {'key': 'properties.dataFormat', 'type': 'str'}, + 'refresh_details': {'key': 'properties.refreshDetails', 'type': 'RefreshDetails'}, + 'created_date_time': {'key': 'properties.createdDateTime', 'type': 'iso-8601'}, + } + + def __init__( + self, + *, + data_format: Union[str, "AzureContainerDataFormat"], + **kwargs + ): + super(Container, self).__init__(**kwargs) + self.system_data = None + self.container_status = None + self.data_format = data_format + self.refresh_details = None + self.created_date_time = None + + +class ContainerList(msrest.serialization.Model): + """Collection of all the containers on the Data Box Edge/Gateway device. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar value: The list of containers. + :vartype value: list[~azure.mgmt.databoxedge.v2020_09_01_preview.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: ~azure.mgmt.databoxedge.v2020_09_01_preview.models.Sku + :param etag: The etag for the devices. + :type etag: str + :param identity: Msi identity of the resource. + :type identity: ~azure.mgmt.databoxedge.v2020_09_01_preview.models.ResourceIdentity + :ivar kind: The etag for the devices. Possible values include: "AzureDataBoxGateway", + "AzureStackEdge", "AzureStackHub", "AzureModularDataCentre". + :vartype kind: str or ~azure.mgmt.databoxedge.v2020_09_01_preview.models.DataBoxEdgeDeviceKind + :ivar system_data: DataBoxEdge Resource. + :vartype system_data: ~azure.mgmt.databoxedge.v2020_09_01_preview.models.SystemData + :param data_box_edge_device_status: The status of the Data Box Edge/Gateway device. Possible + values include: "ReadyToSetup", "Online", "Offline", "NeedsAttention", "Disconnected", + "PartiallyDisconnected", "Maintenance". + :type data_box_edge_device_status: str or + ~azure.mgmt.databoxedge.v2020_09_01_preview.models.DataBoxEdgeDeviceStatus + :ivar serial_number: The Serial Number of Data Box Edge/Gateway device. + :vartype serial_number: str + :ivar description: The Description of the Data Box Edge/Gateway device. + :vartype description: str + :ivar model_description: The description of the Data Box Edge/Gateway device model. + :vartype model_description: str + :ivar device_type: The type of the Data Box Edge/Gateway device. Possible values include: + "DataBoxEdgeDevice". + :vartype device_type: str or ~azure.mgmt.databoxedge.v2020_09_01_preview.models.DeviceType + :ivar friendly_name: The Data Box Edge/Gateway device name. + :vartype friendly_name: str + :ivar culture: The Data Box Edge/Gateway device culture. + :vartype culture: str + :ivar device_model: The Data Box Edge/Gateway device model. + :vartype device_model: str + :ivar device_software_version: The Data Box Edge/Gateway device software version. + :vartype device_software_version: str + :ivar device_local_capacity: The Data Box Edge/Gateway device local capacity in MB. + :vartype device_local_capacity: long + :ivar time_zone: The Data Box Edge/Gateway device timezone. + :vartype time_zone: str + :ivar device_hcs_version: The device software version number of the device (eg: 1.2.18105.6). + :vartype device_hcs_version: str + :ivar configured_role_types: Type of compute roles configured. + :vartype configured_role_types: list[str or + ~azure.mgmt.databoxedge.v2020_09_01_preview.models.RoleTypes] + :ivar node_count: The number of nodes in the cluster. + :vartype node_count: int + :ivar resource_move_details: The details of the move operation on this resource. + :vartype resource_move_details: + ~azure.mgmt.databoxedge.v2020_09_01_preview.models.ResourceMoveDetails + :ivar edge_profile: The details of Edge Profile for this resource. + :vartype edge_profile: ~azure.mgmt.databoxedge.v2020_09_01_preview.models.EdgeProfile + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': True}, + 'kind': {'readonly': True}, + 'system_data': {'readonly': True}, + 'serial_number': {'readonly': True}, + 'description': {'readonly': True}, + 'model_description': {'readonly': True}, + 'device_type': {'readonly': True}, + 'friendly_name': {'readonly': True}, + 'culture': {'readonly': True}, + 'device_model': {'readonly': True}, + 'device_software_version': {'readonly': True}, + 'device_local_capacity': {'readonly': True}, + 'time_zone': {'readonly': True}, + 'device_hcs_version': {'readonly': True}, + 'configured_role_types': {'readonly': True}, + 'node_count': {'readonly': True}, + 'resource_move_details': {'readonly': True}, + 'edge_profile': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'sku': {'key': 'sku', 'type': 'Sku'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'identity': {'key': 'identity', 'type': 'ResourceIdentity'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'data_box_edge_device_status': {'key': 'properties.dataBoxEdgeDeviceStatus', 'type': 'str'}, + 'serial_number': {'key': 'properties.serialNumber', 'type': 'str'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + 'model_description': {'key': 'properties.modelDescription', 'type': 'str'}, + 'device_type': {'key': 'properties.deviceType', 'type': 'str'}, + 'friendly_name': {'key': 'properties.friendlyName', 'type': 'str'}, + 'culture': {'key': 'properties.culture', 'type': 'str'}, + 'device_model': {'key': 'properties.deviceModel', 'type': 'str'}, + 'device_software_version': {'key': 'properties.deviceSoftwareVersion', 'type': 'str'}, + 'device_local_capacity': {'key': 'properties.deviceLocalCapacity', 'type': 'long'}, + 'time_zone': {'key': 'properties.timeZone', 'type': 'str'}, + 'device_hcs_version': {'key': 'properties.deviceHcsVersion', 'type': 'str'}, + 'configured_role_types': {'key': 'properties.configuredRoleTypes', 'type': '[str]'}, + 'node_count': {'key': 'properties.nodeCount', 'type': 'int'}, + 'resource_move_details': {'key': 'properties.resourceMoveDetails', 'type': 'ResourceMoveDetails'}, + 'edge_profile': {'key': 'properties.edgeProfile', 'type': 'EdgeProfile'}, + } + + def __init__( + self, + *, + location: str, + tags: Optional[Dict[str, str]] = None, + sku: Optional["Sku"] = None, + etag: Optional[str] = None, + identity: Optional["ResourceIdentity"] = None, + data_box_edge_device_status: Optional[Union[str, "DataBoxEdgeDeviceStatus"]] = None, + **kwargs + ): + super(DataBoxEdgeDevice, self).__init__(**kwargs) + self.location = location + self.tags = tags + self.sku = sku + self.etag = etag + self.identity = identity + self.kind = None + self.system_data = None + self.data_box_edge_device_status = data_box_edge_device_status + self.serial_number = None + self.description = None + self.model_description = None + self.device_type = None + self.friendly_name = None + self.culture = None + self.device_model = None + self.device_software_version = None + self.device_local_capacity = None + self.time_zone = None + self.device_hcs_version = None + self.configured_role_types = None + self.node_count = None + self.resource_move_details = None + self.edge_profile = None + + +class DataBoxEdgeDeviceExtendedInfo(ARMBaseModel): + """The extended Info of the Data Box Edge/Gateway device. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: The path ID that uniquely identifies the object. + :vartype id: str + :ivar name: The object name. + :vartype name: str + :ivar type: The hierarchical type of the object. + :vartype type: str + :param encryption_key_thumbprint: The digital signature of encrypted certificate. + :type encryption_key_thumbprint: str + :param encryption_key: The public part of the encryption certificate. Client uses this to + encrypt any secret. + :type encryption_key: str + :ivar resource_key: The Resource ID of the Resource. + :vartype resource_key: str + :param client_secret_store_id: The Key Vault ARM Id for client secrets. + :type client_secret_store_id: str + :param client_secret_store_url: The url to access the Client Key Vault. + :type client_secret_store_url: str + :param channel_integrity_key_name: The name of Channel Integrity Key stored in the Client Key + Vault. + :type channel_integrity_key_name: str + :param channel_integrity_key_version: The version of Channel Integrity Key stored in the Client + Key Vault. + :type channel_integrity_key_version: str + """ + + _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'}, + 'client_secret_store_id': {'key': 'properties.clientSecretStoreId', 'type': 'str'}, + 'client_secret_store_url': {'key': 'properties.clientSecretStoreUrl', 'type': 'str'}, + 'channel_integrity_key_name': {'key': 'properties.channelIntegrityKeyName', 'type': 'str'}, + 'channel_integrity_key_version': {'key': 'properties.channelIntegrityKeyVersion', 'type': 'str'}, + } + + def __init__( + self, + *, + encryption_key_thumbprint: Optional[str] = None, + encryption_key: Optional[str] = None, + client_secret_store_id: Optional[str] = None, + client_secret_store_url: Optional[str] = None, + channel_integrity_key_name: Optional[str] = None, + channel_integrity_key_version: Optional[str] = None, + **kwargs + ): + super(DataBoxEdgeDeviceExtendedInfo, self).__init__(**kwargs) + self.encryption_key_thumbprint = encryption_key_thumbprint + self.encryption_key = encryption_key + self.resource_key = None + self.client_secret_store_id = client_secret_store_id + self.client_secret_store_url = client_secret_store_url + self.channel_integrity_key_name = channel_integrity_key_name + self.channel_integrity_key_version = channel_integrity_key_version + + +class DataBoxEdgeDeviceExtendedInfoPatch(msrest.serialization.Model): + """The Data Box Edge/Gateway device extended info patch. + + :param client_secret_store_id: The Key Vault ARM Id for client secrets. + :type client_secret_store_id: str + :param client_secret_store_url: The url to access the Client Key Vault. + :type client_secret_store_url: str + :param channel_integrity_key_name: The name for Channel Integrity Key stored in the Client Key + Vault. + :type channel_integrity_key_name: str + :param channel_integrity_key_version: The version of Channel Integrity Key stored in the Client + Key Vault. + :type channel_integrity_key_version: str + """ + + _attribute_map = { + 'client_secret_store_id': {'key': 'clientSecretStoreId', 'type': 'str'}, + 'client_secret_store_url': {'key': 'clientSecretStoreUrl', 'type': 'str'}, + 'channel_integrity_key_name': {'key': 'channelIntegrityKeyName', 'type': 'str'}, + 'channel_integrity_key_version': {'key': 'channelIntegrityKeyVersion', 'type': 'str'}, + } + + def __init__( + self, + *, + client_secret_store_id: Optional[str] = None, + client_secret_store_url: Optional[str] = None, + channel_integrity_key_name: Optional[str] = None, + channel_integrity_key_version: Optional[str] = None, + **kwargs + ): + super(DataBoxEdgeDeviceExtendedInfoPatch, self).__init__(**kwargs) + self.client_secret_store_id = client_secret_store_id + self.client_secret_store_url = client_secret_store_url + self.channel_integrity_key_name = channel_integrity_key_name + self.channel_integrity_key_version = channel_integrity_key_version + + +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[~azure.mgmt.databoxedge.v2020_09_01_preview.models.DataBoxEdgeDevice] + :ivar next_link: Link to the next set of results. + :vartype next_link: str + """ + + _validation = { + 'value': {'readonly': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[DataBoxEdgeDevice]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(DataBoxEdgeDeviceList, self).__init__(**kwargs) + self.value = None + self.next_link = None + + +class DataBoxEdgeDevicePatch(msrest.serialization.Model): + """The Data Box Edge/Gateway device patch. + + :param tags: A set of tags. The tags attached to the Data Box Edge/Gateway resource. + :type tags: dict[str, str] + :param identity: Msi identity of the resource. + :type identity: ~azure.mgmt.databoxedge.v2020_09_01_preview.models.ResourceIdentity + :param edge_profile: Edge Profile property of the Data Box Edge/Gateway device. + :type edge_profile: ~azure.mgmt.databoxedge.v2020_09_01_preview.models.EdgeProfilePatch + """ + + _attribute_map = { + 'tags': {'key': 'tags', 'type': '{str}'}, + 'identity': {'key': 'identity', 'type': 'ResourceIdentity'}, + 'edge_profile': {'key': 'properties.edgeProfile', 'type': 'EdgeProfilePatch'}, + } + + def __init__( + self, + *, + tags: Optional[Dict[str, str]] = None, + identity: Optional["ResourceIdentity"] = None, + edge_profile: Optional["EdgeProfilePatch"] = None, + **kwargs + ): + super(DataBoxEdgeDevicePatch, self).__init__(**kwargs) + self.tags = tags + self.identity = identity + self.edge_profile = edge_profile + + +class DataBoxEdgeMoveRequest(msrest.serialization.Model): + """Resource Move details. + + All required parameters must be populated in order to send to Azure. + + :param target_resource_group: Required. Target resource group ARMId. + :type target_resource_group: str + :param resources: Required. List of resources to be moved. + :type resources: list[str] + """ + + _validation = { + 'target_resource_group': {'required': True}, + 'resources': {'required': True}, + } + + _attribute_map = { + 'target_resource_group': {'key': 'targetResourceGroup', 'type': 'str'}, + 'resources': {'key': 'resources', 'type': '[str]'}, + } + + def __init__( + self, + *, + target_resource_group: str, + resources: List[str], + **kwargs + ): + super(DataBoxEdgeMoveRequest, self).__init__(**kwargs) + self.target_resource_group = target_resource_group + self.resources = resources + + +class DataBoxEdgeSku(msrest.serialization.Model): + """The Sku information. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar resource_type: The type of the resource. + :vartype resource_type: str + :ivar name: The Sku name. Possible values include: "Gateway", "Edge", "TEA_1Node", + "TEA_1Node_UPS", "TEA_1Node_Heater", "TEA_1Node_UPS_Heater", "TEA_4Node_Heater", + "TEA_4Node_UPS_Heater", "TMA", "TDC", "TCA_Small", "GPU", "TCA_Large", "EdgeP_Base", + "EdgeP_High", "EdgePR_Base", "EdgePR_Base_UPS", "EdgeMR_Mini", "RCA_Small", "RCA_Large", "RDC". + :vartype name: str or ~azure.mgmt.databoxedge.v2020_09_01_preview.models.SkuName + :ivar kind: The Sku kind. + :vartype kind: str + :ivar tier: The Sku tier. Possible values include: "Standard". + :vartype tier: str or ~azure.mgmt.databoxedge.v2020_09_01_preview.models.SkuTier + :ivar size: The Sku kind. + :vartype size: str + :ivar family: The Sku family. + :vartype family: str + :ivar locations: Availability of the Sku for the region. + :vartype locations: list[str] + :ivar api_versions: The API versions in which Sku is available. + :vartype api_versions: list[str] + :ivar location_info: Availability of the Sku for the location/zone/site. + :vartype location_info: + list[~azure.mgmt.databoxedge.v2020_09_01_preview.models.SkuLocationInfo] + :ivar costs: The pricing info of the Sku. + :vartype costs: list[~azure.mgmt.databoxedge.v2020_09_01_preview.models.SkuCost] + :ivar signup_option: Sku can be signed up by customer or not. Possible values include: "None", + "Available". + :vartype signup_option: str or + ~azure.mgmt.databoxedge.v2020_09_01_preview.models.SkuSignupOption + :ivar version: Availability of the Sku as preview/stable. Possible values include: "Stable", + "Preview". + :vartype version: str or ~azure.mgmt.databoxedge.v2020_09_01_preview.models.SkuVersion + :ivar availability: Links to the next set of results. Possible values include: "Available", + "Unavailable". + :vartype availability: str or + ~azure.mgmt.databoxedge.v2020_09_01_preview.models.SkuAvailability + :ivar shipment_types: List of Shipment Types supported by this SKU. + :vartype shipment_types: list[str or + ~azure.mgmt.databoxedge.v2020_09_01_preview.models.ShipmentType] + """ + + _validation = { + 'resource_type': {'readonly': True}, + 'name': {'readonly': True}, + 'kind': {'readonly': True}, + 'tier': {'readonly': True}, + 'size': {'readonly': True}, + 'family': {'readonly': True}, + 'locations': {'readonly': True}, + 'api_versions': {'readonly': True}, + 'location_info': {'readonly': True}, + 'costs': {'readonly': True}, + 'signup_option': {'readonly': True}, + 'version': {'readonly': True}, + 'availability': {'readonly': True}, + 'shipment_types': {'readonly': True}, + } + + _attribute_map = { + 'resource_type': {'key': 'resourceType', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'tier': {'key': 'tier', 'type': 'str'}, + 'size': {'key': 'size', 'type': 'str'}, + 'family': {'key': 'family', 'type': 'str'}, + 'locations': {'key': 'locations', 'type': '[str]'}, + 'api_versions': {'key': 'apiVersions', 'type': '[str]'}, + 'location_info': {'key': 'locationInfo', 'type': '[SkuLocationInfo]'}, + 'costs': {'key': 'costs', 'type': '[SkuCost]'}, + 'signup_option': {'key': 'signupOption', 'type': 'str'}, + 'version': {'key': 'version', 'type': 'str'}, + 'availability': {'key': 'availability', 'type': 'str'}, + 'shipment_types': {'key': 'shipmentTypes', 'type': '[str]'}, + } + + def __init__( + self, + **kwargs + ): + super(DataBoxEdgeSku, self).__init__(**kwargs) + self.resource_type = None + self.name = None + self.kind = None + self.tier = None + self.size = None + self.family = None + self.locations = None + self.api_versions = None + self.location_info = None + self.costs = None + self.signup_option = None + self.version = None + self.availability = None + self.shipment_types = None + + +class DataBoxEdgeSkuList(msrest.serialization.Model): + """List of SKU Information objects. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar value: List of ResourceType Sku. + :vartype value: list[~azure.mgmt.databoxedge.v2020_09_01_preview.models.DataBoxEdgeSku] + :ivar next_link: Links to the next set of results. + :vartype next_link: str + """ + + _validation = { + 'value': {'readonly': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[DataBoxEdgeSku]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(DataBoxEdgeSkuList, self).__init__(**kwargs) + self.value = None + self.next_link = None + + +class DCAccessCode(msrest.serialization.Model): + """DC Access code in the case of Self Managed Shipping. + + :param auth_code: DCAccess Code for the Self Managed shipment. + :type auth_code: str + """ + + _attribute_map = { + 'auth_code': {'key': 'properties.authCode', 'type': 'str'}, + } + + def __init__( + self, + *, + auth_code: Optional[str] = None, + **kwargs + ): + super(DCAccessCode, self).__init__(**kwargs) + self.auth_code = auth_code + + +class EdgeProfile(msrest.serialization.Model): + """Details about Edge Profile for the resource. + + :param subscription: Edge Profile Subscription. + :type subscription: ~azure.mgmt.databoxedge.v2020_09_01_preview.models.EdgeProfileSubscription + """ + + _attribute_map = { + 'subscription': {'key': 'subscription', 'type': 'EdgeProfileSubscription'}, + } + + def __init__( + self, + *, + subscription: Optional["EdgeProfileSubscription"] = None, + **kwargs + ): + super(EdgeProfile, self).__init__(**kwargs) + self.subscription = subscription + + +class EdgeProfilePatch(msrest.serialization.Model): + """The Data Box Edge/Gateway Edge Profile patch. + + :param subscription: The Data Box Edge/Gateway Edge Profile Subscription patch. + :type subscription: + ~azure.mgmt.databoxedge.v2020_09_01_preview.models.EdgeProfileSubscriptionPatch + """ + + _attribute_map = { + 'subscription': {'key': 'subscription', 'type': 'EdgeProfileSubscriptionPatch'}, + } + + def __init__( + self, + *, + subscription: Optional["EdgeProfileSubscriptionPatch"] = None, + **kwargs + ): + super(EdgeProfilePatch, self).__init__(**kwargs) + self.subscription = subscription + + +class EdgeProfileSubscription(msrest.serialization.Model): + """Subscription details for the Edge Profile. + + :param registration_id: Edge Subscription Registration ID. + :type registration_id: str + :param id: ARM ID of the subscription. + :type id: str + :param state: Possible values include: "Registered", "Warned", "Suspended", "Deleted", + "Unregistered". + :type state: str or ~azure.mgmt.databoxedge.v2020_09_01_preview.models.SubscriptionState + :param registration_date: + :type registration_date: str + :param subscription_id: + :type subscription_id: str + :param tenant_id: + :type tenant_id: str + :param location_placement_id: + :type location_placement_id: str + :param quota_id: + :type quota_id: str + :param serialized_details: + :type serialized_details: str + :param registered_features: + :type registered_features: + list[~azure.mgmt.databoxedge.v2020_09_01_preview.models.SubscriptionRegisteredFeatures] + """ + + _attribute_map = { + 'registration_id': {'key': 'registrationId', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + 'state': {'key': 'state', 'type': 'str'}, + 'registration_date': {'key': 'registrationDate', 'type': 'str'}, + 'subscription_id': {'key': 'subscriptionId', 'type': 'str'}, + 'tenant_id': {'key': 'properties.tenantId', 'type': 'str'}, + 'location_placement_id': {'key': 'properties.locationPlacementId', 'type': 'str'}, + 'quota_id': {'key': 'properties.quotaId', 'type': 'str'}, + 'serialized_details': {'key': 'properties.serializedDetails', 'type': 'str'}, + 'registered_features': {'key': 'properties.registeredFeatures', 'type': '[SubscriptionRegisteredFeatures]'}, + } + + def __init__( + self, + *, + registration_id: Optional[str] = None, + id: Optional[str] = None, + state: Optional[Union[str, "SubscriptionState"]] = None, + registration_date: Optional[str] = None, + subscription_id: Optional[str] = None, + tenant_id: Optional[str] = None, + location_placement_id: Optional[str] = None, + quota_id: Optional[str] = None, + serialized_details: Optional[str] = None, + registered_features: Optional[List["SubscriptionRegisteredFeatures"]] = None, + **kwargs + ): + super(EdgeProfileSubscription, self).__init__(**kwargs) + self.registration_id = registration_id + self.id = id + self.state = state + self.registration_date = registration_date + self.subscription_id = subscription_id + self.tenant_id = tenant_id + self.location_placement_id = location_placement_id + self.quota_id = quota_id + self.serialized_details = serialized_details + self.registered_features = registered_features + + +class EdgeProfileSubscriptionPatch(msrest.serialization.Model): + """The Data Box Edge/Gateway Edge Profile Subscription patch. + + :param id: The path ID that uniquely identifies the subscription of the edge profile. + :type id: str + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + } + + def __init__( + self, + *, + id: Optional[str] = None, + **kwargs + ): + super(EdgeProfileSubscriptionPatch, self).__init__(**kwargs) + self.id = id + + +class EtcdInfo(msrest.serialization.Model): + """Etcd configuration. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar type: Etcd type. + :vartype type: str + :ivar version: Etcd version. + :vartype version: str + """ + + _validation = { + 'type': {'readonly': True}, + 'version': {'readonly': True}, + } + + _attribute_map = { + 'type': {'key': 'type', 'type': 'str'}, + 'version': {'key': 'version', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(EtcdInfo, self).__init__(**kwargs) + self.type = None + self.version = None + + +class Trigger(ARMBaseModel): + """Trigger details. + + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: FileEventTrigger, PeriodicTimerEventTrigger. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: The path ID that uniquely identifies the object. + :vartype id: str + :ivar name: The object name. + :vartype name: str + :ivar type: The hierarchical type of the object. + :vartype type: str + :ivar system_data: Trigger in DataBoxEdge Resource. + :vartype system_data: ~azure.mgmt.databoxedge.v2020_09_01_preview.models.SystemData + :param kind: Required. Trigger Kind.Constant filled by server. Possible values include: + "FileEvent", "PeriodicTimerEvent". + :type kind: str or ~azure.mgmt.databoxedge.v2020_09_01_preview.models.TriggerEventType + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'system_data': {'readonly': True}, + 'kind': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'kind': {'key': 'kind', 'type': 'str'}, + } + + _subtype_map = { + 'kind': {'FileEvent': 'FileEventTrigger', 'PeriodicTimerEvent': 'PeriodicTimerEventTrigger'} + } + + def __init__( + self, + **kwargs + ): + super(Trigger, self).__init__(**kwargs) + self.system_data = None + self.kind = 'Trigger' # type: str + + +class FileEventTrigger(Trigger): + """Trigger details. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: The path ID that uniquely identifies the object. + :vartype id: str + :ivar name: The object name. + :vartype name: str + :ivar type: The hierarchical type of the object. + :vartype type: str + :ivar system_data: Trigger in DataBoxEdge Resource. + :vartype system_data: ~azure.mgmt.databoxedge.v2020_09_01_preview.models.SystemData + :param kind: Required. Trigger Kind.Constant filled by server. Possible values include: + "FileEvent", "PeriodicTimerEvent". + :type kind: str or ~azure.mgmt.databoxedge.v2020_09_01_preview.models.TriggerEventType + :param source_info: Required. File event source details. + :type source_info: ~azure.mgmt.databoxedge.v2020_09_01_preview.models.FileSourceInfo + :param sink_info: Required. Role sink info. + :type sink_info: ~azure.mgmt.databoxedge.v2020_09_01_preview.models.RoleSinkInfo + :param custom_context_tag: A custom context tag typically used to correlate the trigger against + its usage. For example, if a periodic timer trigger is intended for certain specific IoT + modules in the device, the tag can be the name or the image URL of the module. + :type custom_context_tag: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'system_data': {'readonly': True}, + 'kind': {'required': True}, + 'source_info': {'required': True}, + 'sink_info': {'required': True}, + 'custom_context_tag': {'max_length': 192, 'min_length': 0}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'source_info': {'key': 'properties.sourceInfo', 'type': 'FileSourceInfo'}, + 'sink_info': {'key': 'properties.sinkInfo', 'type': 'RoleSinkInfo'}, + 'custom_context_tag': {'key': 'properties.customContextTag', 'type': 'str'}, + } + + def __init__( + self, + *, + source_info: "FileSourceInfo", + sink_info: "RoleSinkInfo", + custom_context_tag: Optional[str] = None, + **kwargs + ): + super(FileEventTrigger, self).__init__(**kwargs) + self.kind = 'FileEvent' # type: str + self.source_info = source_info + self.sink_info = sink_info + self.custom_context_tag = custom_context_tag + + +class FileSourceInfo(msrest.serialization.Model): + """File source details. + + All required parameters must be populated in order to send to Azure. + + :param share_id: Required. File share ID. + :type share_id: str + """ + + _validation = { + 'share_id': {'required': True}, + } + + _attribute_map = { + 'share_id': {'key': 'shareId', 'type': 'str'}, + } + + def __init__( + self, + *, + share_id: str, + **kwargs + ): + super(FileSourceInfo, self).__init__(**kwargs) + self.share_id = share_id + + +class GenerateCertResponse(msrest.serialization.Model): + """Used in activation key generation flow. + + :param public_key: Gets or sets base64 encoded certificate raw data, + this is the public part needed to be uploaded to cert vault. + :type public_key: str + :param private_key: Gets or sets base64 encoded private part of the certificate, + needed to form the activation key. + :type private_key: str + :param expiry_time_in_utc: Gets or sets expiry time in UTC. + :type expiry_time_in_utc: str + """ + + _attribute_map = { + 'public_key': {'key': 'publicKey', 'type': 'str'}, + 'private_key': {'key': 'privateKey', 'type': 'str'}, + 'expiry_time_in_utc': {'key': 'expiryTimeInUTC', 'type': 'str'}, + } + + def __init__( + self, + *, + public_key: Optional[str] = None, + private_key: Optional[str] = None, + expiry_time_in_utc: Optional[str] = None, + **kwargs + ): + super(GenerateCertResponse, self).__init__(**kwargs) + self.public_key = public_key + self.private_key = private_key + self.expiry_time_in_utc = expiry_time_in_utc + + +class ImageRepositoryCredential(msrest.serialization.Model): + """Image repository credential. + + All required parameters must be populated in order to send to Azure. + + :param image_repository_url: Required. Image repository url (e.g.: mcr.microsoft.com). + :type image_repository_url: str + :param user_name: Required. Repository user name. + :type user_name: str + :param password: Repository user password. + :type password: ~azure.mgmt.databoxedge.v2020_09_01_preview.models.AsymmetricEncryptedSecret + """ + + _validation = { + 'image_repository_url': {'required': True}, + 'user_name': {'required': True}, + } + + _attribute_map = { + 'image_repository_url': {'key': 'imageRepositoryUrl', 'type': 'str'}, + 'user_name': {'key': 'userName', 'type': 'str'}, + 'password': {'key': 'password', 'type': 'AsymmetricEncryptedSecret'}, + } + + def __init__( + self, + *, + image_repository_url: str, + user_name: str, + password: Optional["AsymmetricEncryptedSecret"] = None, + **kwargs + ): + super(ImageRepositoryCredential, self).__init__(**kwargs) + self.image_repository_url = image_repository_url + self.user_name = user_name + self.password = password + + +class IoTAddon(Addon): + """IoT Addon. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: The path ID that uniquely identifies the object. + :vartype id: str + :ivar name: The object name. + :vartype name: str + :ivar type: The hierarchical type of the object. + :vartype type: str + :param kind: Required. Addon type.Constant filled by server. Possible values include: + "IotEdge", "ArcForKubernetes". + :type kind: str or ~azure.mgmt.databoxedge.v2020_09_01_preview.models.AddonType + :ivar system_data: Addon type. + :vartype system_data: ~azure.mgmt.databoxedge.v2020_09_01_preview.models.SystemData + :param io_t_device_details: Required. IoT device metadata to which appliance needs to be + connected. + :type io_t_device_details: ~azure.mgmt.databoxedge.v2020_09_01_preview.models.IoTDeviceInfo + :param io_t_edge_device_details: Required. IoT edge device to which the IoT Addon needs to be + configured. + :type io_t_edge_device_details: + ~azure.mgmt.databoxedge.v2020_09_01_preview.models.IoTDeviceInfo + :ivar version: Version of IoT running on the appliance. + :vartype version: str + :ivar host_platform: Host OS supported by the IoT addon. Possible values include: "Windows", + "Linux". + :vartype host_platform: str or ~azure.mgmt.databoxedge.v2020_09_01_preview.models.PlatformType + :ivar host_platform_type: Platform where the runtime is hosted. Possible values include: + "KubernetesCluster", "LinuxVM". + :vartype host_platform_type: str or + ~azure.mgmt.databoxedge.v2020_09_01_preview.models.HostPlatformType + :ivar provisioning_state: Addon Provisioning State. Possible values include: "Invalid", + "Creating", "Created", "Updating", "Reconfiguring", "Failed", "Deleting". + :vartype provisioning_state: str or + ~azure.mgmt.databoxedge.v2020_09_01_preview.models.AddonState + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'kind': {'required': True}, + 'system_data': {'readonly': True}, + 'io_t_device_details': {'required': True}, + 'io_t_edge_device_details': {'required': True}, + 'version': {'readonly': True}, + 'host_platform': {'readonly': True}, + 'host_platform_type': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'io_t_device_details': {'key': 'properties.ioTDeviceDetails', 'type': 'IoTDeviceInfo'}, + 'io_t_edge_device_details': {'key': 'properties.ioTEdgeDeviceDetails', 'type': 'IoTDeviceInfo'}, + 'version': {'key': 'properties.version', 'type': 'str'}, + 'host_platform': {'key': 'properties.hostPlatform', 'type': 'str'}, + 'host_platform_type': {'key': 'properties.hostPlatformType', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + } + + def __init__( + self, + *, + io_t_device_details: "IoTDeviceInfo", + io_t_edge_device_details: "IoTDeviceInfo", + **kwargs + ): + super(IoTAddon, self).__init__(**kwargs) + self.kind = 'IotEdge' # type: str + self.io_t_device_details = io_t_device_details + self.io_t_edge_device_details = io_t_edge_device_details + self.version = None + self.host_platform = None + self.host_platform_type = None + self.provisioning_state = None + + +class IoTDeviceInfo(msrest.serialization.Model): + """Metadata of IoT device/IoT Edge device to be configured. + + All required parameters must be populated in order to send to Azure. + + :param device_id: Required. ID of the IoT device/edge device. + :type device_id: str + :param io_t_host_hub: Required. Host name for the IoT hub associated to the device. + :type io_t_host_hub: str + :param io_t_host_hub_id: Id for the IoT hub associated to the device. + :type io_t_host_hub_id: str + :param authentication: Encrypted IoT device/IoT edge device connection string. + :type authentication: ~azure.mgmt.databoxedge.v2020_09_01_preview.models.Authentication + """ + + _validation = { + 'device_id': {'required': True}, + 'io_t_host_hub': {'required': True}, + } + + _attribute_map = { + 'device_id': {'key': 'deviceId', 'type': 'str'}, + 'io_t_host_hub': {'key': 'ioTHostHub', 'type': 'str'}, + 'io_t_host_hub_id': {'key': 'ioTHostHubId', 'type': 'str'}, + 'authentication': {'key': 'authentication', 'type': 'Authentication'}, + } + + def __init__( + self, + *, + device_id: str, + io_t_host_hub: str, + io_t_host_hub_id: Optional[str] = None, + authentication: Optional["Authentication"] = None, + **kwargs + ): + super(IoTDeviceInfo, self).__init__(**kwargs) + self.device_id = device_id + self.io_t_host_hub = io_t_host_hub + self.io_t_host_hub_id = io_t_host_hub_id + self.authentication = authentication + + +class IoTEdgeAgentInfo(msrest.serialization.Model): + """IoT edge agent details is optional, this will be used for download system Agent module while bootstrapping IoT Role if specified. + + All required parameters must be populated in order to send to Azure. + + :param image_name: Required. Name of the IoT edge agent image. + :type image_name: str + :param tag: Required. Image Tag. + :type tag: str + :param image_repository: Image repository details. + :type image_repository: + ~azure.mgmt.databoxedge.v2020_09_01_preview.models.ImageRepositoryCredential + """ + + _validation = { + 'image_name': {'required': True}, + 'tag': {'required': True}, + } + + _attribute_map = { + 'image_name': {'key': 'imageName', 'type': 'str'}, + 'tag': {'key': 'tag', 'type': 'str'}, + 'image_repository': {'key': 'imageRepository', 'type': 'ImageRepositoryCredential'}, + } + + def __init__( + self, + *, + image_name: str, + tag: str, + image_repository: Optional["ImageRepositoryCredential"] = None, + **kwargs + ): + super(IoTEdgeAgentInfo, self).__init__(**kwargs) + self.image_name = image_name + self.tag = tag + self.image_repository = image_repository + + +class IoTRole(Role): + """Compute role. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: The path ID that uniquely identifies the object. + :vartype id: str + :ivar name: The object name. + :vartype name: str + :ivar type: The hierarchical type of the object. + :vartype type: str + :param kind: Required. Role type.Constant filled by server. Possible values include: "IOT", + "ASA", "Functions", "Cognitive", "MEC", "CloudEdgeManagement", "Kubernetes". + :type kind: str or ~azure.mgmt.databoxedge.v2020_09_01_preview.models.RoleTypes + :ivar system_data: Role configured on ASE resource. + :vartype system_data: ~azure.mgmt.databoxedge.v2020_09_01_preview.models.SystemData + :param host_platform: Host OS supported by the IoT role. Possible values include: "Windows", + "Linux". + :type host_platform: str or ~azure.mgmt.databoxedge.v2020_09_01_preview.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: ~azure.mgmt.databoxedge.v2020_09_01_preview.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: + ~azure.mgmt.databoxedge.v2020_09_01_preview.models.IoTDeviceInfo + :param share_mappings: Mount points of shares in role(s). + :type share_mappings: list[~azure.mgmt.databoxedge.v2020_09_01_preview.models.MountPointMap] + :param io_t_edge_agent_info: Iot edge agent details to download the agent and bootstrap iot + runtime. + :type io_t_edge_agent_info: ~azure.mgmt.databoxedge.v2020_09_01_preview.models.IoTEdgeAgentInfo + :ivar host_platform_type: Platform where the Iot runtime is hosted. Possible values include: + "KubernetesCluster", "LinuxVM". + :vartype host_platform_type: str or + ~azure.mgmt.databoxedge.v2020_09_01_preview.models.HostPlatformType + :param compute_resource: Resource allocation. + :type compute_resource: ~azure.mgmt.databoxedge.v2020_09_01_preview.models.ComputeResource + :param role_status: Role status. Possible values include: "Enabled", "Disabled". + :type role_status: str or ~azure.mgmt.databoxedge.v2020_09_01_preview.models.RoleStatus + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'kind': {'required': True}, + 'system_data': {'readonly': True}, + 'host_platform_type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'host_platform': {'key': 'properties.hostPlatform', 'type': 'str'}, + 'io_t_device_details': {'key': 'properties.ioTDeviceDetails', 'type': 'IoTDeviceInfo'}, + 'io_t_edge_device_details': {'key': 'properties.ioTEdgeDeviceDetails', 'type': 'IoTDeviceInfo'}, + 'share_mappings': {'key': 'properties.shareMappings', 'type': '[MountPointMap]'}, + 'io_t_edge_agent_info': {'key': 'properties.ioTEdgeAgentInfo', 'type': 'IoTEdgeAgentInfo'}, + 'host_platform_type': {'key': 'properties.hostPlatformType', 'type': 'str'}, + 'compute_resource': {'key': 'properties.computeResource', 'type': 'ComputeResource'}, + 'role_status': {'key': 'properties.roleStatus', 'type': 'str'}, + } + + def __init__( + self, + *, + host_platform: Optional[Union[str, "PlatformType"]] = None, + io_t_device_details: Optional["IoTDeviceInfo"] = None, + io_t_edge_device_details: Optional["IoTDeviceInfo"] = None, + share_mappings: Optional[List["MountPointMap"]] = None, + io_t_edge_agent_info: Optional["IoTEdgeAgentInfo"] = None, + compute_resource: Optional["ComputeResource"] = None, + role_status: Optional[Union[str, "RoleStatus"]] = None, + **kwargs + ): + super(IoTRole, self).__init__(**kwargs) + self.kind = 'IOT' # type: str + self.host_platform = host_platform + self.io_t_device_details = io_t_device_details + self.io_t_edge_device_details = io_t_edge_device_details + self.share_mappings = share_mappings + self.io_t_edge_agent_info = io_t_edge_agent_info + self.host_platform_type = None + self.compute_resource = compute_resource + self.role_status = role_status + + +class Ipv4Config(msrest.serialization.Model): + """Details related to the IPv4 address configuration. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar ip_address: The IPv4 address of the network adapter. + :vartype ip_address: str + :ivar subnet: The IPv4 subnet of the network adapter. + :vartype subnet: str + :ivar gateway: The IPv4 gateway of the network adapter. + :vartype gateway: str + """ + + _validation = { + 'ip_address': {'readonly': True}, + 'subnet': {'readonly': True}, + 'gateway': {'readonly': True}, + } + + _attribute_map = { + 'ip_address': {'key': 'ipAddress', 'type': 'str'}, + 'subnet': {'key': 'subnet', 'type': 'str'}, + 'gateway': {'key': 'gateway', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(Ipv4Config, self).__init__(**kwargs) + self.ip_address = None + self.subnet = None + self.gateway = None + + +class Ipv6Config(msrest.serialization.Model): + """Details related to the IPv6 address configuration. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar ip_address: The IPv6 address of the network adapter. + :vartype ip_address: str + :ivar prefix_length: The IPv6 prefix of the network adapter. + :vartype prefix_length: int + :ivar gateway: The IPv6 gateway of the network adapter. + :vartype gateway: str + """ + + _validation = { + 'ip_address': {'readonly': True}, + 'prefix_length': {'readonly': True}, + 'gateway': {'readonly': True}, + } + + _attribute_map = { + 'ip_address': {'key': 'ipAddress', 'type': 'str'}, + 'prefix_length': {'key': 'prefixLength', 'type': 'int'}, + 'gateway': {'key': 'gateway', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(Ipv6Config, self).__init__(**kwargs) + self.ip_address = None + self.prefix_length = None + self.gateway = None + + +class Job(msrest.serialization.Model): + """A device job. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: The path ID that uniquely identifies the object. + :vartype id: str + :ivar name: The name of the object. + :vartype name: str + :ivar type: The hierarchical type of the object. + :vartype type: str + :ivar status: The current status of the job. Possible values include: "Invalid", "Running", + "Succeeded", "Failed", "Canceled", "Paused", "Scheduled". + :vartype status: str or ~azure.mgmt.databoxedge.v2020_09_01_preview.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: ~azure.mgmt.databoxedge.v2020_09_01_preview.models.JobErrorDetails + :ivar job_type: The type of the job. Possible values include: "Invalid", "ScanForUpdates", + "DownloadUpdates", "InstallUpdates", "RefreshShare", "RefreshContainer", "Backup", "Restore", + "TriggerSupportPackage". + :vartype job_type: str or ~azure.mgmt.databoxedge.v2020_09_01_preview.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 + ~azure.mgmt.databoxedge.v2020_09_01_preview.models.UpdateOperationStage + :ivar download_progress: The download progress. + :vartype download_progress: + ~azure.mgmt.databoxedge.v2020_09_01_preview.models.UpdateDownloadProgress + :ivar install_progress: The install progress. + :vartype install_progress: + ~azure.mgmt.databoxedge.v2020_09_01_preview.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[~azure.mgmt.databoxedge.v2020_09_01_preview.models.JobErrorItem] + :ivar code: The code intended for programmatic access. + :vartype code: str + :ivar message: The message that describes the error in detail. + :vartype message: str + """ + + _validation = { + 'error_details': {'readonly': True}, + 'code': {'readonly': True}, + 'message': {'readonly': True}, + } + + _attribute_map = { + 'error_details': {'key': 'errorDetails', 'type': '[JobErrorItem]'}, + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(JobErrorDetails, self).__init__(**kwargs) + self.error_details = None + self.code = None + self.message = None + + +class JobErrorItem(msrest.serialization.Model): + """The job error items. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar recommendations: The recommended actions. + :vartype recommendations: list[str] + :ivar code: The code intended for programmatic access. + :vartype code: str + :ivar message: The message that describes the error in detail. + :vartype message: str + """ + + _validation = { + 'recommendations': {'readonly': True}, + 'code': {'readonly': True}, + 'message': {'readonly': True}, + } + + _attribute_map = { + 'recommendations': {'key': 'recommendations', 'type': '[str]'}, + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(JobErrorItem, self).__init__(**kwargs) + self.recommendations = None + self.code = None + self.message = None + + +class KubernetesClusterInfo(msrest.serialization.Model): + """Kubernetes cluster configuration. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar etcd_info: Etcd configuration. + :vartype etcd_info: ~azure.mgmt.databoxedge.v2020_09_01_preview.models.EtcdInfo + :ivar nodes: Kubernetes cluster nodes. + :vartype nodes: list[~azure.mgmt.databoxedge.v2020_09_01_preview.models.NodeInfo] + :param version: Required. Kubernetes cluster version. + :type version: str + """ + + _validation = { + 'etcd_info': {'readonly': True}, + 'nodes': {'readonly': True}, + 'version': {'required': True}, + } + + _attribute_map = { + 'etcd_info': {'key': 'etcdInfo', 'type': 'EtcdInfo'}, + 'nodes': {'key': 'nodes', 'type': '[NodeInfo]'}, + 'version': {'key': 'version', 'type': 'str'}, + } + + def __init__( + self, + *, + version: str, + **kwargs + ): + super(KubernetesClusterInfo, self).__init__(**kwargs) + self.etcd_info = None + self.nodes = None + self.version = version + + +class KubernetesIPConfiguration(msrest.serialization.Model): + """Kubernetes node IP configuration. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar port: Port of the Kubernetes node. + :vartype port: str + :param ip_address: IP address of the Kubernetes node. + :type ip_address: str + """ + + _validation = { + 'port': {'readonly': True}, + } + + _attribute_map = { + 'port': {'key': 'port', 'type': 'str'}, + 'ip_address': {'key': 'ipAddress', 'type': 'str'}, + } + + def __init__( + self, + *, + ip_address: Optional[str] = None, + **kwargs + ): + super(KubernetesIPConfiguration, self).__init__(**kwargs) + self.port = None + self.ip_address = ip_address + + +class KubernetesRole(Role): + """Kubernetes role. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: The path ID that uniquely identifies the object. + :vartype id: str + :ivar name: The object name. + :vartype name: str + :ivar type: The hierarchical type of the object. + :vartype type: str + :param kind: Required. Role type.Constant filled by server. Possible values include: "IOT", + "ASA", "Functions", "Cognitive", "MEC", "CloudEdgeManagement", "Kubernetes". + :type kind: str or ~azure.mgmt.databoxedge.v2020_09_01_preview.models.RoleTypes + :ivar system_data: Role configured on ASE resource. + :vartype system_data: ~azure.mgmt.databoxedge.v2020_09_01_preview.models.SystemData + :param host_platform: Host OS supported by the Kubernetes role. Possible values include: + "Windows", "Linux". + :type host_platform: str or ~azure.mgmt.databoxedge.v2020_09_01_preview.models.PlatformType + :ivar provisioning_state: State of Kubernetes deployment. Possible values include: "Invalid", + "Creating", "Created", "Updating", "Reconfiguring", "Failed", "Deleting". + :vartype provisioning_state: str or + ~azure.mgmt.databoxedge.v2020_09_01_preview.models.KubernetesState + :ivar host_platform_type: Platform where the runtime is hosted. Possible values include: + "KubernetesCluster", "LinuxVM". + :vartype host_platform_type: str or + ~azure.mgmt.databoxedge.v2020_09_01_preview.models.HostPlatformType + :param kubernetes_cluster_info: Kubernetes cluster configuration. + :type kubernetes_cluster_info: + ~azure.mgmt.databoxedge.v2020_09_01_preview.models.KubernetesClusterInfo + :param kubernetes_role_resources: Kubernetes role resources. + :type kubernetes_role_resources: + ~azure.mgmt.databoxedge.v2020_09_01_preview.models.KubernetesRoleResources + :param role_status: Role status. Possible values include: "Enabled", "Disabled". + :type role_status: str or ~azure.mgmt.databoxedge.v2020_09_01_preview.models.RoleStatus + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'kind': {'required': True}, + 'system_data': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + 'host_platform_type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'host_platform': {'key': 'properties.hostPlatform', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'host_platform_type': {'key': 'properties.hostPlatformType', 'type': 'str'}, + 'kubernetes_cluster_info': {'key': 'properties.kubernetesClusterInfo', 'type': 'KubernetesClusterInfo'}, + 'kubernetes_role_resources': {'key': 'properties.kubernetesRoleResources', 'type': 'KubernetesRoleResources'}, + 'role_status': {'key': 'properties.roleStatus', 'type': 'str'}, + } + + def __init__( + self, + *, + host_platform: Optional[Union[str, "PlatformType"]] = None, + kubernetes_cluster_info: Optional["KubernetesClusterInfo"] = None, + kubernetes_role_resources: Optional["KubernetesRoleResources"] = None, + role_status: Optional[Union[str, "RoleStatus"]] = None, + **kwargs + ): + super(KubernetesRole, self).__init__(**kwargs) + self.kind = 'Kubernetes' # type: str + self.host_platform = host_platform + self.provisioning_state = None + self.host_platform_type = None + self.kubernetes_cluster_info = kubernetes_cluster_info + self.kubernetes_role_resources = kubernetes_role_resources + self.role_status = role_status + + +class KubernetesRoleCompute(msrest.serialization.Model): + """Kubernetes role compute resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :param vm_profile: Required. VM profile. + :type vm_profile: str + :ivar memory_in_bytes: Memory in bytes. + :vartype memory_in_bytes: long + :ivar processor_count: Processor count. + :vartype processor_count: int + """ + + _validation = { + 'vm_profile': {'required': True}, + 'memory_in_bytes': {'readonly': True}, + 'processor_count': {'readonly': True}, + } + + _attribute_map = { + 'vm_profile': {'key': 'vmProfile', 'type': 'str'}, + 'memory_in_bytes': {'key': 'memoryInBytes', 'type': 'long'}, + 'processor_count': {'key': 'processorCount', 'type': 'int'}, + } + + def __init__( + self, + *, + vm_profile: str, + **kwargs + ): + super(KubernetesRoleCompute, self).__init__(**kwargs) + self.vm_profile = vm_profile + self.memory_in_bytes = None + self.processor_count = None + + +class KubernetesRoleNetwork(msrest.serialization.Model): + """Kubernetes role network resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar cni_config: Cni configuration. + :vartype cni_config: ~azure.mgmt.databoxedge.v2020_09_01_preview.models.CniConfig + :ivar load_balancer_config: Load balancer configuration. + :vartype load_balancer_config: + ~azure.mgmt.databoxedge.v2020_09_01_preview.models.LoadBalancerConfig + """ + + _validation = { + 'cni_config': {'readonly': True}, + 'load_balancer_config': {'readonly': True}, + } + + _attribute_map = { + 'cni_config': {'key': 'cniConfig', 'type': 'CniConfig'}, + 'load_balancer_config': {'key': 'loadBalancerConfig', 'type': 'LoadBalancerConfig'}, + } + + def __init__( + self, + **kwargs + ): + super(KubernetesRoleNetwork, self).__init__(**kwargs) + self.cni_config = None + self.load_balancer_config = None + + +class KubernetesRoleResources(msrest.serialization.Model): + """Kubernetes role resources. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :param storage: Kubernetes role storage resource. + :type storage: ~azure.mgmt.databoxedge.v2020_09_01_preview.models.KubernetesRoleStorage + :param compute: Required. Kubernetes role compute resource. + :type compute: ~azure.mgmt.databoxedge.v2020_09_01_preview.models.KubernetesRoleCompute + :ivar network: Kubernetes role network resource. + :vartype network: ~azure.mgmt.databoxedge.v2020_09_01_preview.models.KubernetesRoleNetwork + """ + + _validation = { + 'compute': {'required': True}, + 'network': {'readonly': True}, + } + + _attribute_map = { + 'storage': {'key': 'storage', 'type': 'KubernetesRoleStorage'}, + 'compute': {'key': 'compute', 'type': 'KubernetesRoleCompute'}, + 'network': {'key': 'network', 'type': 'KubernetesRoleNetwork'}, + } + + def __init__( + self, + *, + compute: "KubernetesRoleCompute", + storage: Optional["KubernetesRoleStorage"] = None, + **kwargs + ): + super(KubernetesRoleResources, self).__init__(**kwargs) + self.storage = storage + self.compute = compute + self.network = None + + +class KubernetesRoleStorage(msrest.serialization.Model): + """Kubernetes role storage resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar storage_classes: Kubernetes storage class info. + :vartype storage_classes: + list[~azure.mgmt.databoxedge.v2020_09_01_preview.models.KubernetesRoleStorageClassInfo] + :param endpoints: Mount points of shares in role(s). + :type endpoints: list[~azure.mgmt.databoxedge.v2020_09_01_preview.models.MountPointMap] + """ + + _validation = { + 'storage_classes': {'readonly': True}, + } + + _attribute_map = { + 'storage_classes': {'key': 'storageClasses', 'type': '[KubernetesRoleStorageClassInfo]'}, + 'endpoints': {'key': 'endpoints', 'type': '[MountPointMap]'}, + } + + def __init__( + self, + *, + endpoints: Optional[List["MountPointMap"]] = None, + **kwargs + ): + super(KubernetesRoleStorage, self).__init__(**kwargs) + self.storage_classes = None + self.endpoints = endpoints + + +class KubernetesRoleStorageClassInfo(msrest.serialization.Model): + """Kubernetes storage class info. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar name: Storage class name. + :vartype name: str + :ivar type: Storage class type. + :vartype type: str + :ivar posix_compliant: If provisioned storage is posix compliant. Possible values include: + "Invalid", "Enabled", "Disabled". + :vartype posix_compliant: str or + ~azure.mgmt.databoxedge.v2020_09_01_preview.models.PosixComplianceStatus + """ + + _validation = { + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'posix_compliant': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'posix_compliant': {'key': 'posixCompliant', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(KubernetesRoleStorageClassInfo, self).__init__(**kwargs) + self.name = None + self.type = None + self.posix_compliant = None + + +class LoadBalancerConfig(msrest.serialization.Model): + """Load balancer configuration. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar type: Load balancer type. + :vartype type: str + :ivar version: Load balancer version. + :vartype version: str + """ + + _validation = { + 'type': {'readonly': True}, + 'version': {'readonly': True}, + } + + _attribute_map = { + 'type': {'key': 'type', 'type': 'str'}, + 'version': {'key': 'version', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(LoadBalancerConfig, self).__init__(**kwargs) + self.type = None + self.version = None + + +class MECRole(Role): + """MEC role. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: The path ID that uniquely identifies the object. + :vartype id: str + :ivar name: The object name. + :vartype name: str + :ivar type: The hierarchical type of the object. + :vartype type: str + :param kind: Required. Role type.Constant filled by server. Possible values include: "IOT", + "ASA", "Functions", "Cognitive", "MEC", "CloudEdgeManagement", "Kubernetes". + :type kind: str or ~azure.mgmt.databoxedge.v2020_09_01_preview.models.RoleTypes + :ivar system_data: Role configured on ASE resource. + :vartype system_data: ~azure.mgmt.databoxedge.v2020_09_01_preview.models.SystemData + :param connection_string: Activation key of the MEC. + :type connection_string: + ~azure.mgmt.databoxedge.v2020_09_01_preview.models.AsymmetricEncryptedSecret + :param role_status: Role status. Possible values include: "Enabled", "Disabled". + :type role_status: str or ~azure.mgmt.databoxedge.v2020_09_01_preview.models.RoleStatus + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'kind': {'required': True}, + 'system_data': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'connection_string': {'key': 'properties.connectionString', 'type': 'AsymmetricEncryptedSecret'}, + 'role_status': {'key': 'properties.roleStatus', 'type': 'str'}, + } + + def __init__( + self, + *, + connection_string: Optional["AsymmetricEncryptedSecret"] = None, + role_status: Optional[Union[str, "RoleStatus"]] = None, + **kwargs + ): + super(MECRole, self).__init__(**kwargs) + self.kind = 'MEC' # type: str + self.connection_string = connection_string + self.role_status = role_status + + +class MetricConfiguration(msrest.serialization.Model): + """Metric configuration. + + All required parameters must be populated in order to send to Azure. + + :param resource_id: Required. The Resource ID on which the metrics should be pushed. + :type resource_id: str + :param mdm_account: The MDM account to which the counters should be pushed. + :type mdm_account: str + :param metric_name_space: The MDM namespace to which the counters should be pushed. This is + required if MDMAccount is specified. + :type metric_name_space: str + :param counter_sets: Required. Host name for the IoT hub associated to the device. + :type counter_sets: list[~azure.mgmt.databoxedge.v2020_09_01_preview.models.MetricCounterSet] + """ + + _validation = { + 'resource_id': {'required': True}, + 'counter_sets': {'required': True}, + } + + _attribute_map = { + 'resource_id': {'key': 'resourceId', 'type': 'str'}, + 'mdm_account': {'key': 'mdmAccount', 'type': 'str'}, + 'metric_name_space': {'key': 'metricNameSpace', 'type': 'str'}, + 'counter_sets': {'key': 'counterSets', 'type': '[MetricCounterSet]'}, + } + + def __init__( + self, + *, + resource_id: str, + counter_sets: List["MetricCounterSet"], + mdm_account: Optional[str] = None, + metric_name_space: Optional[str] = None, + **kwargs + ): + super(MetricConfiguration, self).__init__(**kwargs) + self.resource_id = resource_id + self.mdm_account = mdm_account + self.metric_name_space = metric_name_space + self.counter_sets = counter_sets + + +class MetricCounter(msrest.serialization.Model): + """The metric counter. + + All required parameters must be populated in order to send to Azure. + + :param name: Required. The counter name. + :type name: str + :param instance: The instance from which counter should be collected. + :type instance: str + :param dimension_filter: The dimension filter. + :type dimension_filter: + list[~azure.mgmt.databoxedge.v2020_09_01_preview.models.MetricDimension] + :param additional_dimensions: The additional dimensions to be added to metric. + :type additional_dimensions: + list[~azure.mgmt.databoxedge.v2020_09_01_preview.models.MetricDimension] + """ + + _validation = { + 'name': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'instance': {'key': 'instance', 'type': 'str'}, + 'dimension_filter': {'key': 'dimensionFilter', 'type': '[MetricDimension]'}, + 'additional_dimensions': {'key': 'additionalDimensions', 'type': '[MetricDimension]'}, + } + + def __init__( + self, + *, + name: str, + instance: Optional[str] = None, + dimension_filter: Optional[List["MetricDimension"]] = None, + additional_dimensions: Optional[List["MetricDimension"]] = None, + **kwargs + ): + super(MetricCounter, self).__init__(**kwargs) + self.name = name + self.instance = instance + self.dimension_filter = dimension_filter + self.additional_dimensions = additional_dimensions + + +class MetricCounterSet(msrest.serialization.Model): + """The metric counter set. + + All required parameters must be populated in order to send to Azure. + + :param counters: Required. The counters that should be collected in this set. + :type counters: list[~azure.mgmt.databoxedge.v2020_09_01_preview.models.MetricCounter] + """ + + _validation = { + 'counters': {'required': True}, + } + + _attribute_map = { + 'counters': {'key': 'counters', 'type': '[MetricCounter]'}, + } + + def __init__( + self, + *, + counters: List["MetricCounter"], + **kwargs + ): + super(MetricCounterSet, self).__init__(**kwargs) + self.counters = counters + + +class MetricDimension(msrest.serialization.Model): + """The metric dimension. + + All required parameters must be populated in order to send to Azure. + + :param source_type: Required. The dimension type. + :type source_type: str + :param source_name: Required. The dimension value. + :type source_name: str + """ + + _validation = { + 'source_type': {'required': True}, + 'source_name': {'required': True}, + } + + _attribute_map = { + 'source_type': {'key': 'sourceType', 'type': 'str'}, + 'source_name': {'key': 'sourceName', 'type': 'str'}, + } + + def __init__( + self, + *, + source_type: str, + source_name: str, + **kwargs + ): + super(MetricDimension, self).__init__(**kwargs) + self.source_type = source_type + self.source_name = source_name + + +class MetricDimensionV1(msrest.serialization.Model): + """Metric Dimension v1. + + :param name: Name of the metrics dimension. + :type name: str + :param display_name: Display name of the metrics dimension. + :type display_name: str + :param to_be_exported_for_shoebox: To be exported to shoe box. + :type to_be_exported_for_shoebox: bool + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'display_name': {'key': 'displayName', 'type': 'str'}, + 'to_be_exported_for_shoebox': {'key': 'toBeExportedForShoebox', 'type': 'bool'}, + } + + def __init__( + self, + *, + name: Optional[str] = None, + display_name: Optional[str] = None, + to_be_exported_for_shoebox: Optional[bool] = None, + **kwargs + ): + super(MetricDimensionV1, self).__init__(**kwargs) + self.name = name + self.display_name = display_name + self.to_be_exported_for_shoebox = to_be_exported_for_shoebox + + +class MetricSpecificationV1(msrest.serialization.Model): + """Metric specification version 1. + + :param name: Name of the metric. + :type name: str + :param display_name: Display name of the metric. + :type display_name: str + :param display_description: Description of the metric to be displayed. + :type display_description: str + :param unit: Metric units. Possible values include: "NotSpecified", "Percent", "Count", + "Seconds", "Milliseconds", "Bytes", "BytesPerSecond", "CountPerSecond". + :type unit: str or ~azure.mgmt.databoxedge.v2020_09_01_preview.models.MetricUnit + :param aggregation_type: Metric aggregation type. Possible values include: "NotSpecified", + "None", "Average", "Minimum", "Maximum", "Total", "Count". + :type aggregation_type: str or + ~azure.mgmt.databoxedge.v2020_09_01_preview.models.MetricAggregationType + :param dimensions: Metric dimensions, other than default dimension which is resource. + :type dimensions: list[~azure.mgmt.databoxedge.v2020_09_01_preview.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 ~azure.mgmt.databoxedge.v2020_09_01_preview.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 + ~azure.mgmt.databoxedge.v2020_09_01_preview.models.TimeGrain] + :param supported_aggregation_types: Support metric aggregation type. + :type supported_aggregation_types: list[str or + ~azure.mgmt.databoxedge.v2020_09_01_preview.models.MetricAggregationType] + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'display_name': {'key': 'displayName', 'type': 'str'}, + 'display_description': {'key': 'displayDescription', 'type': 'str'}, + 'unit': {'key': 'unit', 'type': 'str'}, + 'aggregation_type': {'key': 'aggregationType', 'type': 'str'}, + 'dimensions': {'key': 'dimensions', 'type': '[MetricDimensionV1]'}, + 'fill_gap_with_zero': {'key': 'fillGapWithZero', 'type': 'bool'}, + 'category': {'key': 'category', 'type': 'str'}, + 'resource_id_dimension_name_override': {'key': 'resourceIdDimensionNameOverride', 'type': 'str'}, + 'supported_time_grain_types': {'key': 'supportedTimeGrainTypes', 'type': '[str]'}, + 'supported_aggregation_types': {'key': 'supportedAggregationTypes', 'type': '[str]'}, + } + + def __init__( + self, + *, + name: Optional[str] = None, + display_name: Optional[str] = None, + display_description: Optional[str] = None, + unit: Optional[Union[str, "MetricUnit"]] = None, + aggregation_type: Optional[Union[str, "MetricAggregationType"]] = None, + dimensions: Optional[List["MetricDimensionV1"]] = None, + fill_gap_with_zero: Optional[bool] = None, + category: Optional[Union[str, "MetricCategory"]] = None, + resource_id_dimension_name_override: Optional[str] = None, + supported_time_grain_types: Optional[List[Union[str, "TimeGrain"]]] = None, + supported_aggregation_types: Optional[List[Union[str, "MetricAggregationType"]]] = None, + **kwargs + ): + super(MetricSpecificationV1, self).__init__(**kwargs) + self.name = name + self.display_name = display_name + self.display_description = display_description + self.unit = unit + self.aggregation_type = aggregation_type + self.dimensions = dimensions + self.fill_gap_with_zero = fill_gap_with_zero + self.category = category + self.resource_id_dimension_name_override = resource_id_dimension_name_override + self.supported_time_grain_types = supported_time_grain_types + self.supported_aggregation_types = supported_aggregation_types + + +class MonitoringMetricConfiguration(ARMBaseModel): + """The metric setting details for the role. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: The path ID that uniquely identifies the object. + :vartype id: str + :ivar name: The object name. + :vartype name: str + :ivar type: The hierarchical type of the object. + :vartype type: str + :param metric_configurations: Required. The metrics configuration details. + :type metric_configurations: + list[~azure.mgmt.databoxedge.v2020_09_01_preview.models.MetricConfiguration] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'metric_configurations': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'metric_configurations': {'key': 'properties.metricConfigurations', 'type': '[MetricConfiguration]'}, + } + + def __init__( + self, + *, + metric_configurations: List["MetricConfiguration"], + **kwargs + ): + super(MonitoringMetricConfiguration, self).__init__(**kwargs) + self.metric_configurations = metric_configurations + + +class MonitoringMetricConfigurationList(msrest.serialization.Model): + """Collection of metric configurations. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar value: The list of metric configurations. + :vartype value: + list[~azure.mgmt.databoxedge.v2020_09_01_preview.models.MonitoringMetricConfiguration] + :ivar next_link: Link to the next set of results. + :vartype next_link: str + """ + + _validation = { + 'value': {'readonly': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[MonitoringMetricConfiguration]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(MonitoringMetricConfigurationList, self).__init__(**kwargs) + self.value = None + self.next_link = None + + +class MountPointMap(msrest.serialization.Model): + """The share mount point. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :param share_id: Required. ID of the share mounted to the role VM. + :type share_id: str + :ivar role_id: ID of the role to which share is mounted. + :vartype role_id: str + :ivar mount_point: Mount point for the share. + :vartype mount_point: str + :ivar mount_type: Mounting type. Possible values include: "Volume", "HostPath". + :vartype mount_type: str or ~azure.mgmt.databoxedge.v2020_09_01_preview.models.MountType + :ivar role_type: Role type. Possible values include: "IOT", "ASA", "Functions", "Cognitive", + "MEC", "CloudEdgeManagement", "Kubernetes". + :vartype role_type: str or ~azure.mgmt.databoxedge.v2020_09_01_preview.models.RoleTypes + """ + + _validation = { + 'share_id': {'required': True}, + 'role_id': {'readonly': True}, + 'mount_point': {'readonly': True}, + 'mount_type': {'readonly': True}, + 'role_type': {'readonly': True}, + } + + _attribute_map = { + 'share_id': {'key': 'shareId', 'type': 'str'}, + 'role_id': {'key': 'roleId', 'type': 'str'}, + 'mount_point': {'key': 'mountPoint', 'type': 'str'}, + 'mount_type': {'key': 'mountType', 'type': 'str'}, + 'role_type': {'key': 'roleType', 'type': 'str'}, + } + + def __init__( + self, + *, + share_id: str, + **kwargs + ): + super(MountPointMap, self).__init__(**kwargs) + self.share_id = share_id + self.role_id = None + self.mount_point = None + self.mount_type = None + self.role_type = None + + +class NetworkAdapter(msrest.serialization.Model): + """Represents the networkAdapter on a device. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar adapter_id: Instance ID of network adapter. + :vartype adapter_id: str + :ivar adapter_position: Hardware position of network adapter. + :vartype adapter_position: + ~azure.mgmt.databoxedge.v2020_09_01_preview.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 ~azure.mgmt.databoxedge.v2020_09_01_preview.models.NetworkAdapterStatus + :param rdma_status: Value indicating whether this adapter is RDMA capable. Possible values + include: "Incapable", "Capable". + :type rdma_status: str or + ~azure.mgmt.databoxedge.v2020_09_01_preview.models.NetworkAdapterRDMAStatus + :param dhcp_status: Value indicating whether this adapter has DHCP enabled. Possible values + include: "Disabled", "Enabled". + :type dhcp_status: str or + ~azure.mgmt.databoxedge.v2020_09_01_preview.models.NetworkAdapterDHCPStatus + :ivar ipv4_configuration: The IPv4 configuration of the network adapter. + :vartype ipv4_configuration: ~azure.mgmt.databoxedge.v2020_09_01_preview.models.Ipv4Config + :ivar ipv6_configuration: The IPv6 configuration of the network adapter. + :vartype ipv6_configuration: ~azure.mgmt.databoxedge.v2020_09_01_preview.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 ~azure.mgmt.databoxedge.v2020_09_01_preview.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[~azure.mgmt.databoxedge.v2020_09_01_preview.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 ~azure.mgmt.databoxedge.v2020_09_01_preview.models.NodeStatus + :ivar node_chassis_serial_number: Serial number of the Chassis. + :vartype node_chassis_serial_number: str + :ivar node_serial_number: Serial number of the individual node. + :vartype node_serial_number: str + :ivar node_display_name: Display Name of the individual node. + :vartype node_display_name: str + :ivar node_friendly_software_version: Friendly software version name that is currently + installed on the node. + :vartype node_friendly_software_version: str + :ivar node_hcs_version: HCS version that is currently installed on the node. + :vartype node_hcs_version: str + :ivar node_instance_id: Guid instance id of the node. + :vartype node_instance_id: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'node_status': {'readonly': True}, + 'node_chassis_serial_number': {'readonly': True}, + 'node_serial_number': {'readonly': True}, + 'node_display_name': {'readonly': True}, + 'node_friendly_software_version': {'readonly': True}, + 'node_hcs_version': {'readonly': True}, + 'node_instance_id': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'node_status': {'key': 'properties.nodeStatus', 'type': 'str'}, + 'node_chassis_serial_number': {'key': 'properties.nodeChassisSerialNumber', 'type': 'str'}, + 'node_serial_number': {'key': 'properties.nodeSerialNumber', 'type': 'str'}, + 'node_display_name': {'key': 'properties.nodeDisplayName', 'type': 'str'}, + 'node_friendly_software_version': {'key': 'properties.nodeFriendlySoftwareVersion', 'type': 'str'}, + 'node_hcs_version': {'key': 'properties.nodeHcsVersion', 'type': 'str'}, + 'node_instance_id': {'key': 'properties.nodeInstanceId', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(Node, self).__init__(**kwargs) + self.node_status = None + self.node_chassis_serial_number = None + self.node_serial_number = None + self.node_display_name = None + self.node_friendly_software_version = None + self.node_hcs_version = None + self.node_instance_id = None + + +class NodeInfo(msrest.serialization.Model): + """Kubernetes node info. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar name: Node name. + :vartype name: str + :ivar type: Node type - Master/Worker. Possible values include: "Invalid", "Master", "Worker". + :vartype type: str or ~azure.mgmt.databoxedge.v2020_09_01_preview.models.KubernetesNodeType + :param ip_configuration: IP Configuration of the Kubernetes node. + :type ip_configuration: + list[~azure.mgmt.databoxedge.v2020_09_01_preview.models.KubernetesIPConfiguration] + """ + + _validation = { + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'ip_configuration': {'key': 'ipConfiguration', 'type': '[KubernetesIPConfiguration]'}, + } + + def __init__( + self, + *, + ip_configuration: Optional[List["KubernetesIPConfiguration"]] = None, + **kwargs + ): + super(NodeInfo, self).__init__(**kwargs) + self.name = None + self.type = None + self.ip_configuration = ip_configuration + + +class NodeList(msrest.serialization.Model): + """Collection of Nodes. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar value: The list of Nodes. + :vartype value: list[~azure.mgmt.databoxedge.v2020_09_01_preview.models.Node] + :param next_link: Link to the next set of results. + :type next_link: str + """ + + _validation = { + 'value': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[Node]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + next_link: Optional[str] = None, + **kwargs + ): + super(NodeList, self).__init__(**kwargs) + self.value = None + self.next_link = next_link + + +class Operation(msrest.serialization.Model): + """Operations. + + :param name: Name of the operation. + :type name: str + :param display: Properties displayed for the operation. + :type display: ~azure.mgmt.databoxedge.v2020_09_01_preview.models.OperationDisplay + :param origin: Origin of the operation. + :type origin: str + :param is_data_action: Indicates whether the operation is a data action. + :type is_data_action: bool + :param service_specification: Service specification. + :type service_specification: + ~azure.mgmt.databoxedge.v2020_09_01_preview.models.ServiceSpecification + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'display': {'key': 'display', 'type': 'OperationDisplay'}, + 'origin': {'key': 'origin', 'type': 'str'}, + 'is_data_action': {'key': 'isDataAction', 'type': 'bool'}, + 'service_specification': {'key': 'properties.serviceSpecification', 'type': 'ServiceSpecification'}, + } + + def __init__( + self, + *, + name: Optional[str] = None, + display: Optional["OperationDisplay"] = None, + origin: Optional[str] = None, + is_data_action: Optional[bool] = None, + service_specification: Optional["ServiceSpecification"] = None, + **kwargs + ): + super(Operation, self).__init__(**kwargs) + self.name = name + self.display = display + self.origin = origin + self.is_data_action = is_data_action + 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[~azure.mgmt.databoxedge.v2020_09_01_preview.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: ~azure.mgmt.databoxedge.v2020_09_01_preview.models.ContactDetails + :param shipping_address: The shipping address. + :type shipping_address: ~azure.mgmt.databoxedge.v2020_09_01_preview.models.Address + :ivar current_status: Current status of the order. + :vartype current_status: ~azure.mgmt.databoxedge.v2020_09_01_preview.models.OrderStatus + :ivar order_history: List of status changes in the order. + :vartype order_history: list[~azure.mgmt.databoxedge.v2020_09_01_preview.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[~azure.mgmt.databoxedge.v2020_09_01_preview.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[~azure.mgmt.databoxedge.v2020_09_01_preview.models.TrackingInfo] + :param shipment_type: ShipmentType of the order. Possible values include: "NotApplicable", + "ShippedToCustomer", "SelfPickup". + :type shipment_type: str or ~azure.mgmt.databoxedge.v2020_09_01_preview.models.ShipmentType + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'current_status': {'readonly': True}, + 'order_history': {'readonly': True}, + 'serial_number': {'readonly': True}, + 'delivery_tracking_info': {'readonly': True}, + 'return_tracking_info': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'contact_information': {'key': 'properties.contactInformation', 'type': 'ContactDetails'}, + 'shipping_address': {'key': 'properties.shippingAddress', 'type': 'Address'}, + 'current_status': {'key': 'properties.currentStatus', 'type': 'OrderStatus'}, + 'order_history': {'key': 'properties.orderHistory', 'type': '[OrderStatus]'}, + 'serial_number': {'key': 'properties.serialNumber', 'type': 'str'}, + 'delivery_tracking_info': {'key': 'properties.deliveryTrackingInfo', 'type': '[TrackingInfo]'}, + 'return_tracking_info': {'key': 'properties.returnTrackingInfo', 'type': '[TrackingInfo]'}, + 'shipment_type': {'key': 'properties.shipmentType', 'type': 'str'}, + } + + def __init__( + self, + *, + contact_information: Optional["ContactDetails"] = None, + shipping_address: Optional["Address"] = None, + shipment_type: Optional[Union[str, "ShipmentType"]] = None, + **kwargs + ): + super(Order, self).__init__(**kwargs) + self.contact_information = contact_information + self.shipping_address = shipping_address + self.current_status = None + self.order_history = None + self.serial_number = None + self.delivery_tracking_info = None + self.return_tracking_info = None + self.shipment_type = shipment_type + + +class OrderList(msrest.serialization.Model): + """List of order entities. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar value: The list of orders. + :vartype value: list[~azure.mgmt.databoxedge.v2020_09_01_preview.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", + "AwaitingPickup", "PickupCompleted", "AwaitingDrop". + :type status: str or ~azure.mgmt.databoxedge.v2020_09_01_preview.models.OrderState + :ivar update_date_time: Time of status update. + :vartype update_date_time: ~datetime.datetime + :param comments: Comments related to this status change. + :type comments: str + :ivar tracking_information: Tracking information related to the state in the ordering flow. + :vartype tracking_information: ~azure.mgmt.databoxedge.v2020_09_01_preview.models.TrackingInfo + :ivar additional_order_details: Dictionary to hold generic information which is not stored + by the already existing properties. + :vartype additional_order_details: dict[str, str] + """ + + _validation = { + 'status': {'required': True}, + 'update_date_time': {'readonly': True}, + 'tracking_information': {'readonly': True}, + 'additional_order_details': {'readonly': True}, + } + + _attribute_map = { + 'status': {'key': 'status', 'type': 'str'}, + 'update_date_time': {'key': 'updateDateTime', 'type': 'iso-8601'}, + 'comments': {'key': 'comments', 'type': 'str'}, + 'tracking_information': {'key': 'trackingInformation', 'type': 'TrackingInfo'}, + 'additional_order_details': {'key': 'additionalOrderDetails', 'type': '{str}'}, + } + + def __init__( + self, + *, + status: Union[str, "OrderState"], + comments: Optional[str] = None, + **kwargs + ): + super(OrderStatus, self).__init__(**kwargs) + self.status = status + self.update_date_time = None + self.comments = comments + self.tracking_information = None + self.additional_order_details = None + + +class PeriodicTimerEventTrigger(Trigger): + """Trigger details. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: The path ID that uniquely identifies the object. + :vartype id: str + :ivar name: The object name. + :vartype name: str + :ivar type: The hierarchical type of the object. + :vartype type: str + :ivar system_data: Trigger in DataBoxEdge Resource. + :vartype system_data: ~azure.mgmt.databoxedge.v2020_09_01_preview.models.SystemData + :param kind: Required. Trigger Kind.Constant filled by server. Possible values include: + "FileEvent", "PeriodicTimerEvent". + :type kind: str or ~azure.mgmt.databoxedge.v2020_09_01_preview.models.TriggerEventType + :param source_info: Required. Periodic timer details. + :type source_info: ~azure.mgmt.databoxedge.v2020_09_01_preview.models.PeriodicTimerSourceInfo + :param sink_info: Required. Role Sink information. + :type sink_info: ~azure.mgmt.databoxedge.v2020_09_01_preview.models.RoleSinkInfo + :param custom_context_tag: A custom context tag typically used to correlate the trigger against + its usage. For example, if a periodic timer trigger is intended for certain specific IoT + modules in the device, the tag can be the name or the image URL of the module. + :type custom_context_tag: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'system_data': {'readonly': True}, + 'kind': {'required': True}, + 'source_info': {'required': True}, + 'sink_info': {'required': True}, + 'custom_context_tag': {'max_length': 192, 'min_length': 0}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'source_info': {'key': 'properties.sourceInfo', 'type': 'PeriodicTimerSourceInfo'}, + 'sink_info': {'key': 'properties.sinkInfo', 'type': 'RoleSinkInfo'}, + 'custom_context_tag': {'key': 'properties.customContextTag', 'type': 'str'}, + } + + def __init__( + self, + *, + source_info: "PeriodicTimerSourceInfo", + sink_info: "RoleSinkInfo", + custom_context_tag: Optional[str] = None, + **kwargs + ): + super(PeriodicTimerEventTrigger, self).__init__(**kwargs) + self.kind = 'PeriodicTimerEvent' # type: str + self.source_info = source_info + self.sink_info = sink_info + self.custom_context_tag = custom_context_tag + + +class PeriodicTimerSourceInfo(msrest.serialization.Model): + """Periodic timer event source. + + All required parameters must be populated in order to send to Azure. + + :param start_time: Required. The time of the day that results in a valid trigger. Schedule is + computed with reference to the time specified upto seconds. If timezone is not specified the + time will considered to be in device timezone. The value will always be returned as UTC time. + :type start_time: ~datetime.datetime + :param schedule: Required. Periodic frequency at which timer event needs to be raised. Supports + daily, hourly, minutes, and seconds. + :type schedule: str + :param topic: Topic where periodic events are published to IoT device. + :type topic: str + """ + + _validation = { + 'start_time': {'required': True}, + 'schedule': {'required': True}, + } + + _attribute_map = { + 'start_time': {'key': 'startTime', 'type': 'iso-8601'}, + 'schedule': {'key': 'schedule', 'type': 'str'}, + 'topic': {'key': 'topic', 'type': 'str'}, + } + + def __init__( + self, + *, + start_time: datetime.datetime, + schedule: str, + topic: Optional[str] = None, + **kwargs + ): + super(PeriodicTimerSourceInfo, self).__init__(**kwargs) + self.start_time = start_time + self.schedule = schedule + self.topic = topic + + +class RefreshDetails(msrest.serialization.Model): + """Fields for tracking refresh job on the share or container. + + :param in_progress_refresh_job_id: If a refresh job is currently in progress on this share or + container, this field indicates the ARM resource ID of that job. The field is empty if no job + is in progress. + :type in_progress_refresh_job_id: str + :param last_completed_refresh_job_time_in_utc: Indicates the completed time for the last + refresh job on this particular share or container, if any.This could be a failed job or a + successful job. + :type last_completed_refresh_job_time_in_utc: ~datetime.datetime + :param error_manifest_file: Indicates the relative path of the error xml for the last refresh + job on this particular share or container, if any. This could be a failed job or a successful + job. + :type error_manifest_file: str + :param last_job: Indicates the id of the last refresh job on this particular share or + container,if any. This could be a failed job or a successful job. + :type last_job: str + """ + + _attribute_map = { + 'in_progress_refresh_job_id': {'key': 'inProgressRefreshJobId', 'type': 'str'}, + 'last_completed_refresh_job_time_in_utc': {'key': 'lastCompletedRefreshJobTimeInUTC', 'type': 'iso-8601'}, + 'error_manifest_file': {'key': 'errorManifestFile', 'type': 'str'}, + 'last_job': {'key': 'lastJob', 'type': 'str'}, + } + + def __init__( + self, + *, + in_progress_refresh_job_id: Optional[str] = None, + last_completed_refresh_job_time_in_utc: Optional[datetime.datetime] = None, + error_manifest_file: Optional[str] = None, + last_job: Optional[str] = None, + **kwargs + ): + super(RefreshDetails, self).__init__(**kwargs) + self.in_progress_refresh_job_id = in_progress_refresh_job_id + self.last_completed_refresh_job_time_in_utc = last_completed_refresh_job_time_in_utc + self.error_manifest_file = error_manifest_file + self.last_job = last_job + + +class ResourceIdentity(msrest.serialization.Model): + """Msi identity details of the resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param type: Identity type. Possible values include: "None", "SystemAssigned", "UserAssigned". + :type type: str or ~azure.mgmt.databoxedge.v2020_09_01_preview.models.MsiIdentityType + :ivar principal_id: Service Principal Id backing the Msi. + :vartype principal_id: str + :ivar tenant_id: Home Tenant Id. + :vartype tenant_id: str + """ + + _validation = { + 'principal_id': {'readonly': True}, + 'tenant_id': {'readonly': True}, + } + + _attribute_map = { + 'type': {'key': 'type', 'type': 'str'}, + 'principal_id': {'key': 'principalId', 'type': 'str'}, + 'tenant_id': {'key': 'tenantId', 'type': 'str'}, + } + + def __init__( + self, + *, + type: Optional[Union[str, "MsiIdentityType"]] = None, + **kwargs + ): + super(ResourceIdentity, self).__init__(**kwargs) + self.type = type + self.principal_id = None + self.tenant_id = None + + +class ResourceMoveDetails(msrest.serialization.Model): + """Fields for tracking resource move. + + :param operation_in_progress: Denotes whether move operation is in progress. Possible values + include: "None", "ResourceMoveInProgress", "ResourceMoveFailed". + :type operation_in_progress: str or + ~azure.mgmt.databoxedge.v2020_09_01_preview.models.ResourceMoveStatus + :param operation_in_progress_lock_timeout_in_utc: Denotes the timeout of the operation to + finish. + :type operation_in_progress_lock_timeout_in_utc: ~datetime.datetime + """ + + _attribute_map = { + 'operation_in_progress': {'key': 'operationInProgress', 'type': 'str'}, + 'operation_in_progress_lock_timeout_in_utc': {'key': 'operationInProgressLockTimeoutInUTC', 'type': 'iso-8601'}, + } + + def __init__( + self, + *, + operation_in_progress: Optional[Union[str, "ResourceMoveStatus"]] = None, + operation_in_progress_lock_timeout_in_utc: Optional[datetime.datetime] = None, + **kwargs + ): + super(ResourceMoveDetails, self).__init__(**kwargs) + self.operation_in_progress = operation_in_progress + self.operation_in_progress_lock_timeout_in_utc = operation_in_progress_lock_timeout_in_utc + + +class ResourceTypeSku(msrest.serialization.Model): + """Resource type Sku object. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar resource_type: The resource type. + :vartype resource_type: str + :ivar skus: The skus. + :vartype skus: list[~azure.mgmt.databoxedge.v2020_09_01_preview.models.SkuInformation] + """ + + _validation = { + 'resource_type': {'readonly': True}, + 'skus': {'readonly': True}, + } + + _attribute_map = { + 'resource_type': {'key': 'resourceType', 'type': 'str'}, + 'skus': {'key': 'skus', 'type': '[SkuInformation]'}, + } + + def __init__( + self, + **kwargs + ): + super(ResourceTypeSku, self).__init__(**kwargs) + self.resource_type = None + self.skus = None + + +class RoleList(msrest.serialization.Model): + """Collection of all the roles on the Data Box Edge device. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar value: The Value. + :vartype value: list[~azure.mgmt.databoxedge.v2020_09_01_preview.models.Role] + :ivar next_link: Link to the next set of results. + :vartype next_link: str + """ + + _validation = { + 'value': {'readonly': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[Role]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(RoleList, self).__init__(**kwargs) + self.value = None + self.next_link = None + + +class RoleSinkInfo(msrest.serialization.Model): + """Compute role against which events will be raised. + + All required parameters must be populated in order to send to Azure. + + :param role_id: Required. Compute role ID. + :type role_id: str + """ + + _validation = { + 'role_id': {'required': True}, + } + + _attribute_map = { + 'role_id': {'key': 'roleId', 'type': 'str'}, + } + + def __init__( + self, + *, + role_id: str, + **kwargs + ): + super(RoleSinkInfo, self).__init__(**kwargs) + self.role_id = role_id + + +class 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: + ~azure.mgmt.databoxedge.v2020_09_01_preview.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[~azure.mgmt.databoxedge.v2020_09_01_preview.models.MetricSpecificationV1] + """ + + _attribute_map = { + 'metric_specifications': {'key': 'metricSpecifications', 'type': '[MetricSpecificationV1]'}, + } + + def __init__( + self, + *, + metric_specifications: Optional[List["MetricSpecificationV1"]] = None, + **kwargs + ): + super(ServiceSpecification, self).__init__(**kwargs) + self.metric_specifications = metric_specifications + + +class Share(ARMBaseModel): + """Represents a share on the Data Box Edge/Gateway device. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: The path ID that uniquely identifies the object. + :vartype id: str + :ivar name: The object name. + :vartype name: str + :ivar type: The hierarchical type of the object. + :vartype type: str + :ivar system_data: Share on ASE device. + :vartype system_data: ~azure.mgmt.databoxedge.v2020_09_01_preview.models.SystemData + :param description: Description for the share. + :type description: str + :param share_status: Required. Current status of the share. Possible values include: "Offline", + "Unknown", "OK", "Updating", "NeedsAttention". + :type share_status: str or ~azure.mgmt.databoxedge.v2020_09_01_preview.models.ShareStatus + :param monitoring_status: Required. Current monitoring status of the share. Possible values + include: "Enabled", "Disabled". + :type monitoring_status: str or + ~azure.mgmt.databoxedge.v2020_09_01_preview.models.MonitoringStatus + :param azure_container_info: Azure container mapping for the share. + :type azure_container_info: + ~azure.mgmt.databoxedge.v2020_09_01_preview.models.AzureContainerInfo + :param access_protocol: Required. Access protocol to be used by the share. Possible values + include: "SMB", "NFS". + :type access_protocol: str or + ~azure.mgmt.databoxedge.v2020_09_01_preview.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[~azure.mgmt.databoxedge.v2020_09_01_preview.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[~azure.mgmt.databoxedge.v2020_09_01_preview.models.ClientAccessRight] + :param refresh_details: Details of the refresh job on this share. + :type refresh_details: ~azure.mgmt.databoxedge.v2020_09_01_preview.models.RefreshDetails + :ivar share_mappings: Share mount point to the role. + :vartype share_mappings: list[~azure.mgmt.databoxedge.v2020_09_01_preview.models.MountPointMap] + :param data_policy: Data policy of the share. Possible values include: "Cloud", "Local". + :type data_policy: str or ~azure.mgmt.databoxedge.v2020_09_01_preview.models.DataPolicy + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'system_data': {'readonly': True}, + 'share_status': {'required': True}, + 'monitoring_status': {'required': True}, + 'access_protocol': {'required': True}, + 'share_mappings': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + 'share_status': {'key': 'properties.shareStatus', 'type': 'str'}, + 'monitoring_status': {'key': 'properties.monitoringStatus', 'type': 'str'}, + 'azure_container_info': {'key': 'properties.azureContainerInfo', 'type': 'AzureContainerInfo'}, + 'access_protocol': {'key': 'properties.accessProtocol', 'type': 'str'}, + 'user_access_rights': {'key': 'properties.userAccessRights', 'type': '[UserAccessRight]'}, + 'client_access_rights': {'key': 'properties.clientAccessRights', 'type': '[ClientAccessRight]'}, + 'refresh_details': {'key': 'properties.refreshDetails', 'type': 'RefreshDetails'}, + 'share_mappings': {'key': 'properties.shareMappings', 'type': '[MountPointMap]'}, + 'data_policy': {'key': 'properties.dataPolicy', 'type': 'str'}, + } + + def __init__( + self, + *, + share_status: Union[str, "ShareStatus"], + monitoring_status: Union[str, "MonitoringStatus"], + access_protocol: Union[str, "ShareAccessProtocol"], + description: Optional[str] = None, + azure_container_info: Optional["AzureContainerInfo"] = None, + user_access_rights: Optional[List["UserAccessRight"]] = None, + client_access_rights: Optional[List["ClientAccessRight"]] = None, + refresh_details: Optional["RefreshDetails"] = None, + data_policy: Optional[Union[str, "DataPolicy"]] = None, + **kwargs + ): + super(Share, self).__init__(**kwargs) + self.system_data = None + self.description = description + self.share_status = share_status + self.monitoring_status = monitoring_status + self.azure_container_info = azure_container_info + self.access_protocol = access_protocol + self.user_access_rights = user_access_rights + self.client_access_rights = client_access_rights + self.refresh_details = refresh_details + self.share_mappings = None + self.data_policy = data_policy + + +class ShareAccessRight(msrest.serialization.Model): + """Specifies the mapping between this particular user and the type of access he has on shares on this device. + + All required parameters must be populated in order to send to Azure. + + :param share_id: Required. The share ID. + :type share_id: str + :param access_type: Required. Type of access to be allowed on the share for this user. Possible + values include: "Change", "Read", "Custom". + :type access_type: str or ~azure.mgmt.databoxedge.v2020_09_01_preview.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[~azure.mgmt.databoxedge.v2020_09_01_preview.models.Share] + :ivar next_link: Link to the next set of results. + :vartype next_link: str + """ + + _validation = { + 'value': {'readonly': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[Share]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ShareList, self).__init__(**kwargs) + self.value = None + self.next_link = None + + +class Sku(msrest.serialization.Model): + """The SKU type. + + :param name: SKU name. Possible values include: "Gateway", "Edge", "TEA_1Node", + "TEA_1Node_UPS", "TEA_1Node_Heater", "TEA_1Node_UPS_Heater", "TEA_4Node_Heater", + "TEA_4Node_UPS_Heater", "TMA", "TDC", "TCA_Small", "GPU", "TCA_Large", "EdgeP_Base", + "EdgeP_High", "EdgePR_Base", "EdgePR_Base_UPS", "EdgeMR_Mini", "RCA_Small", "RCA_Large", "RDC". + :type name: str or ~azure.mgmt.databoxedge.v2020_09_01_preview.models.SkuName + :param tier: The SKU tier. This is based on the SKU name. Possible values include: "Standard". + :type tier: str or ~azure.mgmt.databoxedge.v2020_09_01_preview.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: The extended unit. + :vartype extended_unit: str + """ + + _validation = { + 'meter_id': {'readonly': True}, + 'quantity': {'readonly': True}, + 'extended_unit': {'readonly': True}, + } + + _attribute_map = { + 'meter_id': {'key': 'meterId', 'type': 'str'}, + 'quantity': {'key': 'quantity', 'type': 'long'}, + 'extended_unit': {'key': 'extendedUnit', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(SkuCost, self).__init__(**kwargs) + self.meter_id = None + self.quantity = None + self.extended_unit = None + + +class SkuInformation(msrest.serialization.Model): + """Sku information. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar name: The sku name. + :vartype name: str + :ivar tier: The sku tier. + :vartype tier: str + :ivar kind: The sku kind. + :vartype kind: str + :ivar family: The Sku family. + :vartype family: str + :ivar costs: The pricing info of the Sku. + :vartype costs: list[~azure.mgmt.databoxedge.v2020_09_01_preview.models.SkuCost] + :ivar locations: The locations where Sku is available. + :vartype locations: list[str] + :ivar location_info: The locations where Sku is available with zones and sites info. + :vartype location_info: + list[~azure.mgmt.databoxedge.v2020_09_01_preview.models.SkuLocationInfo] + :ivar required_quota_ids: The required quotaIds for the sku to be available. + :vartype required_quota_ids: list[str] + :ivar required_features: The required features for the sku to be available. + :vartype required_features: list[str] + """ + + _validation = { + 'name': {'readonly': True}, + 'tier': {'readonly': True}, + 'kind': {'readonly': True}, + 'family': {'readonly': True}, + 'costs': {'readonly': True}, + 'locations': {'readonly': True}, + 'location_info': {'readonly': True}, + 'required_quota_ids': {'readonly': True}, + 'required_features': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'tier': {'key': 'tier', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'family': {'key': 'family', 'type': 'str'}, + 'costs': {'key': 'costs', 'type': '[SkuCost]'}, + 'locations': {'key': 'locations', 'type': '[str]'}, + 'location_info': {'key': 'locationInfo', 'type': '[SkuLocationInfo]'}, + 'required_quota_ids': {'key': 'requiredQuotaIds', 'type': '[str]'}, + 'required_features': {'key': 'requiredFeatures', 'type': '[str]'}, + } + + def __init__( + self, + **kwargs + ): + super(SkuInformation, self).__init__(**kwargs) + self.name = None + self.tier = None + self.kind = None + self.family = None + self.costs = None + self.locations = None + self.location_info = None + self.required_quota_ids = None + self.required_features = None + + +class SkuInformationList(msrest.serialization.Model): + """List of SKU Information objects. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar value: List of ResourceTypeSku objects. + :vartype value: list[~azure.mgmt.databoxedge.v2020_09_01_preview.models.ResourceTypeSku] + :ivar next_link: Links to the next set of results. + :vartype next_link: str + """ + + _validation = { + 'value': {'readonly': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[ResourceTypeSku]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(SkuInformationList, self).__init__(**kwargs) + self.value = None + self.next_link = None + + +class SkuLocationInfo(msrest.serialization.Model): + """The location info. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar location: The location. + :vartype location: str + :ivar zones: The zones. + :vartype zones: list[str] + :ivar sites: The sites. + :vartype sites: list[str] + """ + + _validation = { + 'location': {'readonly': True}, + 'zones': {'readonly': True}, + 'sites': {'readonly': True}, + } + + _attribute_map = { + 'location': {'key': 'location', 'type': 'str'}, + 'zones': {'key': 'zones', 'type': '[str]'}, + 'sites': {'key': 'sites', 'type': '[str]'}, + } + + def __init__( + self, + **kwargs + ): + super(SkuLocationInfo, self).__init__(**kwargs) + self.location = None + self.zones = None + self.sites = None + + +class StorageAccount(ARMBaseModel): + """Represents a Storage Account on the Data Box Edge/Gateway device. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: The path ID that uniquely identifies the object. + :vartype id: str + :ivar name: The object name. + :vartype name: str + :ivar type: The hierarchical type of the object. + :vartype type: str + :ivar system_data: StorageAccount object on ASE device. + :vartype system_data: ~azure.mgmt.databoxedge.v2020_09_01_preview.models.SystemData + :param description: Description for the storage Account. + :type description: str + :param storage_account_status: Current status of the storage account. Possible values include: + "OK", "Offline", "Unknown", "Updating", "NeedsAttention". + :type storage_account_status: str or + ~azure.mgmt.databoxedge.v2020_09_01_preview.models.StorageAccountStatus + :param data_policy: Required. Data policy of the storage Account. Possible values include: + "Cloud", "Local". + :type data_policy: str or ~azure.mgmt.databoxedge.v2020_09_01_preview.models.DataPolicy + :param storage_account_credential_id: Storage Account Credential Id. + :type storage_account_credential_id: str + :ivar blob_endpoint: BlobEndpoint of Storage Account. + :vartype blob_endpoint: str + :ivar container_count: The Container Count. Present only for Storage Accounts with DataPolicy + set to Cloud. + :vartype container_count: int + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'system_data': {'readonly': True}, + 'data_policy': {'required': True}, + 'blob_endpoint': {'readonly': True}, + 'container_count': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + 'storage_account_status': {'key': 'properties.storageAccountStatus', 'type': 'str'}, + 'data_policy': {'key': 'properties.dataPolicy', 'type': 'str'}, + 'storage_account_credential_id': {'key': 'properties.storageAccountCredentialId', 'type': 'str'}, + 'blob_endpoint': {'key': 'properties.blobEndpoint', 'type': 'str'}, + 'container_count': {'key': 'properties.containerCount', 'type': 'int'}, + } + + def __init__( + self, + *, + data_policy: Union[str, "DataPolicy"], + description: Optional[str] = None, + storage_account_status: Optional[Union[str, "StorageAccountStatus"]] = None, + storage_account_credential_id: Optional[str] = None, + **kwargs + ): + super(StorageAccount, self).__init__(**kwargs) + self.system_data = None + self.description = description + self.storage_account_status = storage_account_status + self.data_policy = data_policy + self.storage_account_credential_id = storage_account_credential_id + self.blob_endpoint = None + self.container_count = None + + +class StorageAccountCredential(ARMBaseModel): + """The storage account credential. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: The path ID that uniquely identifies the object. + :vartype id: str + :ivar name: The object name. + :vartype name: str + :ivar type: The hierarchical type of the object. + :vartype type: str + :ivar system_data: StorageAccountCredential object. + :vartype system_data: ~azure.mgmt.databoxedge.v2020_09_01_preview.models.SystemData + :param alias: Required. Alias for the storage account. + :type alias: str + :param user_name: Username for the storage account. + :type user_name: str + :param account_key: Encrypted storage key. + :type account_key: ~azure.mgmt.databoxedge.v2020_09_01_preview.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 ~azure.mgmt.databoxedge.v2020_09_01_preview.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 ~azure.mgmt.databoxedge.v2020_09_01_preview.models.AccountType + :param storage_account_id: Id of the storage account. + :type storage_account_id: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'system_data': {'readonly': True}, + 'alias': {'required': True}, + 'ssl_status': {'required': True}, + 'account_type': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'alias': {'key': 'properties.alias', 'type': 'str'}, + 'user_name': {'key': 'properties.userName', 'type': 'str'}, + 'account_key': {'key': 'properties.accountKey', 'type': 'AsymmetricEncryptedSecret'}, + 'connection_string': {'key': 'properties.connectionString', 'type': 'str'}, + 'ssl_status': {'key': 'properties.sslStatus', 'type': 'str'}, + 'blob_domain_name': {'key': 'properties.blobDomainName', 'type': 'str'}, + 'account_type': {'key': 'properties.accountType', 'type': 'str'}, + 'storage_account_id': {'key': 'properties.storageAccountId', 'type': 'str'}, + } + + def __init__( + self, + *, + alias: str, + ssl_status: Union[str, "SSLStatus"], + account_type: Union[str, "AccountType"], + user_name: Optional[str] = None, + account_key: Optional["AsymmetricEncryptedSecret"] = None, + connection_string: Optional[str] = None, + blob_domain_name: Optional[str] = None, + storage_account_id: Optional[str] = None, + **kwargs + ): + super(StorageAccountCredential, self).__init__(**kwargs) + self.system_data = None + self.alias = alias + self.user_name = user_name + self.account_key = account_key + self.connection_string = connection_string + self.ssl_status = ssl_status + self.blob_domain_name = blob_domain_name + self.account_type = account_type + self.storage_account_id = storage_account_id + + +class StorageAccountCredentialList(msrest.serialization.Model): + """The collection of storage account credentials. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar value: The value. + :vartype value: + list[~azure.mgmt.databoxedge.v2020_09_01_preview.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[~azure.mgmt.databoxedge.v2020_09_01_preview.models.StorageAccount] + :ivar next_link: Link to the next set of results. + :vartype next_link: str + """ + + _validation = { + 'value': {'readonly': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[StorageAccount]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(StorageAccountList, self).__init__(**kwargs) + self.value = None + self.next_link = None + + +class SubscriptionRegisteredFeatures(msrest.serialization.Model): + """SubscriptionRegisteredFeatures. + + :param name: + :type name: str + :param state: + :type state: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'state': {'key': 'state', 'type': 'str'}, + } + + def __init__( + self, + *, + name: Optional[str] = None, + state: Optional[str] = None, + **kwargs + ): + super(SubscriptionRegisteredFeatures, self).__init__(**kwargs) + self.name = name + self.state = state + + +class SymmetricKey(msrest.serialization.Model): + """Symmetric key for authentication. + + :param connection_string: Connection string based on the symmetric key. + :type connection_string: + ~azure.mgmt.databoxedge.v2020_09_01_preview.models.AsymmetricEncryptedSecret + """ + + _attribute_map = { + 'connection_string': {'key': 'connectionString', 'type': 'AsymmetricEncryptedSecret'}, + } + + def __init__( + self, + *, + connection_string: Optional["AsymmetricEncryptedSecret"] = None, + **kwargs + ): + super(SymmetricKey, self).__init__(**kwargs) + self.connection_string = connection_string + + +class SystemData(msrest.serialization.Model): + """Metadata pertaining to creation and last modification of the resource. + + :param created_by: The identity that created the resource. + :type created_by: str + :param created_by_type: The type of identity that created the resource. Possible values + include: "User", "Application", "ManagedIdentity", "Key". + :type created_by_type: str or ~azure.mgmt.databoxedge.v2020_09_01_preview.models.CreatedByType + :param created_at: The timestamp of resource creation (UTC). + :type created_at: ~datetime.datetime + :param last_modified_by: The identity that last modified the resource. + :type last_modified_by: str + :param last_modified_by_type: The type of identity that last modified the resource. Possible + values include: "User", "Application", "ManagedIdentity", "Key". + :type last_modified_by_type: str or + ~azure.mgmt.databoxedge.v2020_09_01_preview.models.CreatedByType + :param last_modified_at: The type of identity that last modified the resource. + :type last_modified_at: ~datetime.datetime + """ + + _attribute_map = { + 'created_by': {'key': 'createdBy', 'type': 'str'}, + 'created_by_type': {'key': 'createdByType', 'type': 'str'}, + 'created_at': {'key': 'createdAt', 'type': 'iso-8601'}, + 'last_modified_by': {'key': 'lastModifiedBy', 'type': 'str'}, + 'last_modified_by_type': {'key': 'lastModifiedByType', 'type': 'str'}, + 'last_modified_at': {'key': 'lastModifiedAt', 'type': 'iso-8601'}, + } + + def __init__( + self, + *, + created_by: Optional[str] = None, + created_by_type: Optional[Union[str, "CreatedByType"]] = None, + created_at: Optional[datetime.datetime] = None, + last_modified_by: Optional[str] = None, + last_modified_by_type: Optional[Union[str, "CreatedByType"]] = None, + last_modified_at: Optional[datetime.datetime] = None, + **kwargs + ): + super(SystemData, self).__init__(**kwargs) + self.created_by = created_by + self.created_by_type = created_by_type + self.created_at = created_at + self.last_modified_by = last_modified_by + self.last_modified_by_type = last_modified_by_type + self.last_modified_at = last_modified_at + + +class TrackingInfo(msrest.serialization.Model): + """Tracking courier information. + + :param serial_number: Serial number of the device being tracked. + :type serial_number: str + :param carrier_name: Name of the carrier used in the delivery. + :type carrier_name: str + :param tracking_id: Tracking ID of the shipment. + :type tracking_id: str + :param tracking_url: Tracking URL of the shipment. + :type tracking_url: str + """ + + _attribute_map = { + 'serial_number': {'key': 'serialNumber', 'type': 'str'}, + 'carrier_name': {'key': 'carrierName', 'type': 'str'}, + 'tracking_id': {'key': 'trackingId', 'type': 'str'}, + 'tracking_url': {'key': 'trackingUrl', 'type': 'str'}, + } + + def __init__( + self, + *, + serial_number: Optional[str] = None, + carrier_name: Optional[str] = None, + tracking_id: Optional[str] = None, + tracking_url: Optional[str] = None, + **kwargs + ): + super(TrackingInfo, self).__init__(**kwargs) + self.serial_number = serial_number + self.carrier_name = carrier_name + self.tracking_id = tracking_id + self.tracking_url = tracking_url + + +class TriggerList(msrest.serialization.Model): + """Collection of all trigger on the data box edge device. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar value: The list of triggers. + :vartype value: list[~azure.mgmt.databoxedge.v2020_09_01_preview.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 + ~azure.mgmt.databoxedge.v2020_09_01_preview.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 + ~azure.mgmt.databoxedge.v2020_09_01_preview.models.InstallRebootBehavior + :ivar ongoing_update_operation: The current update operation. Possible values include: "None", + "Scan", "Download", "Install". + :vartype ongoing_update_operation: str or + ~azure.mgmt.databoxedge.v2020_09_01_preview.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 + ~azure.mgmt.databoxedge.v2020_09_01_preview.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 ~azure.mgmt.databoxedge.v2020_09_01_preview.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. + + :ivar id: The path ID that uniquely identifies the object. + :vartype id: str + :ivar name: The object name. + :vartype name: str + :ivar type: The hierarchical type of the object. + :vartype type: str + :ivar system_data: User in DataBoxEdge Resource. + :vartype system_data: ~azure.mgmt.databoxedge.v2020_09_01_preview.models.SystemData + :param encrypted_password: The password details. + :type encrypted_password: + ~azure.mgmt.databoxedge.v2020_09_01_preview.models.AsymmetricEncryptedSecret + :ivar share_access_rights: List of shares that the user has rights on. This field should not be + specified during user creation. + :vartype share_access_rights: + list[~azure.mgmt.databoxedge.v2020_09_01_preview.models.ShareAccessRight] + :param user_type: Type of the user. Possible values include: "Share", "LocalManagement", "ARM". + :type user_type: str or ~azure.mgmt.databoxedge.v2020_09_01_preview.models.UserType + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'system_data': {'readonly': True}, + 'share_access_rights': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + '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, + *, + encrypted_password: Optional["AsymmetricEncryptedSecret"] = None, + user_type: Optional[Union[str, "UserType"]] = None, + **kwargs + ): + super(User, self).__init__(**kwargs) + self.system_data = None + self.encrypted_password = encrypted_password + self.share_access_rights = None + self.user_type = user_type + + +class UserAccessRight(msrest.serialization.Model): + """The mapping between a particular user and the access type on the SMB share. + + All required parameters must be populated in order to send to Azure. + + :param user_id: Required. User ID (already existing in the device). + :type user_id: str + :param access_type: Required. Type of access to be allowed for the user. Possible values + include: "Change", "Read", "Custom". + :type access_type: str or ~azure.mgmt.databoxedge.v2020_09_01_preview.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[~azure.mgmt.databoxedge.v2020_09_01_preview.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/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_09_01_preview/operations/__init__.py b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_09_01_preview/operations/__init__.py new file mode 100644 index 000000000000..d70057be6458 --- /dev/null +++ b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_09_01_preview/operations/__init__.py @@ -0,0 +1,47 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from ._operations import Operations +from ._available_skus_operations import AvailableSkusOperations +from ._devices_operations import DevicesOperations +from ._alerts_operations import AlertsOperations +from ._bandwidth_schedules_operations import BandwidthSchedulesOperations +from ._jobs_operations import JobsOperations +from ._nodes_operations import NodesOperations +from ._operations_status_operations import OperationsStatusOperations +from ._orders_operations import OrdersOperations +from ._roles_operations import RolesOperations +from ._addons_operations import AddonsOperations +from ._monitoring_config_operations import MonitoringConfigOperations +from ._shares_operations import SharesOperations +from ._storage_account_credentials_operations import StorageAccountCredentialsOperations +from ._storage_accounts_operations import StorageAccountsOperations +from ._containers_operations import ContainersOperations +from ._triggers_operations import TriggersOperations +from ._users_operations import UsersOperations + +__all__ = [ + 'Operations', + 'AvailableSkusOperations', + 'DevicesOperations', + 'AlertsOperations', + 'BandwidthSchedulesOperations', + 'JobsOperations', + 'NodesOperations', + 'OperationsStatusOperations', + 'OrdersOperations', + 'RolesOperations', + 'AddonsOperations', + 'MonitoringConfigOperations', + 'SharesOperations', + 'StorageAccountCredentialsOperations', + 'StorageAccountsOperations', + 'ContainersOperations', + 'TriggersOperations', + 'UsersOperations', +] diff --git a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_09_01_preview/operations/_addons_operations.py b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_09_01_preview/operations/_addons_operations.py new file mode 100644 index 000000000000..9365bc2d7256 --- /dev/null +++ b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_09_01_preview/operations/_addons_operations.py @@ -0,0 +1,460 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.core.polling import LROPoller, NoPolling, PollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.arm_polling import ARMPolling + +from .. import models as _models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class AddonsOperations(object): + """AddonsOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.databoxedge.v2020_09_01_preview.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list_by_role( + self, + device_name, # type: str + role_name, # type: str + resource_group_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.AddonList"] + """Lists all the addons configured in the role. + + :param device_name: The device name. + :type device_name: str + :param role_name: The role name. + :type role_name: str + :param resource_group_name: The resource group name. + :type resource_group_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either AddonList or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.databoxedge.v2020_09_01_preview.models.AddonList] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.AddonList"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01-preview" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_by_role.metadata['url'] # type: ignore + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'roleName': self._serialize.url("role_name", role_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('AddonList', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_by_role.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/roles/{roleName}/addons'} # type: ignore + + def get( + self, + device_name, # type: str + role_name, # type: str + addon_name, # type: str + resource_group_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.Addon" + """Gets a specific addon by name. + + :param device_name: The device name. + :type device_name: str + :param role_name: The role name. + :type role_name: str + :param addon_name: The addon name. + :type addon_name: str + :param resource_group_name: The resource group name. + :type resource_group_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: Addon, or the result of cls(response) + :rtype: ~azure.mgmt.databoxedge.v2020_09_01_preview.models.Addon + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.Addon"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01-preview" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'roleName': self._serialize.url("role_name", role_name, 'str'), + 'addonName': self._serialize.url("addon_name", addon_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('Addon', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/roles/{roleName}/addons/{addonName}'} # type: ignore + + def _create_or_update_initial( + self, + device_name, # type: str + role_name, # type: str + addon_name, # type: str + resource_group_name, # type: str + addon, # type: "_models.Addon" + **kwargs # type: Any + ): + # type: (...) -> Optional["_models.Addon"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.Addon"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01-preview" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._create_or_update_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'roleName': self._serialize.url("role_name", role_name, 'str'), + 'addonName': self._serialize.url("addon_name", addon_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(addon, 'Addon') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('Addon', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/roles/{roleName}/addons/{addonName}'} # type: ignore + + def begin_create_or_update( + self, + device_name, # type: str + role_name, # type: str + addon_name, # type: str + resource_group_name, # type: str + addon, # type: "_models.Addon" + **kwargs # type: Any + ): + # type: (...) -> LROPoller["_models.Addon"] + """Create or update a addon. + + :param device_name: The device name. + :type device_name: str + :param role_name: The role name. + :type role_name: str + :param addon_name: The addon name. + :type addon_name: str + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param addon: The addon properties. + :type addon: ~azure.mgmt.databoxedge.v2020_09_01_preview.models.Addon + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: Pass in True if you'd like the ARMPolling polling method, + False for no polling, or your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either Addon or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.databoxedge.v2020_09_01_preview.models.Addon] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Addon"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._create_or_update_initial( + device_name=device_name, + role_name=role_name, + addon_name=addon_name, + resource_group_name=resource_group_name, + addon=addon, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('Addon', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'roleName': self._serialize.url("role_name", role_name, 'str'), + 'addonName': self._serialize.url("addon_name", addon_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/roles/{roleName}/addons/{addonName}'} # type: ignore + + def _delete_initial( + self, + device_name, # type: str + role_name, # type: str + addon_name, # type: str + resource_group_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01-preview" + accept = "application/json" + + # Construct URL + url = self._delete_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'roleName': self._serialize.url("role_name", role_name, 'str'), + 'addonName': self._serialize.url("addon_name", addon_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/roles/{roleName}/addons/{addonName}'} # type: ignore + + def begin_delete( + self, + device_name, # type: str + role_name, # type: str + addon_name, # type: str + resource_group_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> LROPoller[None] + """Deletes the addon on the device. + + :param device_name: The device name. + :type device_name: str + :param role_name: The role name. + :type role_name: str + :param addon_name: The addon name. + :type addon_name: str + :param resource_group_name: The resource group name. + :type resource_group_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: Pass in True if you'd like the ARMPolling polling method, + False for no polling, or your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._delete_initial( + device_name=device_name, + role_name=role_name, + addon_name=addon_name, + resource_group_name=resource_group_name, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'roleName': self._serialize.url("role_name", role_name, 'str'), + 'addonName': self._serialize.url("addon_name", addon_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/roles/{roleName}/addons/{addonName}'} # type: ignore diff --git a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_09_01_preview/operations/_alerts_operations.py b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_09_01_preview/operations/_alerts_operations.py new file mode 100644 index 000000000000..5621d275fc8f --- /dev/null +++ b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_09_01_preview/operations/_alerts_operations.py @@ -0,0 +1,186 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.mgmt.core.exceptions import ARMErrorFormat + +from .. import models as _models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class AlertsOperations(object): + """AlertsOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.databoxedge.v2020_09_01_preview.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[~azure.mgmt.databoxedge.v2020_09_01_preview.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 = "2020-09-01-preview" + 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: ~azure.mgmt.databoxedge.v2020_09_01_preview.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 = "2020-09-01-preview" + 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/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_09_01_preview/operations/_available_skus_operations.py b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_09_01_preview/operations/_available_skus_operations.py new file mode 100644 index 000000000000..07119aad4c34 --- /dev/null +++ b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_09_01_preview/operations/_available_skus_operations.py @@ -0,0 +1,115 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.mgmt.core.exceptions import ARMErrorFormat + +from .. import models as _models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class AvailableSkusOperations(object): + """AvailableSkusOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.databoxedge.v2020_09_01_preview.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list( + self, + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.DataBoxEdgeSkuList"] + """List all the available Skus and information related to them. + + List all the available Skus and information related to them. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either DataBoxEdgeSkuList or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.databoxedge.v2020_09_01_preview.models.DataBoxEdgeSkuList] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.DataBoxEdgeSkuList"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01-preview" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('DataBoxEdgeSkuList', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.DataBoxEdge/availableSkus'} # type: ignore diff --git a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_09_01_preview/operations/_bandwidth_schedules_operations.py b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_09_01_preview/operations/_bandwidth_schedules_operations.py new file mode 100644 index 000000000000..9d8a3cd35b81 --- /dev/null +++ b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_09_01_preview/operations/_bandwidth_schedules_operations.py @@ -0,0 +1,438 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.core.polling import LROPoller, NoPolling, PollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.arm_polling import ARMPolling + +from .. import models as _models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class BandwidthSchedulesOperations(object): + """BandwidthSchedulesOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.databoxedge.v2020_09_01_preview.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[~azure.mgmt.databoxedge.v2020_09_01_preview.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 = "2020-09-01-preview" + 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: ~azure.mgmt.databoxedge.v2020_09_01_preview.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 = "2020-09-01-preview" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('BandwidthSchedule', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/bandwidthSchedules/{name}'} # type: ignore + + def _create_or_update_initial( + self, + device_name, # type: str + name, # type: str + resource_group_name, # type: str + parameters, # type: "_models.BandwidthSchedule" + **kwargs # type: Any + ): + # type: (...) -> Optional["_models.BandwidthSchedule"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.BandwidthSchedule"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01-preview" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._create_or_update_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, 'BandwidthSchedule') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('BandwidthSchedule', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/bandwidthSchedules/{name}'} # type: ignore + + def begin_create_or_update( + self, + device_name, # type: str + name, # type: str + resource_group_name, # type: str + parameters, # type: "_models.BandwidthSchedule" + **kwargs # type: Any + ): + # type: (...) -> LROPoller["_models.BandwidthSchedule"] + """Creates or updates a bandwidth schedule. + + :param device_name: The device name. + :type device_name: str + :param name: The bandwidth schedule name which needs to be added/updated. + :type name: str + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param parameters: The bandwidth schedule to be added or updated. + :type parameters: ~azure.mgmt.databoxedge.v2020_09_01_preview.models.BandwidthSchedule + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: Pass in True if you'd like the ARMPolling polling method, + False for no polling, or your own initialized polling object for a 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[~azure.mgmt.databoxedge.v2020_09_01_preview.models.BandwidthSchedule] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.BandwidthSchedule"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._create_or_update_initial( + device_name=device_name, + name=name, + resource_group_name=resource_group_name, + parameters=parameters, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('BandwidthSchedule', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/bandwidthSchedules/{name}'} # type: ignore + + def _delete_initial( + self, + device_name, # type: str + name, # type: str + resource_group_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01-preview" + 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: Pass in True if you'd like the ARMPolling polling method, + False for no polling, or your own initialized polling object for a 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/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_09_01_preview/operations/_containers_operations.py b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_09_01_preview/operations/_containers_operations.py new file mode 100644 index 000000000000..5e8e117e34fe --- /dev/null +++ b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_09_01_preview/operations/_containers_operations.py @@ -0,0 +1,592 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.core.polling import LROPoller, NoPolling, PollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.arm_polling import ARMPolling + +from .. import models as _models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class ContainersOperations(object): + """ContainersOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.databoxedge.v2020_09_01_preview.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[~azure.mgmt.databoxedge.v2020_09_01_preview.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 = "2020-09-01-preview" + 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: ~azure.mgmt.databoxedge.v2020_09_01_preview.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 = "2020-09-01-preview" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'storageAccountName': self._serialize.url("storage_account_name", storage_account_name, 'str'), + 'containerName': self._serialize.url("container_name", container_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('Container', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/storageAccounts/{storageAccountName}/containers/{containerName}'} # type: ignore + + def _create_or_update_initial( + self, + device_name, # type: str + storage_account_name, # type: str + container_name, # type: str + resource_group_name, # type: str + container, # type: "_models.Container" + **kwargs # type: Any + ): + # type: (...) -> Optional["_models.Container"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.Container"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01-preview" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._create_or_update_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'storageAccountName': self._serialize.url("storage_account_name", storage_account_name, 'str'), + 'containerName': self._serialize.url("container_name", container_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(container, 'Container') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('Container', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/storageAccounts/{storageAccountName}/containers/{containerName}'} # type: ignore + + def begin_create_or_update( + self, + device_name, # type: str + storage_account_name, # type: str + container_name, # type: str + resource_group_name, # type: str + container, # type: "_models.Container" + **kwargs # type: Any + ): + # type: (...) -> LROPoller["_models.Container"] + """Creates a new container or updates an existing container on the device. + + Creates a new container or updates an existing container on the device. + + :param device_name: The device name. + :type device_name: str + :param storage_account_name: The Storage Account Name. + :type storage_account_name: str + :param container_name: The container name. + :type container_name: str + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param container: The container properties. + :type container: ~azure.mgmt.databoxedge.v2020_09_01_preview.models.Container + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: Pass in True if you'd like the ARMPolling polling method, + False for no polling, or your own initialized polling object for a 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[~azure.mgmt.databoxedge.v2020_09_01_preview.models.Container] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Container"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._create_or_update_initial( + device_name=device_name, + storage_account_name=storage_account_name, + container_name=container_name, + resource_group_name=resource_group_name, + container=container, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('Container', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'storageAccountName': self._serialize.url("storage_account_name", storage_account_name, 'str'), + 'containerName': self._serialize.url("container_name", container_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/storageAccounts/{storageAccountName}/containers/{containerName}'} # type: ignore + + def _delete_initial( + self, + device_name, # type: str + storage_account_name, # type: str + container_name, # type: str + resource_group_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01-preview" + 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: Pass in True if you'd like the ARMPolling polling method, + False for no polling, or your own initialized polling object for a 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 = "2020-09-01-preview" + 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: Pass in True if you'd like the ARMPolling polling method, + False for no polling, or your own initialized polling object for a 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/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_09_01_preview/operations/_devices_operations.py b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_09_01_preview/operations/_devices_operations.py new file mode 100644 index 000000000000..a058fb8f62d2 --- /dev/null +++ b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_09_01_preview/operations/_devices_operations.py @@ -0,0 +1,1389 @@ +# 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 as _models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class DevicesOperations(object): + """DevicesOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.databoxedge.v2020_09_01_preview.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[~azure.mgmt.databoxedge.v2020_09_01_preview.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 = "2020-09-01-preview" + 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[~azure.mgmt.databoxedge.v2020_09_01_preview.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 = "2020-09-01-preview" + 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: ~azure.mgmt.databoxedge.v2020_09_01_preview.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 = "2020-09-01-preview" + 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 + data_box_edge_device, # type: "_models.DataBoxEdgeDevice" + **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', {})) + api_version = "2020-09-01-preview" + 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 + data_box_edge_device, # type: "_models.DataBoxEdgeDevice" + **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 data_box_edge_device: The resource object. + :type data_box_edge_device: ~azure.mgmt.databoxedge.v2020_09_01_preview.models.DataBoxEdgeDevice + :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: Pass in True if you'd like the ARMPolling polling method, + False for no polling, or your own initialized polling object for a 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[~azure.mgmt.databoxedge.v2020_09_01_preview.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, + data_box_edge_device=data_box_edge_device, + 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 = "2020-09-01-preview" + 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: Pass in True if you'd like the ARMPolling polling method, + False for no polling, or your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._delete_initial( + device_name=device_name, + resource_group_name=resource_group_name, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}'} # type: ignore + + def update( + self, + device_name, # type: str + resource_group_name, # type: str + parameters, # type: "_models.DataBoxEdgeDevicePatch" + **kwargs # type: Any + ): + # type: (...) -> "_models.DataBoxEdgeDevice" + """Modifies a Data Box Edge/Data Box Gateway resource. + + :param device_name: The device name. + :type device_name: str + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param parameters: The resource parameters. + :type parameters: ~azure.mgmt.databoxedge.v2020_09_01_preview.models.DataBoxEdgeDevicePatch + :keyword callable cls: A custom type or function that will be passed the direct response + :return: DataBoxEdgeDevice, or the result of cls(response) + :rtype: ~azure.mgmt.databoxedge.v2020_09_01_preview.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 = "2020-09-01-preview" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update.metadata['url'] # type: ignore + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, 'DataBoxEdgeDevicePatch') + body_content_kwargs['content'] = body_content + request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('DataBoxEdgeDevice', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}'} # type: ignore + + def _download_updates_initial( + self, + device_name, # type: str + resource_group_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01-preview" + accept = "application/json" + + # Construct URL + url = self._download_updates_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _download_updates_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/downloadUpdates'} # type: ignore + + def begin_download_updates( + self, + device_name, # type: str + resource_group_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> LROPoller[None] + """Downloads the updates on a Data Box Edge/Data Box Gateway device. + + Downloads the updates on a Data Box Edge/Data Box Gateway device. + + :param device_name: The device name. + :type device_name: str + :param resource_group_name: The resource group name. + :type resource_group_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: Pass in True if you'd like the ARMPolling polling method, + False for no polling, or your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._download_updates_initial( + device_name=device_name, + resource_group_name=resource_group_name, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_download_updates.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/downloadUpdates'} # type: ignore + + def generate_certificate( + self, + device_name, # type: str + resource_group_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.GenerateCertResponse" + """Generates certificate for activation key. + + :param device_name: The device name. + :type device_name: str + :param resource_group_name: The resource group name. + :type resource_group_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: GenerateCertResponse, or the result of cls(response) + :rtype: ~azure.mgmt.databoxedge.v2020_09_01_preview.models.GenerateCertResponse + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.GenerateCertResponse"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01-preview" + accept = "application/json" + + # Construct URL + url = self.generate_certificate.metadata['url'] # type: ignore + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('GenerateCertResponse', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + generate_certificate.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/generateCertificate'} # type: ignore + + def get_extended_information( + self, + device_name, # type: str + resource_group_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.DataBoxEdgeDeviceExtendedInfo" + """Gets additional information for the specified Azure Stack Edge/Data Box Gateway device. + + :param device_name: The device name. + :type device_name: str + :param resource_group_name: The resource group name. + :type resource_group_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: DataBoxEdgeDeviceExtendedInfo, or the result of cls(response) + :rtype: ~azure.mgmt.databoxedge.v2020_09_01_preview.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 = "2020-09-01-preview" + accept = "application/json" + + # Construct URL + url = self.get_extended_information.metadata['url'] # type: ignore + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('DataBoxEdgeDeviceExtendedInfo', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_extended_information.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/getExtendedInformation'} # type: ignore + + def _install_updates_initial( + self, + device_name, # type: str + resource_group_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01-preview" + accept = "application/json" + + # Construct URL + url = self._install_updates_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _install_updates_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/installUpdates'} # type: ignore + + def begin_install_updates( + self, + device_name, # type: str + resource_group_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> LROPoller[None] + """Installs the updates on the Data Box Edge/Data Box Gateway device. + + Installs the updates on the Data Box Edge/Data Box Gateway device. + + :param device_name: The device name. + :type device_name: str + :param resource_group_name: The resource group name. + :type resource_group_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: Pass in True if you'd like the ARMPolling polling method, + False for no polling, or your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._install_updates_initial( + device_name=device_name, + resource_group_name=resource_group_name, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_install_updates.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/installUpdates'} # type: ignore + + def get_network_settings( + self, + device_name, # type: str + resource_group_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.NetworkSettings" + """Gets the network settings of the specified Data Box Edge/Data Box Gateway device. + + :param device_name: The device name. + :type device_name: str + :param resource_group_name: The resource group name. + :type resource_group_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: NetworkSettings, or the result of cls(response) + :rtype: ~azure.mgmt.databoxedge.v2020_09_01_preview.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 = "2020-09-01-preview" + accept = "application/json" + + # Construct URL + url = self.get_network_settings.metadata['url'] # type: ignore + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('NetworkSettings', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_network_settings.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/networkSettings/default'} # type: ignore + + def _scan_for_updates_initial( + self, + device_name, # type: str + resource_group_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01-preview" + accept = "application/json" + + # Construct URL + url = self._scan_for_updates_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _scan_for_updates_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/scanForUpdates'} # type: ignore + + def begin_scan_for_updates( + self, + device_name, # type: str + resource_group_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> LROPoller[None] + """Scans for updates on a Data Box Edge/Data Box Gateway device. + + Scans for updates on a Data Box Edge/Data Box Gateway device. + + :param device_name: The device name. + :type device_name: str + :param resource_group_name: The resource group name. + :type resource_group_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: Pass in True if you'd like the ARMPolling polling method, + False for no polling, or your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._scan_for_updates_initial( + device_name=device_name, + resource_group_name=resource_group_name, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_scan_for_updates.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/scanForUpdates'} # type: ignore + + def _create_or_update_security_settings_initial( + self, + device_name, # type: str + resource_group_name, # type: str + security_settings, # type: "_models.SecuritySettings" + **kwargs # type: Any + ): + # type: (...) -> None + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01-preview" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._create_or_update_security_settings_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(security_settings, 'SecuritySettings') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _create_or_update_security_settings_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/securitySettings/default/update'} # type: ignore + + def begin_create_or_update_security_settings( + self, + device_name, # type: str + resource_group_name, # type: str + security_settings, # type: "_models.SecuritySettings" + **kwargs # type: Any + ): + # type: (...) -> LROPoller[None] + """Updates the security settings on a Data Box Edge/Data Box Gateway device. + + :param device_name: The device name. + :type device_name: str + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param security_settings: The security settings. + :type security_settings: ~azure.mgmt.databoxedge.v2020_09_01_preview.models.SecuritySettings + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: Pass in True if you'd like the ARMPolling polling method, + False for no polling, or your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._create_or_update_security_settings_initial( + device_name=device_name, + resource_group_name=resource_group_name, + security_settings=security_settings, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create_or_update_security_settings.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/securitySettings/default/update'} # type: ignore + + def update_extended_information( + self, + device_name, # type: str + resource_group_name, # type: str + parameters, # type: "_models.DataBoxEdgeDeviceExtendedInfoPatch" + **kwargs # type: Any + ): + # type: (...) -> "_models.DataBoxEdgeDeviceExtendedInfo" + """Gets additional information for the specified Data Box Edge/Data Box Gateway device. + + :param device_name: The device name. + :type device_name: str + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param parameters: The patch object. + :type parameters: ~azure.mgmt.databoxedge.v2020_09_01_preview.models.DataBoxEdgeDeviceExtendedInfoPatch + :keyword callable cls: A custom type or function that will be passed the direct response + :return: DataBoxEdgeDeviceExtendedInfo, or the result of cls(response) + :rtype: ~azure.mgmt.databoxedge.v2020_09_01_preview.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 = "2020-09-01-preview" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update_extended_information.metadata['url'] # type: ignore + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, 'DataBoxEdgeDeviceExtendedInfoPatch') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('DataBoxEdgeDeviceExtendedInfo', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update_extended_information.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/updateExtendedInformation'} # type: ignore + + def get_update_summary( + self, + device_name, # type: str + resource_group_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.UpdateSummary" + """Gets information about the availability of updates based on the last scan of the device. It also gets information about any ongoing download or install jobs on the device. + + Gets information about the availability of updates based on the last scan of the device. It + also gets information about any ongoing download or install jobs on the device. + + :param device_name: The device name. + :type device_name: str + :param resource_group_name: The resource group name. + :type resource_group_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: UpdateSummary, or the result of cls(response) + :rtype: ~azure.mgmt.databoxedge.v2020_09_01_preview.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 = "2020-09-01-preview" + accept = "application/json" + + # Construct URL + url = self.get_update_summary.metadata['url'] # type: ignore + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('UpdateSummary', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_update_summary.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/updateSummary/default'} # type: ignore + + def upload_certificate( + self, + device_name, # type: str + resource_group_name, # type: str + parameters, # type: "_models.UploadCertificateRequest" + **kwargs # type: Any + ): + # type: (...) -> "_models.UploadCertificateResponse" + """Uploads registration certificate for the device. + + :param device_name: The device name. + :type device_name: str + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param parameters: The upload certificate request. + :type parameters: ~azure.mgmt.databoxedge.v2020_09_01_preview.models.UploadCertificateRequest + :keyword callable cls: A custom type or function that will be passed the direct response + :return: UploadCertificateResponse, or the result of cls(response) + :rtype: ~azure.mgmt.databoxedge.v2020_09_01_preview.models.UploadCertificateResponse + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.UploadCertificateResponse"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01-preview" + 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/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_09_01_preview/operations/_jobs_operations.py b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_09_01_preview/operations/_jobs_operations.py new file mode 100644 index 000000000000..3093099186b6 --- /dev/null +++ b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_09_01_preview/operations/_jobs_operations.py @@ -0,0 +1,110 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.mgmt.core.exceptions import ARMErrorFormat + +from .. import models as _models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Optional, TypeVar + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class JobsOperations(object): + """JobsOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.databoxedge.v2020_09_01_preview.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: ~azure.mgmt.databoxedge.v2020_09_01_preview.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 = "2020-09-01-preview" + 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/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_09_01_preview/operations/_monitoring_config_operations.py b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_09_01_preview/operations/_monitoring_config_operations.py new file mode 100644 index 000000000000..dfe56fe7e990 --- /dev/null +++ b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_09_01_preview/operations/_monitoring_config_operations.py @@ -0,0 +1,450 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.core.polling import LROPoller, NoPolling, PollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.arm_polling import ARMPolling + +from .. import models as _models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class MonitoringConfigOperations(object): + """MonitoringConfigOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.databoxedge.v2020_09_01_preview.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list( + self, + device_name, # type: str + role_name, # type: str + resource_group_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.MonitoringMetricConfigurationList"] + """Lists metric configurations in a role. + + Lists metric configurations in a role. + + :param device_name: The device name. + :type device_name: str + :param role_name: The role name. + :type role_name: str + :param resource_group_name: The resource group name. + :type resource_group_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either MonitoringMetricConfigurationList or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.databoxedge.v2020_09_01_preview.models.MonitoringMetricConfigurationList] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.MonitoringMetricConfigurationList"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01-preview" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list.metadata['url'] # type: ignore + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'roleName': self._serialize.url("role_name", role_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('MonitoringMetricConfigurationList', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/roles/{roleName}/monitoringConfig'} # type: ignore + + def get( + self, + device_name, # type: str + role_name, # type: str + resource_group_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.MonitoringMetricConfiguration" + """Gets a metric configuration of a role. + + Gets a metric configuration of a role. + + :param device_name: The device name. + :type device_name: str + :param role_name: The role name. + :type role_name: str + :param resource_group_name: The resource group name. + :type resource_group_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: MonitoringMetricConfiguration, or the result of cls(response) + :rtype: ~azure.mgmt.databoxedge.v2020_09_01_preview.models.MonitoringMetricConfiguration + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.MonitoringMetricConfiguration"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01-preview" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'roleName': self._serialize.url("role_name", role_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('MonitoringMetricConfiguration', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/roles/{roleName}/monitoringConfig/default'} # type: ignore + + def _create_or_update_initial( + self, + device_name, # type: str + role_name, # type: str + resource_group_name, # type: str + monitoring_metric_configuration, # type: "_models.MonitoringMetricConfiguration" + **kwargs # type: Any + ): + # type: (...) -> Optional["_models.MonitoringMetricConfiguration"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.MonitoringMetricConfiguration"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01-preview" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._create_or_update_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'roleName': self._serialize.url("role_name", role_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(monitoring_metric_configuration, 'MonitoringMetricConfiguration') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('MonitoringMetricConfiguration', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/roles/{roleName}/monitoringConfig/default'} # type: ignore + + def begin_create_or_update( + self, + device_name, # type: str + role_name, # type: str + resource_group_name, # type: str + monitoring_metric_configuration, # type: "_models.MonitoringMetricConfiguration" + **kwargs # type: Any + ): + # type: (...) -> LROPoller["_models.MonitoringMetricConfiguration"] + """Creates a new metric configuration or updates an existing one for a role. + + Creates a new metric configuration or updates an existing one for a role. + + :param device_name: The device name. + :type device_name: str + :param role_name: The role name. + :type role_name: str + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param monitoring_metric_configuration: The metric configuration. + :type monitoring_metric_configuration: ~azure.mgmt.databoxedge.v2020_09_01_preview.models.MonitoringMetricConfiguration + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: Pass in True if you'd like the ARMPolling polling method, + False for no polling, or your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either MonitoringMetricConfiguration or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.databoxedge.v2020_09_01_preview.models.MonitoringMetricConfiguration] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.MonitoringMetricConfiguration"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._create_or_update_initial( + device_name=device_name, + role_name=role_name, + resource_group_name=resource_group_name, + monitoring_metric_configuration=monitoring_metric_configuration, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('MonitoringMetricConfiguration', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'roleName': self._serialize.url("role_name", role_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/roles/{roleName}/monitoringConfig/default'} # type: ignore + + def _delete_initial( + self, + device_name, # type: str + role_name, # type: str + resource_group_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01-preview" + accept = "application/json" + + # Construct URL + url = self._delete_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'roleName': self._serialize.url("role_name", role_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/roles/{roleName}/monitoringConfig/default'} # type: ignore + + def begin_delete( + self, + device_name, # type: str + role_name, # type: str + resource_group_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> LROPoller[None] + """deletes a new metric configuration for a role. + + deletes a new metric configuration for a role. + + :param device_name: The device name. + :type device_name: str + :param role_name: The role name. + :type role_name: str + :param resource_group_name: The resource group name. + :type resource_group_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: Pass in True if you'd like the ARMPolling polling method, + False for no polling, or your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._delete_initial( + device_name=device_name, + role_name=role_name, + resource_group_name=resource_group_name, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'roleName': self._serialize.url("role_name", role_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/roles/{roleName}/monitoringConfig/default'} # type: ignore diff --git a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_09_01_preview/operations/_nodes_operations.py b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_09_01_preview/operations/_nodes_operations.py new file mode 100644 index 000000000000..64bd64238045 --- /dev/null +++ b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_09_01_preview/operations/_nodes_operations.py @@ -0,0 +1,121 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.mgmt.core.exceptions import ARMErrorFormat + +from .. import models as _models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class NodesOperations(object): + """NodesOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.databoxedge.v2020_09_01_preview.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[~azure.mgmt.databoxedge.v2020_09_01_preview.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 = "2020-09-01-preview" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_by_data_box_edge_device.metadata['url'] # type: ignore + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('NodeList', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_by_data_box_edge_device.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/nodes'} # type: ignore diff --git a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_09_01_preview/operations/_operations.py b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_09_01_preview/operations/_operations.py new file mode 100644 index 000000000000..9a70248228a1 --- /dev/null +++ b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_09_01_preview/operations/_operations.py @@ -0,0 +1,111 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.mgmt.core.exceptions import ARMErrorFormat + +from .. import models as _models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class Operations(object): + """Operations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.databoxedge.v2020_09_01_preview.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[~azure.mgmt.databoxedge.v2020_09_01_preview.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 = "2020-09-01-preview" + 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/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_09_01_preview/operations/_operations_status_operations.py b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_09_01_preview/operations/_operations_status_operations.py new file mode 100644 index 000000000000..16307b29fbfb --- /dev/null +++ b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_09_01_preview/operations/_operations_status_operations.py @@ -0,0 +1,110 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.mgmt.core.exceptions import ARMErrorFormat + +from .. import models as _models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Optional, TypeVar + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class OperationsStatusOperations(object): + """OperationsStatusOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.databoxedge.v2020_09_01_preview.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: ~azure.mgmt.databoxedge.v2020_09_01_preview.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 = "2020-09-01-preview" + 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/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_09_01_preview/operations/_orders_operations.py b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_09_01_preview/operations/_orders_operations.py new file mode 100644 index 000000000000..603494a81f39 --- /dev/null +++ b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_09_01_preview/operations/_orders_operations.py @@ -0,0 +1,489 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.core.polling import LROPoller, NoPolling, PollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.arm_polling import ARMPolling + +from .. import models as _models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class OrdersOperations(object): + """OrdersOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.databoxedge.v2020_09_01_preview.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[~azure.mgmt.databoxedge.v2020_09_01_preview.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 = "2020-09-01-preview" + 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: ~azure.mgmt.databoxedge.v2020_09_01_preview.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 = "2020-09-01-preview" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('Order', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/orders/default'} # type: ignore + + def _create_or_update_initial( + self, + device_name, # type: str + resource_group_name, # type: str + order, # type: "_models.Order" + **kwargs # type: Any + ): + # type: (...) -> Optional["_models.Order"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.Order"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01-preview" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._create_or_update_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(order, 'Order') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('Order', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/orders/default'} # type: ignore + + def begin_create_or_update( + self, + device_name, # type: str + resource_group_name, # type: str + order, # type: "_models.Order" + **kwargs # type: Any + ): + # type: (...) -> LROPoller["_models.Order"] + """Creates or updates an order. + + Creates or updates an order. + + :param device_name: The order details of a device. + :type device_name: str + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param order: The order to be created or updated. + :type order: ~azure.mgmt.databoxedge.v2020_09_01_preview.models.Order + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: Pass in True if you'd like the ARMPolling polling method, + False for no polling, or your own initialized polling object for a 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[~azure.mgmt.databoxedge.v2020_09_01_preview.models.Order] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Order"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._create_or_update_initial( + device_name=device_name, + resource_group_name=resource_group_name, + order=order, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('Order', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/orders/default'} # type: ignore + + def _delete_initial( + self, + device_name, # type: str + resource_group_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01-preview" + 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: Pass in True if you'd like the ARMPolling polling method, + False for no polling, or your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._delete_initial( + device_name=device_name, + resource_group_name=resource_group_name, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/orders/default'} # type: ignore + + def list_dc_access_code( + self, + device_name, # type: str + resource_group_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.DCAccessCode" + """Gets the DCAccess Code. + + Gets the DCAccess Code. + + :param device_name: The device name. + :type device_name: str + :param resource_group_name: The resource group name. + :type resource_group_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: DCAccessCode, or the result of cls(response) + :rtype: ~azure.mgmt.databoxedge.v2020_09_01_preview.models.DCAccessCode + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.DCAccessCode"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01-preview" + accept = "application/json" + + # Construct URL + url = self.list_dc_access_code.metadata['url'] # type: ignore + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('DCAccessCode', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + list_dc_access_code.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/orders/default/listDCAccessCode'} # type: ignore diff --git a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_09_01_preview/operations/_roles_operations.py b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_09_01_preview/operations/_roles_operations.py new file mode 100644 index 000000000000..2a5c33e838ce --- /dev/null +++ b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_09_01_preview/operations/_roles_operations.py @@ -0,0 +1,438 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.core.polling import LROPoller, NoPolling, PollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.arm_polling import ARMPolling + +from .. import models as _models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class RolesOperations(object): + """RolesOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.databoxedge.v2020_09_01_preview.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[~azure.mgmt.databoxedge.v2020_09_01_preview.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 = "2020-09-01-preview" + 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: ~azure.mgmt.databoxedge.v2020_09_01_preview.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 = "2020-09-01-preview" + 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 = "2020-09-01-preview" + 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: ~azure.mgmt.databoxedge.v2020_09_01_preview.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: Pass in True if you'd like the ARMPolling polling method, + False for no polling, or your own initialized polling object for a 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[~azure.mgmt.databoxedge.v2020_09_01_preview.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 = "2020-09-01-preview" + 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: Pass in True if you'd like the ARMPolling polling method, + False for no polling, or your own initialized polling object for a 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/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_09_01_preview/operations/_shares_operations.py b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_09_01_preview/operations/_shares_operations.py new file mode 100644 index 000000000000..501d30d91ea7 --- /dev/null +++ b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_09_01_preview/operations/_shares_operations.py @@ -0,0 +1,563 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.core.polling import LROPoller, NoPolling, PollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.arm_polling import ARMPolling + +from .. import models as _models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class SharesOperations(object): + """SharesOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.databoxedge.v2020_09_01_preview.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[~azure.mgmt.databoxedge.v2020_09_01_preview.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 = "2020-09-01-preview" + 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: ~azure.mgmt.databoxedge.v2020_09_01_preview.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 = "2020-09-01-preview" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('Share', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/shares/{name}'} # type: ignore + + def _create_or_update_initial( + self, + device_name, # type: str + name, # type: str + resource_group_name, # type: str + share, # type: "_models.Share" + **kwargs # type: Any + ): + # type: (...) -> Optional["_models.Share"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.Share"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01-preview" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._create_or_update_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(share, 'Share') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('Share', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/shares/{name}'} # type: ignore + + def begin_create_or_update( + self, + device_name, # type: str + name, # type: str + resource_group_name, # type: str + share, # type: "_models.Share" + **kwargs # type: Any + ): + # type: (...) -> LROPoller["_models.Share"] + """Creates a new share or updates an existing share on the device. + + Creates a new share or updates an existing share on the device. + + :param device_name: The device name. + :type device_name: str + :param name: The share name. + :type name: str + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param share: The share properties. + :type share: ~azure.mgmt.databoxedge.v2020_09_01_preview.models.Share + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: Pass in True if you'd like the ARMPolling polling method, + False for no polling, or your own initialized polling object for a 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[~azure.mgmt.databoxedge.v2020_09_01_preview.models.Share] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Share"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._create_or_update_initial( + device_name=device_name, + name=name, + resource_group_name=resource_group_name, + share=share, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('Share', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/shares/{name}'} # type: ignore + + def _delete_initial( + self, + device_name, # type: str + name, # type: str + resource_group_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01-preview" + 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: Pass in True if you'd like the ARMPolling polling method, + False for no polling, or your own initialized polling object for a 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 = "2020-09-01-preview" + 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: Pass in True if you'd like the ARMPolling polling method, + False for no polling, or your own initialized polling object for a 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/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_09_01_preview/operations/_storage_account_credentials_operations.py b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_09_01_preview/operations/_storage_account_credentials_operations.py new file mode 100644 index 000000000000..5f47caaaf368 --- /dev/null +++ b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_09_01_preview/operations/_storage_account_credentials_operations.py @@ -0,0 +1,440 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.core.polling import LROPoller, NoPolling, PollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.arm_polling import ARMPolling + +from .. import models as _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: ~azure.mgmt.databoxedge.v2020_09_01_preview.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[~azure.mgmt.databoxedge.v2020_09_01_preview.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 = "2020-09-01-preview" + 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: ~azure.mgmt.databoxedge.v2020_09_01_preview.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 = "2020-09-01-preview" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('StorageAccountCredential', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/storageAccountCredentials/{name}'} # type: ignore + + def _create_or_update_initial( + self, + device_name, # type: str + name, # type: str + resource_group_name, # type: str + storage_account_credential, # type: "_models.StorageAccountCredential" + **kwargs # type: Any + ): + # type: (...) -> Optional["_models.StorageAccountCredential"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.StorageAccountCredential"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01-preview" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._create_or_update_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(storage_account_credential, 'StorageAccountCredential') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('StorageAccountCredential', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/storageAccountCredentials/{name}'} # type: ignore + + def begin_create_or_update( + self, + device_name, # type: str + name, # type: str + resource_group_name, # type: str + storage_account_credential, # type: "_models.StorageAccountCredential" + **kwargs # type: Any + ): + # type: (...) -> LROPoller["_models.StorageAccountCredential"] + """Creates or updates the storage account credential. + + :param device_name: The device name. + :type device_name: str + :param name: The storage account credential name. + :type name: str + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param storage_account_credential: The storage account credential. + :type storage_account_credential: ~azure.mgmt.databoxedge.v2020_09_01_preview.models.StorageAccountCredential + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: Pass in True if you'd like the ARMPolling polling method, + False for no polling, or your own initialized polling object for a 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[~azure.mgmt.databoxedge.v2020_09_01_preview.models.StorageAccountCredential] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.StorageAccountCredential"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._create_or_update_initial( + device_name=device_name, + name=name, + resource_group_name=resource_group_name, + storage_account_credential=storage_account_credential, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('StorageAccountCredential', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/storageAccountCredentials/{name}'} # type: ignore + + def _delete_initial( + self, + device_name, # type: str + name, # type: str + resource_group_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01-preview" + 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: Pass in True if you'd like the ARMPolling polling method, + False for no polling, or your own initialized polling object for a 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/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_09_01_preview/operations/_storage_accounts_operations.py b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_09_01_preview/operations/_storage_accounts_operations.py new file mode 100644 index 000000000000..0aac41580fed --- /dev/null +++ b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_09_01_preview/operations/_storage_accounts_operations.py @@ -0,0 +1,444 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.core.polling import LROPoller, NoPolling, PollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.arm_polling import ARMPolling + +from .. import models as _models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class StorageAccountsOperations(object): + """StorageAccountsOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.databoxedge.v2020_09_01_preview.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list_by_data_box_edge_device( + self, + device_name, # type: str + resource_group_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.StorageAccountList"] + """Lists all the StorageAccounts in a Data Box Edge/Data Box Gateway device. + + Lists all the StorageAccounts in a Data Box Edge/Data Box Gateway device. + + :param device_name: The device name. + :type device_name: str + :param resource_group_name: The resource group name. + :type resource_group_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either StorageAccountList or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.databoxedge.v2020_09_01_preview.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 = "2020-09-01-preview" + 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: ~azure.mgmt.databoxedge.v2020_09_01_preview.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 = "2020-09-01-preview" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'storageAccountName': self._serialize.url("storage_account_name", storage_account_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('StorageAccount', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/storageAccounts/{storageAccountName}'} # type: ignore + + def _create_or_update_initial( + self, + device_name, # type: str + storage_account_name, # type: str + resource_group_name, # type: str + storage_account, # type: "_models.StorageAccount" + **kwargs # type: Any + ): + # type: (...) -> Optional["_models.StorageAccount"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.StorageAccount"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01-preview" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._create_or_update_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'storageAccountName': self._serialize.url("storage_account_name", storage_account_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(storage_account, 'StorageAccount') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('StorageAccount', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/storageAccounts/{storageAccountName}'} # type: ignore + + def begin_create_or_update( + self, + device_name, # type: str + storage_account_name, # type: str + resource_group_name, # type: str + storage_account, # type: "_models.StorageAccount" + **kwargs # type: Any + ): + # type: (...) -> LROPoller["_models.StorageAccount"] + """Creates a new StorageAccount or updates an existing StorageAccount on the device. + + Creates a new StorageAccount or updates an existing StorageAccount on the device. + + :param device_name: The device name. + :type device_name: str + :param storage_account_name: The StorageAccount name. + :type storage_account_name: str + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param storage_account: The StorageAccount properties. + :type storage_account: ~azure.mgmt.databoxedge.v2020_09_01_preview.models.StorageAccount + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: Pass in True if you'd like the ARMPolling polling method, + False for no polling, or your own initialized polling object for a 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[~azure.mgmt.databoxedge.v2020_09_01_preview.models.StorageAccount] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.StorageAccount"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._create_or_update_initial( + device_name=device_name, + storage_account_name=storage_account_name, + resource_group_name=resource_group_name, + storage_account=storage_account, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('StorageAccount', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'storageAccountName': self._serialize.url("storage_account_name", storage_account_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/storageAccounts/{storageAccountName}'} # type: ignore + + def _delete_initial( + self, + device_name, # type: str + storage_account_name, # type: str + resource_group_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01-preview" + 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: Pass in True if you'd like the ARMPolling polling method, + False for no polling, or your own initialized polling object for a 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/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_09_01_preview/operations/_triggers_operations.py b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_09_01_preview/operations/_triggers_operations.py new file mode 100644 index 000000000000..107270847ee8 --- /dev/null +++ b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_09_01_preview/operations/_triggers_operations.py @@ -0,0 +1,444 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.core.polling import LROPoller, NoPolling, PollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.arm_polling import ARMPolling + +from .. import models as _models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class TriggersOperations(object): + """TriggersOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.databoxedge.v2020_09_01_preview.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[~azure.mgmt.databoxedge.v2020_09_01_preview.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 = "2020-09-01-preview" + 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: ~azure.mgmt.databoxedge.v2020_09_01_preview.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 = "2020-09-01-preview" + 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 = "2020-09-01-preview" + 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: ~azure.mgmt.databoxedge.v2020_09_01_preview.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: Pass in True if you'd like the ARMPolling polling method, + False for no polling, or your own initialized polling object for a 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[~azure.mgmt.databoxedge.v2020_09_01_preview.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 = "2020-09-01-preview" + 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: Pass in True if you'd like the ARMPolling polling method, + False for no polling, or your own initialized polling object for a 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/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_09_01_preview/operations/_users_operations.py b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_09_01_preview/operations/_users_operations.py new file mode 100644 index 000000000000..569bcc44fd46 --- /dev/null +++ b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_09_01_preview/operations/_users_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 as _models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class UsersOperations(object): + """UsersOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.databoxedge.v2020_09_01_preview.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 + expand=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 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 UserList or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.databoxedge.v2020_09_01_preview.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 = "2020-09-01-preview" + 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 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('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: ~azure.mgmt.databoxedge.v2020_09_01_preview.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 = "2020-09-01-preview" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('User', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/users/{name}'} # type: ignore + + def _create_or_update_initial( + self, + device_name, # type: str + name, # type: str + resource_group_name, # type: str + user, # type: "_models.User" + **kwargs # type: Any + ): + # type: (...) -> Optional["_models.User"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.User"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01-preview" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._create_or_update_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(user, 'User') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('User', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/users/{name}'} # type: ignore + + def begin_create_or_update( + self, + device_name, # type: str + name, # type: str + resource_group_name, # type: str + user, # type: "_models.User" + **kwargs # type: Any + ): + # type: (...) -> LROPoller["_models.User"] + """Creates a new user or updates an existing user's information on a Data Box Edge/Data Box + Gateway device. + + :param device_name: The device name. + :type device_name: str + :param name: The user name. + :type name: str + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param user: The user details. + :type user: ~azure.mgmt.databoxedge.v2020_09_01_preview.models.User + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: Pass in True if you'd like the ARMPolling polling method, + False for no polling, or your own initialized polling object for a 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[~azure.mgmt.databoxedge.v2020_09_01_preview.models.User] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.User"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._create_or_update_initial( + device_name=device_name, + name=name, + resource_group_name=resource_group_name, + user=user, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('User', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/users/{name}'} # type: ignore + + def _delete_initial( + self, + device_name, # type: str + name, # type: str + resource_group_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01-preview" + 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: Pass in True if you'd like the ARMPolling polling method, + False for no polling, or your own initialized polling object for a 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/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_09_01_preview/py.typed b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_09_01_preview/py.typed new file mode 100644 index 000000000000..e5aff4f83af8 --- /dev/null +++ b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_09_01_preview/py.typed @@ -0,0 +1 @@ +# Marker file for PEP 561. \ No newline at end of file diff --git a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2021_02_01_preview/__init__.py b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2021_02_01_preview/__init__.py new file mode 100644 index 000000000000..e63196b6b98f --- /dev/null +++ b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2021_02_01_preview/__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/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2021_02_01_preview/_configuration.py b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2021_02_01_preview/_configuration.py new file mode 100644 index 000000000000..0e27cd60be90 --- /dev/null +++ b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2021_02_01_preview/_configuration.py @@ -0,0 +1,70 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from typing import TYPE_CHECKING + +from azure.core.configuration import Configuration +from azure.core.pipeline import policies +from azure.mgmt.core.policies import ARMHttpLoggingPolicy + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any + + from azure.core.credentials import TokenCredential + +VERSION = "unknown" + +class DataBoxEdgeManagementClientConfiguration(Configuration): + """Configuration for DataBoxEdgeManagementClient. + + Note that all parameters used to create this instance are saved as instance + attributes. + + :param credential: Credential needed for the client to connect to Azure. + :type credential: ~azure.core.credentials.TokenCredential + :param subscription_id: The subscription ID. + :type subscription_id: str + """ + + def __init__( + self, + credential, # type: "TokenCredential" + subscription_id, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + if credential is None: + raise ValueError("Parameter 'credential' must not be None.") + if subscription_id is None: + raise ValueError("Parameter 'subscription_id' must not be None.") + super(DataBoxEdgeManagementClientConfiguration, self).__init__(**kwargs) + + self.credential = credential + self.subscription_id = subscription_id + self.api_version = "2021-02-01-preview" + self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default']) + kwargs.setdefault('sdk_moniker', 'mgmt-databoxedge/{}'.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/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2021_02_01_preview/_data_box_edge_management_client.py b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2021_02_01_preview/_data_box_edge_management_client.py new file mode 100644 index 000000000000..16f27eeeaf02 --- /dev/null +++ b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2021_02_01_preview/_data_box_edge_management_client.py @@ -0,0 +1,174 @@ +# 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 azure.core.pipeline.transport import HttpRequest, HttpResponse + +from ._configuration import DataBoxEdgeManagementClientConfiguration +from .operations import Operations +from .operations import AvailableSkusOperations +from .operations import DevicesOperations +from .operations import AlertsOperations +from .operations import BandwidthSchedulesOperations +from .operations import JobsOperations +from .operations import NodesOperations +from .operations import OperationsStatusOperations +from .operations import OrdersOperations +from .operations import RolesOperations +from .operations import AddonsOperations +from .operations import MonitoringConfigOperations +from .operations import SharesOperations +from .operations import StorageAccountCredentialsOperations +from .operations import StorageAccountsOperations +from .operations import ContainersOperations +from .operations import TriggersOperations +from .operations import UsersOperations +from . import models + + +class DataBoxEdgeManagementClient(object): + """The DataBoxEdge Client. + + :ivar operations: Operations operations + :vartype operations: azure.mgmt.databoxedge.v2021_02_01_preview.operations.Operations + :ivar available_skus: AvailableSkusOperations operations + :vartype available_skus: azure.mgmt.databoxedge.v2021_02_01_preview.operations.AvailableSkusOperations + :ivar devices: DevicesOperations operations + :vartype devices: azure.mgmt.databoxedge.v2021_02_01_preview.operations.DevicesOperations + :ivar alerts: AlertsOperations operations + :vartype alerts: azure.mgmt.databoxedge.v2021_02_01_preview.operations.AlertsOperations + :ivar bandwidth_schedules: BandwidthSchedulesOperations operations + :vartype bandwidth_schedules: azure.mgmt.databoxedge.v2021_02_01_preview.operations.BandwidthSchedulesOperations + :ivar jobs: JobsOperations operations + :vartype jobs: azure.mgmt.databoxedge.v2021_02_01_preview.operations.JobsOperations + :ivar nodes: NodesOperations operations + :vartype nodes: azure.mgmt.databoxedge.v2021_02_01_preview.operations.NodesOperations + :ivar operations_status: OperationsStatusOperations operations + :vartype operations_status: azure.mgmt.databoxedge.v2021_02_01_preview.operations.OperationsStatusOperations + :ivar orders: OrdersOperations operations + :vartype orders: azure.mgmt.databoxedge.v2021_02_01_preview.operations.OrdersOperations + :ivar roles: RolesOperations operations + :vartype roles: azure.mgmt.databoxedge.v2021_02_01_preview.operations.RolesOperations + :ivar addons: AddonsOperations operations + :vartype addons: azure.mgmt.databoxedge.v2021_02_01_preview.operations.AddonsOperations + :ivar monitoring_config: MonitoringConfigOperations operations + :vartype monitoring_config: azure.mgmt.databoxedge.v2021_02_01_preview.operations.MonitoringConfigOperations + :ivar shares: SharesOperations operations + :vartype shares: azure.mgmt.databoxedge.v2021_02_01_preview.operations.SharesOperations + :ivar storage_account_credentials: StorageAccountCredentialsOperations operations + :vartype storage_account_credentials: azure.mgmt.databoxedge.v2021_02_01_preview.operations.StorageAccountCredentialsOperations + :ivar storage_accounts: StorageAccountsOperations operations + :vartype storage_accounts: azure.mgmt.databoxedge.v2021_02_01_preview.operations.StorageAccountsOperations + :ivar containers: ContainersOperations operations + :vartype containers: azure.mgmt.databoxedge.v2021_02_01_preview.operations.ContainersOperations + :ivar triggers: TriggersOperations operations + :vartype triggers: azure.mgmt.databoxedge.v2021_02_01_preview.operations.TriggersOperations + :ivar users: UsersOperations operations + :vartype users: azure.mgmt.databoxedge.v2021_02_01_preview.operations.UsersOperations + :param credential: Credential needed for the client to connect to Azure. + :type credential: ~azure.core.credentials.TokenCredential + :param subscription_id: The subscription ID. + :type subscription_id: str + :param str base_url: Service URL + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + """ + + def __init__( + self, + credential, # type: "TokenCredential" + subscription_id, # type: str + base_url=None, # type: Optional[str] + **kwargs # type: Any + ): + # type: (...) -> None + if not base_url: + base_url = 'https://management.azure.com' + self._config = DataBoxEdgeManagementClientConfiguration(credential, subscription_id, **kwargs) + self._client = ARMPipelineClient(base_url=base_url, config=self._config, **kwargs) + + client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} + self._serialize = Serializer(client_models) + self._serialize.client_side_validation = False + self._deserialize = Deserializer(client_models) + + self.operations = Operations( + self._client, self._config, self._serialize, self._deserialize) + self.available_skus = AvailableSkusOperations( + self._client, self._config, self._serialize, self._deserialize) + self.devices = DevicesOperations( + self._client, self._config, self._serialize, self._deserialize) + self.alerts = AlertsOperations( + self._client, self._config, self._serialize, self._deserialize) + self.bandwidth_schedules = BandwidthSchedulesOperations( + self._client, self._config, self._serialize, self._deserialize) + self.jobs = JobsOperations( + self._client, self._config, self._serialize, self._deserialize) + self.nodes = NodesOperations( + self._client, self._config, self._serialize, self._deserialize) + self.operations_status = OperationsStatusOperations( + self._client, self._config, self._serialize, self._deserialize) + self.orders = OrdersOperations( + self._client, self._config, self._serialize, self._deserialize) + self.roles = RolesOperations( + self._client, self._config, self._serialize, self._deserialize) + self.addons = AddonsOperations( + self._client, self._config, self._serialize, self._deserialize) + self.monitoring_config = MonitoringConfigOperations( + self._client, self._config, self._serialize, self._deserialize) + self.shares = SharesOperations( + self._client, self._config, self._serialize, self._deserialize) + self.storage_account_credentials = StorageAccountCredentialsOperations( + self._client, self._config, self._serialize, self._deserialize) + self.storage_accounts = StorageAccountsOperations( + self._client, self._config, self._serialize, self._deserialize) + self.containers = ContainersOperations( + self._client, self._config, self._serialize, self._deserialize) + self.triggers = TriggersOperations( + self._client, self._config, self._serialize, self._deserialize) + self.users = UsersOperations( + self._client, self._config, self._serialize, self._deserialize) + + def _send_request(self, http_request, **kwargs): + # type: (HttpRequest, Any) -> HttpResponse + """Runs the network request through the client's chained policies. + + :param http_request: The network request you want to make. Required. + :type http_request: ~azure.core.pipeline.transport.HttpRequest + :keyword bool stream: Whether the response payload will be streamed. Defaults to True. + :return: The response of your network call. Does not do error handling on your response. + :rtype: ~azure.core.pipeline.transport.HttpResponse + """ + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + http_request.url = self._client.format_url(http_request.url, **path_format_arguments) + stream = kwargs.pop("stream", True) + pipeline_response = self._client._pipeline.run(http_request, stream=stream, **kwargs) + return pipeline_response.http_response + + 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/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2021_02_01_preview/_metadata.json b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2021_02_01_preview/_metadata.json new file mode 100644 index 000000000000..c4a292c62cd0 --- /dev/null +++ b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2021_02_01_preview/_metadata.json @@ -0,0 +1,120 @@ +{ + "chosen_version": "2021-02-01-preview", + "total_api_version_list": ["2021-02-01-preview"], + "client": { + "name": "DataBoxEdgeManagementClient", + "filename": "_data_box_edge_management_client", + "description": "The DataBoxEdge Client.", + "base_url": "\u0027https://management.azure.com\u0027", + "custom_base_url": null, + "azure_arm": true, + "has_lro_operations": true, + "client_side_validation": false, + "sync_imports": "{\"typing\": {\"azurecore\": {\"azure.core.credentials\": [\"TokenCredential\"]}}, \"regular\": {\"azurecore\": {\"azure.profiles\": [\"KnownProfiles\", \"ProfileDefinition\"], \"azure.profiles.multiapiclient\": [\"MultiApiClientMixin\"], \"msrest\": [\"Deserializer\", \"Serializer\"], \"azure.mgmt.core\": [\"ARMPipelineClient\"]}, \"local\": {\"._configuration\": [\"DataBoxEdgeManagementClientConfiguration\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}, \"azurecore\": {\"azure.core.pipeline.transport\": [\"HttpRequest\", \"HttpResponse\"]}}}", + "async_imports": "{\"typing\": {\"azurecore\": {\"azure.core.credentials_async\": [\"AsyncTokenCredential\"]}}, \"regular\": {\"azurecore\": {\"azure.profiles\": [\"KnownProfiles\", \"ProfileDefinition\"], \"azure.profiles.multiapiclient\": [\"MultiApiClientMixin\"], \"msrest\": [\"Deserializer\", \"Serializer\"], \"azure.mgmt.core\": [\"AsyncARMPipelineClient\"]}, \"local\": {\"._configuration\": [\"DataBoxEdgeManagementClientConfiguration\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}, \"azurecore\": {\"azure.core.pipeline.transport\": [\"AsyncHttpResponse\", \"HttpRequest\"]}}}" + }, + "global_parameters": { + "sync": { + "credential": { + "signature": "credential, # type: \"TokenCredential\"", + "description": "Credential needed for the client to connect to Azure.", + "docstring_type": "~azure.core.credentials.TokenCredential", + "required": true + }, + "subscription_id": { + "signature": "subscription_id, # type: str", + "description": "The subscription ID.", + "docstring_type": "str", + "required": true + } + }, + "async": { + "credential": { + "signature": "credential: \"AsyncTokenCredential\",", + "description": "Credential needed for the client to connect to Azure.", + "docstring_type": "~azure.core.credentials_async.AsyncTokenCredential", + "required": true + }, + "subscription_id": { + "signature": "subscription_id: str,", + "description": "The subscription ID.", + "docstring_type": "str", + "required": true + } + }, + "constant": { + }, + "call": "credential, subscription_id", + "service_client_specific": { + "sync": { + "api_version": { + "signature": "api_version=None, # type: Optional[str]", + "description": "API version to use if no profile is provided, or if missing in profile.", + "docstring_type": "str", + "required": false + }, + "base_url": { + "signature": "base_url=None, # type: Optional[str]", + "description": "Service URL", + "docstring_type": "str", + "required": false + }, + "profile": { + "signature": "profile=KnownProfiles.default, # type: KnownProfiles", + "description": "A profile definition, from KnownProfiles to dict.", + "docstring_type": "azure.profiles.KnownProfiles", + "required": false + } + }, + "async": { + "api_version": { + "signature": "api_version: Optional[str] = None,", + "description": "API version to use if no profile is provided, or if missing in profile.", + "docstring_type": "str", + "required": false + }, + "base_url": { + "signature": "base_url: Optional[str] = None,", + "description": "Service URL", + "docstring_type": "str", + "required": false + }, + "profile": { + "signature": "profile: KnownProfiles = KnownProfiles.default,", + "description": "A profile definition, from KnownProfiles to dict.", + "docstring_type": "azure.profiles.KnownProfiles", + "required": false + } + } + } + }, + "config": { + "credential": true, + "credential_scopes": ["https://management.azure.com/.default"], + "credential_default_policy_type": "BearerTokenCredentialPolicy", + "credential_default_policy_type_has_async_version": true, + "credential_key_header_name": null, + "sync_imports": "{\"regular\": {\"azurecore\": {\"azure.core.configuration\": [\"Configuration\"], \"azure.core.pipeline\": [\"policies\"], \"azure.mgmt.core.policies\": [\"ARMHttpLoggingPolicy\"]}, \"local\": {\"._version\": [\"VERSION\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\"]}}, \"typing\": {\"azurecore\": {\"azure.core.credentials\": [\"TokenCredential\"]}}}", + "async_imports": "{\"regular\": {\"azurecore\": {\"azure.core.configuration\": [\"Configuration\"], \"azure.core.pipeline\": [\"policies\"], \"azure.mgmt.core.policies\": [\"ARMHttpLoggingPolicy\"]}, \"local\": {\".._version\": [\"VERSION\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\"]}}, \"typing\": {\"azurecore\": {\"azure.core.credentials_async\": [\"AsyncTokenCredential\"]}}}" + }, + "operation_groups": { + "operations": "Operations", + "available_skus": "AvailableSkusOperations", + "devices": "DevicesOperations", + "alerts": "AlertsOperations", + "bandwidth_schedules": "BandwidthSchedulesOperations", + "jobs": "JobsOperations", + "nodes": "NodesOperations", + "operations_status": "OperationsStatusOperations", + "orders": "OrdersOperations", + "roles": "RolesOperations", + "addons": "AddonsOperations", + "monitoring_config": "MonitoringConfigOperations", + "shares": "SharesOperations", + "storage_account_credentials": "StorageAccountCredentialsOperations", + "storage_accounts": "StorageAccountsOperations", + "containers": "ContainersOperations", + "triggers": "TriggersOperations", + "users": "UsersOperations" + } +} \ No newline at end of file diff --git a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2021_02_01_preview/aio/__init__.py b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2021_02_01_preview/aio/__init__.py new file mode 100644 index 000000000000..c33d46ee91d8 --- /dev/null +++ b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2021_02_01_preview/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/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2021_02_01_preview/aio/_configuration.py b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2021_02_01_preview/aio/_configuration.py new file mode 100644 index 000000000000..f2b772a27070 --- /dev/null +++ b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2021_02_01_preview/aio/_configuration.py @@ -0,0 +1,66 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from typing import Any, TYPE_CHECKING + +from azure.core.configuration import Configuration +from azure.core.pipeline import policies +from azure.mgmt.core.policies import ARMHttpLoggingPolicy + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from azure.core.credentials_async import AsyncTokenCredential + +VERSION = "unknown" + +class DataBoxEdgeManagementClientConfiguration(Configuration): + """Configuration for DataBoxEdgeManagementClient. + + Note that all parameters used to create this instance are saved as instance + attributes. + + :param credential: Credential needed for the client to connect to Azure. + :type credential: ~azure.core.credentials_async.AsyncTokenCredential + :param subscription_id: The subscription ID. + :type subscription_id: str + """ + + def __init__( + self, + credential: "AsyncTokenCredential", + subscription_id: str, + **kwargs: Any + ) -> None: + if credential is None: + raise ValueError("Parameter 'credential' must not be None.") + if subscription_id is None: + raise ValueError("Parameter 'subscription_id' must not be None.") + super(DataBoxEdgeManagementClientConfiguration, self).__init__(**kwargs) + + self.credential = credential + self.subscription_id = subscription_id + self.api_version = "2021-02-01-preview" + self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default']) + kwargs.setdefault('sdk_moniker', 'mgmt-databoxedge/{}'.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/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2021_02_01_preview/aio/_data_box_edge_management_client.py b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2021_02_01_preview/aio/_data_box_edge_management_client.py new file mode 100644 index 000000000000..7967f62c7ed8 --- /dev/null +++ b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2021_02_01_preview/aio/_data_box_edge_management_client.py @@ -0,0 +1,167 @@ +# 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.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.mgmt.core import AsyncARMPipelineClient +from msrest import Deserializer, Serializer + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from azure.core.credentials_async import AsyncTokenCredential + +from ._configuration import DataBoxEdgeManagementClientConfiguration +from .operations import Operations +from .operations import AvailableSkusOperations +from .operations import DevicesOperations +from .operations import AlertsOperations +from .operations import BandwidthSchedulesOperations +from .operations import JobsOperations +from .operations import NodesOperations +from .operations import OperationsStatusOperations +from .operations import OrdersOperations +from .operations import RolesOperations +from .operations import AddonsOperations +from .operations import MonitoringConfigOperations +from .operations import SharesOperations +from .operations import StorageAccountCredentialsOperations +from .operations import StorageAccountsOperations +from .operations import ContainersOperations +from .operations import TriggersOperations +from .operations import UsersOperations +from .. import models + + +class DataBoxEdgeManagementClient(object): + """The DataBoxEdge Client. + + :ivar operations: Operations operations + :vartype operations: azure.mgmt.databoxedge.v2021_02_01_preview.aio.operations.Operations + :ivar available_skus: AvailableSkusOperations operations + :vartype available_skus: azure.mgmt.databoxedge.v2021_02_01_preview.aio.operations.AvailableSkusOperations + :ivar devices: DevicesOperations operations + :vartype devices: azure.mgmt.databoxedge.v2021_02_01_preview.aio.operations.DevicesOperations + :ivar alerts: AlertsOperations operations + :vartype alerts: azure.mgmt.databoxedge.v2021_02_01_preview.aio.operations.AlertsOperations + :ivar bandwidth_schedules: BandwidthSchedulesOperations operations + :vartype bandwidth_schedules: azure.mgmt.databoxedge.v2021_02_01_preview.aio.operations.BandwidthSchedulesOperations + :ivar jobs: JobsOperations operations + :vartype jobs: azure.mgmt.databoxedge.v2021_02_01_preview.aio.operations.JobsOperations + :ivar nodes: NodesOperations operations + :vartype nodes: azure.mgmt.databoxedge.v2021_02_01_preview.aio.operations.NodesOperations + :ivar operations_status: OperationsStatusOperations operations + :vartype operations_status: azure.mgmt.databoxedge.v2021_02_01_preview.aio.operations.OperationsStatusOperations + :ivar orders: OrdersOperations operations + :vartype orders: azure.mgmt.databoxedge.v2021_02_01_preview.aio.operations.OrdersOperations + :ivar roles: RolesOperations operations + :vartype roles: azure.mgmt.databoxedge.v2021_02_01_preview.aio.operations.RolesOperations + :ivar addons: AddonsOperations operations + :vartype addons: azure.mgmt.databoxedge.v2021_02_01_preview.aio.operations.AddonsOperations + :ivar monitoring_config: MonitoringConfigOperations operations + :vartype monitoring_config: azure.mgmt.databoxedge.v2021_02_01_preview.aio.operations.MonitoringConfigOperations + :ivar shares: SharesOperations operations + :vartype shares: azure.mgmt.databoxedge.v2021_02_01_preview.aio.operations.SharesOperations + :ivar storage_account_credentials: StorageAccountCredentialsOperations operations + :vartype storage_account_credentials: azure.mgmt.databoxedge.v2021_02_01_preview.aio.operations.StorageAccountCredentialsOperations + :ivar storage_accounts: StorageAccountsOperations operations + :vartype storage_accounts: azure.mgmt.databoxedge.v2021_02_01_preview.aio.operations.StorageAccountsOperations + :ivar containers: ContainersOperations operations + :vartype containers: azure.mgmt.databoxedge.v2021_02_01_preview.aio.operations.ContainersOperations + :ivar triggers: TriggersOperations operations + :vartype triggers: azure.mgmt.databoxedge.v2021_02_01_preview.aio.operations.TriggersOperations + :ivar users: UsersOperations operations + :vartype users: azure.mgmt.databoxedge.v2021_02_01_preview.aio.operations.UsersOperations + :param credential: Credential needed for the client to connect to Azure. + :type credential: ~azure.core.credentials_async.AsyncTokenCredential + :param subscription_id: The subscription ID. + :type subscription_id: str + :param str base_url: Service URL + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + """ + + def __init__( + self, + credential: "AsyncTokenCredential", + subscription_id: str, + base_url: Optional[str] = None, + **kwargs: Any + ) -> None: + if not base_url: + base_url = 'https://management.azure.com' + self._config = DataBoxEdgeManagementClientConfiguration(credential, subscription_id, **kwargs) + self._client = AsyncARMPipelineClient(base_url=base_url, config=self._config, **kwargs) + + client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} + self._serialize = Serializer(client_models) + self._serialize.client_side_validation = False + self._deserialize = Deserializer(client_models) + + self.operations = Operations( + self._client, self._config, self._serialize, self._deserialize) + self.available_skus = AvailableSkusOperations( + self._client, self._config, self._serialize, self._deserialize) + self.devices = DevicesOperations( + self._client, self._config, self._serialize, self._deserialize) + self.alerts = AlertsOperations( + self._client, self._config, self._serialize, self._deserialize) + self.bandwidth_schedules = BandwidthSchedulesOperations( + self._client, self._config, self._serialize, self._deserialize) + self.jobs = JobsOperations( + self._client, self._config, self._serialize, self._deserialize) + self.nodes = NodesOperations( + self._client, self._config, self._serialize, self._deserialize) + self.operations_status = OperationsStatusOperations( + self._client, self._config, self._serialize, self._deserialize) + self.orders = OrdersOperations( + self._client, self._config, self._serialize, self._deserialize) + self.roles = RolesOperations( + self._client, self._config, self._serialize, self._deserialize) + self.addons = AddonsOperations( + self._client, self._config, self._serialize, self._deserialize) + self.monitoring_config = MonitoringConfigOperations( + self._client, self._config, self._serialize, self._deserialize) + self.shares = SharesOperations( + self._client, self._config, self._serialize, self._deserialize) + self.storage_account_credentials = StorageAccountCredentialsOperations( + self._client, self._config, self._serialize, self._deserialize) + self.storage_accounts = StorageAccountsOperations( + self._client, self._config, self._serialize, self._deserialize) + self.containers = ContainersOperations( + self._client, self._config, self._serialize, self._deserialize) + self.triggers = TriggersOperations( + self._client, self._config, self._serialize, self._deserialize) + self.users = UsersOperations( + self._client, self._config, self._serialize, self._deserialize) + + async def _send_request(self, http_request: HttpRequest, **kwargs: Any) -> AsyncHttpResponse: + """Runs the network request through the client's chained policies. + + :param http_request: The network request you want to make. Required. + :type http_request: ~azure.core.pipeline.transport.HttpRequest + :keyword bool stream: Whether the response payload will be streamed. Defaults to True. + :return: The response of your network call. Does not do error handling on your response. + :rtype: ~azure.core.pipeline.transport.AsyncHttpResponse + """ + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + http_request.url = self._client.format_url(http_request.url, **path_format_arguments) + stream = kwargs.pop("stream", True) + pipeline_response = await self._client._pipeline.run(http_request, stream=stream, **kwargs) + return pipeline_response.http_response + + 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/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2021_02_01_preview/aio/operations/__init__.py b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2021_02_01_preview/aio/operations/__init__.py new file mode 100644 index 000000000000..d70057be6458 --- /dev/null +++ b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2021_02_01_preview/aio/operations/__init__.py @@ -0,0 +1,47 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from ._operations import Operations +from ._available_skus_operations import AvailableSkusOperations +from ._devices_operations import DevicesOperations +from ._alerts_operations import AlertsOperations +from ._bandwidth_schedules_operations import BandwidthSchedulesOperations +from ._jobs_operations import JobsOperations +from ._nodes_operations import NodesOperations +from ._operations_status_operations import OperationsStatusOperations +from ._orders_operations import OrdersOperations +from ._roles_operations import RolesOperations +from ._addons_operations import AddonsOperations +from ._monitoring_config_operations import MonitoringConfigOperations +from ._shares_operations import SharesOperations +from ._storage_account_credentials_operations import StorageAccountCredentialsOperations +from ._storage_accounts_operations import StorageAccountsOperations +from ._containers_operations import ContainersOperations +from ._triggers_operations import TriggersOperations +from ._users_operations import UsersOperations + +__all__ = [ + 'Operations', + 'AvailableSkusOperations', + 'DevicesOperations', + 'AlertsOperations', + 'BandwidthSchedulesOperations', + 'JobsOperations', + 'NodesOperations', + 'OperationsStatusOperations', + 'OrdersOperations', + 'RolesOperations', + 'AddonsOperations', + 'MonitoringConfigOperations', + 'SharesOperations', + 'StorageAccountCredentialsOperations', + 'StorageAccountsOperations', + 'ContainersOperations', + 'TriggersOperations', + 'UsersOperations', +] diff --git a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2021_02_01_preview/aio/operations/_addons_operations.py b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2021_02_01_preview/aio/operations/_addons_operations.py new file mode 100644 index 000000000000..86afe57c3d9a --- /dev/null +++ b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2021_02_01_preview/aio/operations/_addons_operations.py @@ -0,0 +1,450 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling + +from ... import models as _models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class AddonsOperations: + """AddonsOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.databoxedge.v2021_02_01_preview.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list_by_role( + self, + device_name: str, + role_name: str, + resource_group_name: str, + **kwargs + ) -> AsyncIterable["_models.AddonList"]: + """Lists all the addons configured in the role. + + :param device_name: The device name. + :type device_name: str + :param role_name: The role name. + :type role_name: str + :param resource_group_name: The resource group name. + :type resource_group_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either AddonList or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.databoxedge.v2021_02_01_preview.models.AddonList] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.AddonList"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01-preview" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_by_role.metadata['url'] # type: ignore + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'roleName': self._serialize.url("role_name", role_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('AddonList', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_by_role.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/roles/{roleName}/addons'} # type: ignore + + async def get( + self, + device_name: str, + role_name: str, + addon_name: str, + resource_group_name: str, + **kwargs + ) -> "_models.Addon": + """Gets a specific addon by name. + + :param device_name: The device name. + :type device_name: str + :param role_name: The role name. + :type role_name: str + :param addon_name: The addon name. + :type addon_name: str + :param resource_group_name: The resource group name. + :type resource_group_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: Addon, or the result of cls(response) + :rtype: ~azure.mgmt.databoxedge.v2021_02_01_preview.models.Addon + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.Addon"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01-preview" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'roleName': self._serialize.url("role_name", role_name, 'str'), + 'addonName': self._serialize.url("addon_name", addon_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('Addon', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/roles/{roleName}/addons/{addonName}'} # type: ignore + + async def _create_or_update_initial( + self, + device_name: str, + role_name: str, + addon_name: str, + resource_group_name: str, + addon: "_models.Addon", + **kwargs + ) -> Optional["_models.Addon"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.Addon"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01-preview" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._create_or_update_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'roleName': self._serialize.url("role_name", role_name, 'str'), + 'addonName': self._serialize.url("addon_name", addon_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(addon, 'Addon') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('Addon', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/roles/{roleName}/addons/{addonName}'} # type: ignore + + async def begin_create_or_update( + self, + device_name: str, + role_name: str, + addon_name: str, + resource_group_name: str, + addon: "_models.Addon", + **kwargs + ) -> AsyncLROPoller["_models.Addon"]: + """Create or update a addon. + + :param device_name: The device name. + :type device_name: str + :param role_name: The role name. + :type role_name: str + :param addon_name: The addon name. + :type addon_name: str + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param addon: The addon properties. + :type addon: ~azure.mgmt.databoxedge.v2021_02_01_preview.models.Addon + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: Pass in True if you'd like the AsyncARMPolling polling method, + False for no polling, or your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either Addon or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.databoxedge.v2021_02_01_preview.models.Addon] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Addon"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._create_or_update_initial( + device_name=device_name, + role_name=role_name, + addon_name=addon_name, + resource_group_name=resource_group_name, + addon=addon, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('Addon', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'roleName': self._serialize.url("role_name", role_name, 'str'), + 'addonName': self._serialize.url("addon_name", addon_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/roles/{roleName}/addons/{addonName}'} # type: ignore + + async def _delete_initial( + self, + device_name: str, + role_name: str, + addon_name: str, + resource_group_name: str, + **kwargs + ) -> None: + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01-preview" + accept = "application/json" + + # Construct URL + url = self._delete_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'roleName': self._serialize.url("role_name", role_name, 'str'), + 'addonName': self._serialize.url("addon_name", addon_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/roles/{roleName}/addons/{addonName}'} # type: ignore + + async def begin_delete( + self, + device_name: str, + role_name: str, + addon_name: str, + resource_group_name: str, + **kwargs + ) -> AsyncLROPoller[None]: + """Deletes the addon on the device. + + :param device_name: The device name. + :type device_name: str + :param role_name: The role name. + :type role_name: str + :param addon_name: The addon name. + :type addon_name: str + :param resource_group_name: The resource group name. + :type resource_group_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: Pass in True if you'd like the AsyncARMPolling polling method, + False for no polling, or your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._delete_initial( + device_name=device_name, + role_name=role_name, + addon_name=addon_name, + resource_group_name=resource_group_name, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'roleName': self._serialize.url("role_name", role_name, 'str'), + 'addonName': self._serialize.url("addon_name", addon_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/roles/{roleName}/addons/{addonName}'} # type: ignore diff --git a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2021_02_01_preview/aio/operations/_alerts_operations.py b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2021_02_01_preview/aio/operations/_alerts_operations.py new file mode 100644 index 000000000000..bf5ecb55d5f5 --- /dev/null +++ b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2021_02_01_preview/aio/operations/_alerts_operations.py @@ -0,0 +1,180 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.mgmt.core.exceptions import ARMErrorFormat + +from ... import models as _models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class AlertsOperations: + """AlertsOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.databoxedge.v2021_02_01_preview.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[~azure.mgmt.databoxedge.v2021_02_01_preview.models.AlertList] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.AlertList"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01-preview" + 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: ~azure.mgmt.databoxedge.v2021_02_01_preview.models.Alert + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.Alert"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01-preview" + 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/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2021_02_01_preview/aio/operations/_available_skus_operations.py b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2021_02_01_preview/aio/operations/_available_skus_operations.py new file mode 100644 index 000000000000..020b0d430244 --- /dev/null +++ b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2021_02_01_preview/aio/operations/_available_skus_operations.py @@ -0,0 +1,110 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.mgmt.core.exceptions import ARMErrorFormat + +from ... import models as _models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class AvailableSkusOperations: + """AvailableSkusOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.databoxedge.v2021_02_01_preview.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list( + self, + **kwargs + ) -> AsyncIterable["_models.DataBoxEdgeSkuList"]: + """List all the available Skus and information related to them. + + List all the available Skus and information related to them. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either DataBoxEdgeSkuList or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.databoxedge.v2021_02_01_preview.models.DataBoxEdgeSkuList] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.DataBoxEdgeSkuList"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01-preview" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('DataBoxEdgeSkuList', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.DataBoxEdge/availableSkus'} # type: ignore diff --git a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2021_02_01_preview/aio/operations/_bandwidth_schedules_operations.py b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2021_02_01_preview/aio/operations/_bandwidth_schedules_operations.py new file mode 100644 index 000000000000..d03f2c936a6c --- /dev/null +++ b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2021_02_01_preview/aio/operations/_bandwidth_schedules_operations.py @@ -0,0 +1,428 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling + +from ... import models as _models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class BandwidthSchedulesOperations: + """BandwidthSchedulesOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.databoxedge.v2021_02_01_preview.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[~azure.mgmt.databoxedge.v2021_02_01_preview.models.BandwidthSchedulesList] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.BandwidthSchedulesList"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01-preview" + 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: ~azure.mgmt.databoxedge.v2021_02_01_preview.models.BandwidthSchedule + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.BandwidthSchedule"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01-preview" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('BandwidthSchedule', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/bandwidthSchedules/{name}'} # type: ignore + + async def _create_or_update_initial( + self, + device_name: str, + name: str, + resource_group_name: str, + parameters: "_models.BandwidthSchedule", + **kwargs + ) -> Optional["_models.BandwidthSchedule"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.BandwidthSchedule"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01-preview" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._create_or_update_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, 'BandwidthSchedule') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('BandwidthSchedule', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/bandwidthSchedules/{name}'} # type: ignore + + async def begin_create_or_update( + self, + device_name: str, + name: str, + resource_group_name: str, + parameters: "_models.BandwidthSchedule", + **kwargs + ) -> AsyncLROPoller["_models.BandwidthSchedule"]: + """Creates or updates a bandwidth schedule. + + :param device_name: The device name. + :type device_name: str + :param name: The bandwidth schedule name which needs to be added/updated. + :type name: str + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param parameters: The bandwidth schedule to be added or updated. + :type parameters: ~azure.mgmt.databoxedge.v2021_02_01_preview.models.BandwidthSchedule + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: Pass in True if you'd like the AsyncARMPolling polling method, + False for no polling, or your own initialized polling object for a 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[~azure.mgmt.databoxedge.v2021_02_01_preview.models.BandwidthSchedule] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.BandwidthSchedule"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._create_or_update_initial( + device_name=device_name, + name=name, + resource_group_name=resource_group_name, + parameters=parameters, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('BandwidthSchedule', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/bandwidthSchedules/{name}'} # type: ignore + + async def _delete_initial( + self, + device_name: str, + name: str, + resource_group_name: str, + **kwargs + ) -> None: + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01-preview" + 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: Pass in True if you'd like the AsyncARMPolling polling method, + False for no polling, or your own initialized polling object for a 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/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2021_02_01_preview/aio/operations/_containers_operations.py b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2021_02_01_preview/aio/operations/_containers_operations.py new file mode 100644 index 000000000000..db42d8f6017f --- /dev/null +++ b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2021_02_01_preview/aio/operations/_containers_operations.py @@ -0,0 +1,580 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling + +from ... import models as _models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class ContainersOperations: + """ContainersOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.databoxedge.v2021_02_01_preview.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[~azure.mgmt.databoxedge.v2021_02_01_preview.models.ContainerList] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ContainerList"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01-preview" + 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: ~azure.mgmt.databoxedge.v2021_02_01_preview.models.Container + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.Container"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01-preview" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'storageAccountName': self._serialize.url("storage_account_name", storage_account_name, 'str'), + 'containerName': self._serialize.url("container_name", container_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('Container', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/storageAccounts/{storageAccountName}/containers/{containerName}'} # type: ignore + + async def _create_or_update_initial( + self, + device_name: str, + storage_account_name: str, + container_name: str, + resource_group_name: str, + container: "_models.Container", + **kwargs + ) -> Optional["_models.Container"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.Container"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01-preview" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._create_or_update_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'storageAccountName': self._serialize.url("storage_account_name", storage_account_name, 'str'), + 'containerName': self._serialize.url("container_name", container_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(container, 'Container') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('Container', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/storageAccounts/{storageAccountName}/containers/{containerName}'} # type: ignore + + async def begin_create_or_update( + self, + device_name: str, + storage_account_name: str, + container_name: str, + resource_group_name: str, + container: "_models.Container", + **kwargs + ) -> AsyncLROPoller["_models.Container"]: + """Creates a new container or updates an existing container on the device. + + Creates a new container or updates an existing container on the device. + + :param device_name: The device name. + :type device_name: str + :param storage_account_name: The Storage Account Name. + :type storage_account_name: str + :param container_name: The container name. + :type container_name: str + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param container: The container properties. + :type container: ~azure.mgmt.databoxedge.v2021_02_01_preview.models.Container + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: Pass in True if you'd like the AsyncARMPolling polling method, + False for no polling, or your own initialized polling object for a 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[~azure.mgmt.databoxedge.v2021_02_01_preview.models.Container] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Container"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._create_or_update_initial( + device_name=device_name, + storage_account_name=storage_account_name, + container_name=container_name, + resource_group_name=resource_group_name, + container=container, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('Container', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'storageAccountName': self._serialize.url("storage_account_name", storage_account_name, 'str'), + 'containerName': self._serialize.url("container_name", container_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/storageAccounts/{storageAccountName}/containers/{containerName}'} # type: ignore + + async def _delete_initial( + self, + device_name: str, + storage_account_name: str, + container_name: str, + resource_group_name: str, + **kwargs + ) -> None: + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01-preview" + 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: Pass in True if you'd like the AsyncARMPolling polling method, + False for no polling, or your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._delete_initial( + device_name=device_name, + storage_account_name=storage_account_name, + container_name=container_name, + resource_group_name=resource_group_name, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'storageAccountName': self._serialize.url("storage_account_name", storage_account_name, 'str'), + 'containerName': self._serialize.url("container_name", container_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/storageAccounts/{storageAccountName}/containers/{containerName}'} # type: ignore + + async def _refresh_initial( + self, + device_name: str, + storage_account_name: str, + container_name: str, + resource_group_name: str, + **kwargs + ) -> None: + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01-preview" + 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: Pass in True if you'd like the AsyncARMPolling polling method, + False for no polling, or your own initialized polling object for a 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/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2021_02_01_preview/aio/operations/_devices_operations.py b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2021_02_01_preview/aio/operations/_devices_operations.py new file mode 100644 index 000000000000..f7ed6510a9d8 --- /dev/null +++ b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2021_02_01_preview/aio/operations/_devices_operations.py @@ -0,0 +1,1363 @@ +# 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 as _models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class DevicesOperations: + """DevicesOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.databoxedge.v2021_02_01_preview.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[~azure.mgmt.databoxedge.v2021_02_01_preview.models.DataBoxEdgeDeviceList] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.DataBoxEdgeDeviceList"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01-preview" + 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[~azure.mgmt.databoxedge.v2021_02_01_preview.models.DataBoxEdgeDeviceList] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.DataBoxEdgeDeviceList"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01-preview" + 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: ~azure.mgmt.databoxedge.v2021_02_01_preview.models.DataBoxEdgeDevice + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.DataBoxEdgeDevice"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01-preview" + 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, + data_box_edge_device: "_models.DataBoxEdgeDevice", + **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', {})) + api_version = "2021-02-01-preview" + 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, + data_box_edge_device: "_models.DataBoxEdgeDevice", + **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 data_box_edge_device: The resource object. + :type data_box_edge_device: ~azure.mgmt.databoxedge.v2021_02_01_preview.models.DataBoxEdgeDevice + :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: Pass in True if you'd like the AsyncARMPolling polling method, + False for no polling, or your own initialized polling object for a 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[~azure.mgmt.databoxedge.v2021_02_01_preview.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, + data_box_edge_device=data_box_edge_device, + 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 = "2021-02-01-preview" + 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: Pass in True if you'd like the AsyncARMPolling polling method, + False for no polling, or your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._delete_initial( + device_name=device_name, + resource_group_name=resource_group_name, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}'} # type: ignore + + async def update( + self, + device_name: str, + resource_group_name: str, + parameters: "_models.DataBoxEdgeDevicePatch", + **kwargs + ) -> "_models.DataBoxEdgeDevice": + """Modifies a Data Box Edge/Data Box Gateway resource. + + :param device_name: The device name. + :type device_name: str + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param parameters: The resource parameters. + :type parameters: ~azure.mgmt.databoxedge.v2021_02_01_preview.models.DataBoxEdgeDevicePatch + :keyword callable cls: A custom type or function that will be passed the direct response + :return: DataBoxEdgeDevice, or the result of cls(response) + :rtype: ~azure.mgmt.databoxedge.v2021_02_01_preview.models.DataBoxEdgeDevice + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.DataBoxEdgeDevice"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01-preview" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update.metadata['url'] # type: ignore + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, 'DataBoxEdgeDevicePatch') + body_content_kwargs['content'] = body_content + request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('DataBoxEdgeDevice', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}'} # type: ignore + + async def _download_updates_initial( + self, + device_name: str, + resource_group_name: str, + **kwargs + ) -> None: + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01-preview" + accept = "application/json" + + # Construct URL + url = self._download_updates_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _download_updates_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/downloadUpdates'} # type: ignore + + async def begin_download_updates( + self, + device_name: str, + resource_group_name: str, + **kwargs + ) -> AsyncLROPoller[None]: + """Downloads the updates on a Data Box Edge/Data Box Gateway device. + + Downloads the updates on a Data Box Edge/Data Box Gateway device. + + :param device_name: The device name. + :type device_name: str + :param resource_group_name: The resource group name. + :type resource_group_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: Pass in True if you'd like the AsyncARMPolling polling method, + False for no polling, or your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._download_updates_initial( + device_name=device_name, + resource_group_name=resource_group_name, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_download_updates.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/downloadUpdates'} # type: ignore + + async def generate_certificate( + self, + device_name: str, + resource_group_name: str, + **kwargs + ) -> "_models.GenerateCertResponse": + """Generates certificate for activation key. + + :param device_name: The device name. + :type device_name: str + :param resource_group_name: The resource group name. + :type resource_group_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: GenerateCertResponse, or the result of cls(response) + :rtype: ~azure.mgmt.databoxedge.v2021_02_01_preview.models.GenerateCertResponse + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.GenerateCertResponse"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01-preview" + accept = "application/json" + + # Construct URL + url = self.generate_certificate.metadata['url'] # type: ignore + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('GenerateCertResponse', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + generate_certificate.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/generateCertificate'} # type: ignore + + async def get_extended_information( + self, + device_name: str, + resource_group_name: str, + **kwargs + ) -> "_models.DataBoxEdgeDeviceExtendedInfo": + """Gets additional information for the specified Azure Stack Edge/Data Box Gateway device. + + :param device_name: The device name. + :type device_name: str + :param resource_group_name: The resource group name. + :type resource_group_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: DataBoxEdgeDeviceExtendedInfo, or the result of cls(response) + :rtype: ~azure.mgmt.databoxedge.v2021_02_01_preview.models.DataBoxEdgeDeviceExtendedInfo + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.DataBoxEdgeDeviceExtendedInfo"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01-preview" + accept = "application/json" + + # Construct URL + url = self.get_extended_information.metadata['url'] # type: ignore + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('DataBoxEdgeDeviceExtendedInfo', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_extended_information.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/getExtendedInformation'} # type: ignore + + async def _install_updates_initial( + self, + device_name: str, + resource_group_name: str, + **kwargs + ) -> None: + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01-preview" + accept = "application/json" + + # Construct URL + url = self._install_updates_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _install_updates_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/installUpdates'} # type: ignore + + async def begin_install_updates( + self, + device_name: str, + resource_group_name: str, + **kwargs + ) -> AsyncLROPoller[None]: + """Installs the updates on the Data Box Edge/Data Box Gateway device. + + Installs the updates on the Data Box Edge/Data Box Gateway device. + + :param device_name: The device name. + :type device_name: str + :param resource_group_name: The resource group name. + :type resource_group_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: Pass in True if you'd like the AsyncARMPolling polling method, + False for no polling, or your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._install_updates_initial( + device_name=device_name, + resource_group_name=resource_group_name, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_install_updates.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/installUpdates'} # type: ignore + + async def get_network_settings( + self, + device_name: str, + resource_group_name: str, + **kwargs + ) -> "_models.NetworkSettings": + """Gets the network settings of the specified Data Box Edge/Data Box Gateway device. + + :param device_name: The device name. + :type device_name: str + :param resource_group_name: The resource group name. + :type resource_group_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: NetworkSettings, or the result of cls(response) + :rtype: ~azure.mgmt.databoxedge.v2021_02_01_preview.models.NetworkSettings + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkSettings"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01-preview" + accept = "application/json" + + # Construct URL + url = self.get_network_settings.metadata['url'] # type: ignore + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('NetworkSettings', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_network_settings.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/networkSettings/default'} # type: ignore + + async def _scan_for_updates_initial( + self, + device_name: str, + resource_group_name: str, + **kwargs + ) -> None: + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01-preview" + accept = "application/json" + + # Construct URL + url = self._scan_for_updates_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _scan_for_updates_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/scanForUpdates'} # type: ignore + + async def begin_scan_for_updates( + self, + device_name: str, + resource_group_name: str, + **kwargs + ) -> AsyncLROPoller[None]: + """Scans for updates on a Data Box Edge/Data Box Gateway device. + + Scans for updates on a Data Box Edge/Data Box Gateway device. + + :param device_name: The device name. + :type device_name: str + :param resource_group_name: The resource group name. + :type resource_group_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: Pass in True if you'd like the AsyncARMPolling polling method, + False for no polling, or your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._scan_for_updates_initial( + device_name=device_name, + resource_group_name=resource_group_name, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_scan_for_updates.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/scanForUpdates'} # type: ignore + + async def _create_or_update_security_settings_initial( + self, + device_name: str, + resource_group_name: str, + security_settings: "_models.SecuritySettings", + **kwargs + ) -> None: + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01-preview" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._create_or_update_security_settings_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(security_settings, 'SecuritySettings') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _create_or_update_security_settings_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/securitySettings/default/update'} # type: ignore + + async def begin_create_or_update_security_settings( + self, + device_name: str, + resource_group_name: str, + security_settings: "_models.SecuritySettings", + **kwargs + ) -> AsyncLROPoller[None]: + """Updates the security settings on a Data Box Edge/Data Box Gateway device. + + :param device_name: The device name. + :type device_name: str + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param security_settings: The security settings. + :type security_settings: ~azure.mgmt.databoxedge.v2021_02_01_preview.models.SecuritySettings + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: Pass in True if you'd like the AsyncARMPolling polling method, + False for no polling, or your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._create_or_update_security_settings_initial( + device_name=device_name, + resource_group_name=resource_group_name, + security_settings=security_settings, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create_or_update_security_settings.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/securitySettings/default/update'} # type: ignore + + async def update_extended_information( + self, + device_name: str, + resource_group_name: str, + parameters: "_models.DataBoxEdgeDeviceExtendedInfoPatch", + **kwargs + ) -> "_models.DataBoxEdgeDeviceExtendedInfo": + """Gets additional information for the specified Data Box Edge/Data Box Gateway device. + + :param device_name: The device name. + :type device_name: str + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param parameters: The patch object. + :type parameters: ~azure.mgmt.databoxedge.v2021_02_01_preview.models.DataBoxEdgeDeviceExtendedInfoPatch + :keyword callable cls: A custom type or function that will be passed the direct response + :return: DataBoxEdgeDeviceExtendedInfo, or the result of cls(response) + :rtype: ~azure.mgmt.databoxedge.v2021_02_01_preview.models.DataBoxEdgeDeviceExtendedInfo + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.DataBoxEdgeDeviceExtendedInfo"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01-preview" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update_extended_information.metadata['url'] # type: ignore + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, 'DataBoxEdgeDeviceExtendedInfoPatch') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('DataBoxEdgeDeviceExtendedInfo', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update_extended_information.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/updateExtendedInformation'} # type: ignore + + async def get_update_summary( + self, + device_name: str, + resource_group_name: str, + **kwargs + ) -> "_models.UpdateSummary": + """Gets information about the availability of updates based on the last scan of the device. It also gets information about any ongoing download or install jobs on the device. + + Gets information about the availability of updates based on the last scan of the device. It + also gets information about any ongoing download or install jobs on the device. + + :param device_name: The device name. + :type device_name: str + :param resource_group_name: The resource group name. + :type resource_group_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: UpdateSummary, or the result of cls(response) + :rtype: ~azure.mgmt.databoxedge.v2021_02_01_preview.models.UpdateSummary + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.UpdateSummary"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01-preview" + accept = "application/json" + + # Construct URL + url = self.get_update_summary.metadata['url'] # type: ignore + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('UpdateSummary', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_update_summary.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/updateSummary/default'} # type: ignore + + async def upload_certificate( + self, + device_name: str, + resource_group_name: str, + parameters: "_models.UploadCertificateRequest", + **kwargs + ) -> "_models.UploadCertificateResponse": + """Uploads registration certificate for the device. + + :param device_name: The device name. + :type device_name: str + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param parameters: The upload certificate request. + :type parameters: ~azure.mgmt.databoxedge.v2021_02_01_preview.models.UploadCertificateRequest + :keyword callable cls: A custom type or function that will be passed the direct response + :return: UploadCertificateResponse, or the result of cls(response) + :rtype: ~azure.mgmt.databoxedge.v2021_02_01_preview.models.UploadCertificateResponse + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.UploadCertificateResponse"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01-preview" + 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/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2021_02_01_preview/aio/operations/_jobs_operations.py b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2021_02_01_preview/aio/operations/_jobs_operations.py new file mode 100644 index 000000000000..5ceed56b4b62 --- /dev/null +++ b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2021_02_01_preview/aio/operations/_jobs_operations.py @@ -0,0 +1,105 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, Callable, Dict, Generic, Optional, TypeVar +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.mgmt.core.exceptions import ARMErrorFormat + +from ... import models as _models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class JobsOperations: + """JobsOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.databoxedge.v2021_02_01_preview.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: ~azure.mgmt.databoxedge.v2021_02_01_preview.models.Job + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.Job"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01-preview" + 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/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2021_02_01_preview/aio/operations/_monitoring_config_operations.py b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2021_02_01_preview/aio/operations/_monitoring_config_operations.py new file mode 100644 index 000000000000..dfc0baf622f3 --- /dev/null +++ b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2021_02_01_preview/aio/operations/_monitoring_config_operations.py @@ -0,0 +1,440 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling + +from ... import models as _models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class MonitoringConfigOperations: + """MonitoringConfigOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.databoxedge.v2021_02_01_preview.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list( + self, + device_name: str, + role_name: str, + resource_group_name: str, + **kwargs + ) -> AsyncIterable["_models.MonitoringMetricConfigurationList"]: + """Lists metric configurations in a role. + + Lists metric configurations in a role. + + :param device_name: The device name. + :type device_name: str + :param role_name: The role name. + :type role_name: str + :param resource_group_name: The resource group name. + :type resource_group_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either MonitoringMetricConfigurationList or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.databoxedge.v2021_02_01_preview.models.MonitoringMetricConfigurationList] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.MonitoringMetricConfigurationList"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01-preview" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list.metadata['url'] # type: ignore + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'roleName': self._serialize.url("role_name", role_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('MonitoringMetricConfigurationList', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/roles/{roleName}/monitoringConfig'} # type: ignore + + async def get( + self, + device_name: str, + role_name: str, + resource_group_name: str, + **kwargs + ) -> "_models.MonitoringMetricConfiguration": + """Gets a metric configuration of a role. + + Gets a metric configuration of a role. + + :param device_name: The device name. + :type device_name: str + :param role_name: The role name. + :type role_name: str + :param resource_group_name: The resource group name. + :type resource_group_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: MonitoringMetricConfiguration, or the result of cls(response) + :rtype: ~azure.mgmt.databoxedge.v2021_02_01_preview.models.MonitoringMetricConfiguration + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.MonitoringMetricConfiguration"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01-preview" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'roleName': self._serialize.url("role_name", role_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('MonitoringMetricConfiguration', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/roles/{roleName}/monitoringConfig/default'} # type: ignore + + async def _create_or_update_initial( + self, + device_name: str, + role_name: str, + resource_group_name: str, + monitoring_metric_configuration: "_models.MonitoringMetricConfiguration", + **kwargs + ) -> Optional["_models.MonitoringMetricConfiguration"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.MonitoringMetricConfiguration"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01-preview" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._create_or_update_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'roleName': self._serialize.url("role_name", role_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(monitoring_metric_configuration, 'MonitoringMetricConfiguration') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('MonitoringMetricConfiguration', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/roles/{roleName}/monitoringConfig/default'} # type: ignore + + async def begin_create_or_update( + self, + device_name: str, + role_name: str, + resource_group_name: str, + monitoring_metric_configuration: "_models.MonitoringMetricConfiguration", + **kwargs + ) -> AsyncLROPoller["_models.MonitoringMetricConfiguration"]: + """Creates a new metric configuration or updates an existing one for a role. + + Creates a new metric configuration or updates an existing one for a role. + + :param device_name: The device name. + :type device_name: str + :param role_name: The role name. + :type role_name: str + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param monitoring_metric_configuration: The metric configuration. + :type monitoring_metric_configuration: ~azure.mgmt.databoxedge.v2021_02_01_preview.models.MonitoringMetricConfiguration + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: Pass in True if you'd like the AsyncARMPolling polling method, + False for no polling, or your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either MonitoringMetricConfiguration or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.databoxedge.v2021_02_01_preview.models.MonitoringMetricConfiguration] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.MonitoringMetricConfiguration"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._create_or_update_initial( + device_name=device_name, + role_name=role_name, + resource_group_name=resource_group_name, + monitoring_metric_configuration=monitoring_metric_configuration, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('MonitoringMetricConfiguration', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'roleName': self._serialize.url("role_name", role_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/roles/{roleName}/monitoringConfig/default'} # type: ignore + + async def _delete_initial( + self, + device_name: str, + role_name: str, + resource_group_name: str, + **kwargs + ) -> None: + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01-preview" + accept = "application/json" + + # Construct URL + url = self._delete_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'roleName': self._serialize.url("role_name", role_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/roles/{roleName}/monitoringConfig/default'} # type: ignore + + async def begin_delete( + self, + device_name: str, + role_name: str, + resource_group_name: str, + **kwargs + ) -> AsyncLROPoller[None]: + """deletes a new metric configuration for a role. + + deletes a new metric configuration for a role. + + :param device_name: The device name. + :type device_name: str + :param role_name: The role name. + :type role_name: str + :param resource_group_name: The resource group name. + :type resource_group_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: Pass in True if you'd like the AsyncARMPolling polling method, + False for no polling, or your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._delete_initial( + device_name=device_name, + role_name=role_name, + resource_group_name=resource_group_name, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'roleName': self._serialize.url("role_name", role_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/roles/{roleName}/monitoringConfig/default'} # type: ignore diff --git a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2021_02_01_preview/aio/operations/_nodes_operations.py b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2021_02_01_preview/aio/operations/_nodes_operations.py new file mode 100644 index 000000000000..58223a6302d1 --- /dev/null +++ b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2021_02_01_preview/aio/operations/_nodes_operations.py @@ -0,0 +1,116 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.mgmt.core.exceptions import ARMErrorFormat + +from ... import models as _models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class NodesOperations: + """NodesOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.databoxedge.v2021_02_01_preview.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[~azure.mgmt.databoxedge.v2021_02_01_preview.models.NodeList] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.NodeList"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01-preview" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_by_data_box_edge_device.metadata['url'] # type: ignore + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('NodeList', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_by_data_box_edge_device.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/nodes'} # type: ignore diff --git a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2021_02_01_preview/aio/operations/_operations.py b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2021_02_01_preview/aio/operations/_operations.py new file mode 100644 index 000000000000..16b0a070e9e5 --- /dev/null +++ b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2021_02_01_preview/aio/operations/_operations.py @@ -0,0 +1,106 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.mgmt.core.exceptions import ARMErrorFormat + +from ... import models as _models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class Operations: + """Operations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.databoxedge.v2021_02_01_preview.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[~azure.mgmt.databoxedge.v2021_02_01_preview.models.OperationsList] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationsList"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01-preview" + 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/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2021_02_01_preview/aio/operations/_operations_status_operations.py b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2021_02_01_preview/aio/operations/_operations_status_operations.py new file mode 100644 index 000000000000..56aa4ff163fc --- /dev/null +++ b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2021_02_01_preview/aio/operations/_operations_status_operations.py @@ -0,0 +1,105 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, Callable, Dict, Generic, Optional, TypeVar +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.mgmt.core.exceptions import ARMErrorFormat + +from ... import models as _models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class OperationsStatusOperations: + """OperationsStatusOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.databoxedge.v2021_02_01_preview.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: ~azure.mgmt.databoxedge.v2021_02_01_preview.models.Job + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.Job"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01-preview" + 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/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2021_02_01_preview/aio/operations/_orders_operations.py b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2021_02_01_preview/aio/operations/_orders_operations.py new file mode 100644 index 000000000000..6a0ff451ec52 --- /dev/null +++ b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2021_02_01_preview/aio/operations/_orders_operations.py @@ -0,0 +1,478 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling + +from ... import models as _models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class OrdersOperations: + """OrdersOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.databoxedge.v2021_02_01_preview.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[~azure.mgmt.databoxedge.v2021_02_01_preview.models.OrderList] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.OrderList"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01-preview" + 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: ~azure.mgmt.databoxedge.v2021_02_01_preview.models.Order + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.Order"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01-preview" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('Order', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/orders/default'} # type: ignore + + async def _create_or_update_initial( + self, + device_name: str, + resource_group_name: str, + order: "_models.Order", + **kwargs + ) -> Optional["_models.Order"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.Order"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01-preview" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._create_or_update_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(order, 'Order') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('Order', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/orders/default'} # type: ignore + + async def begin_create_or_update( + self, + device_name: str, + resource_group_name: str, + order: "_models.Order", + **kwargs + ) -> AsyncLROPoller["_models.Order"]: + """Creates or updates an order. + + Creates or updates an order. + + :param device_name: The order details of a device. + :type device_name: str + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param order: The order to be created or updated. + :type order: ~azure.mgmt.databoxedge.v2021_02_01_preview.models.Order + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: Pass in True if you'd like the AsyncARMPolling polling method, + False for no polling, or your own initialized polling object for a 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[~azure.mgmt.databoxedge.v2021_02_01_preview.models.Order] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Order"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._create_or_update_initial( + device_name=device_name, + resource_group_name=resource_group_name, + order=order, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('Order', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/orders/default'} # type: ignore + + async def _delete_initial( + self, + device_name: str, + resource_group_name: str, + **kwargs + ) -> None: + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01-preview" + 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: Pass in True if you'd like the AsyncARMPolling polling method, + False for no polling, or your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._delete_initial( + device_name=device_name, + resource_group_name=resource_group_name, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/orders/default'} # type: ignore + + async def list_dc_access_code( + self, + device_name: str, + resource_group_name: str, + **kwargs + ) -> "_models.DCAccessCode": + """Gets the DCAccess Code. + + Gets the DCAccess Code. + + :param device_name: The device name. + :type device_name: str + :param resource_group_name: The resource group name. + :type resource_group_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: DCAccessCode, or the result of cls(response) + :rtype: ~azure.mgmt.databoxedge.v2021_02_01_preview.models.DCAccessCode + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.DCAccessCode"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01-preview" + accept = "application/json" + + # Construct URL + url = self.list_dc_access_code.metadata['url'] # type: ignore + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('DCAccessCode', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + list_dc_access_code.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/orders/default/listDCAccessCode'} # type: ignore diff --git a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2021_02_01_preview/aio/operations/_roles_operations.py b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2021_02_01_preview/aio/operations/_roles_operations.py new file mode 100644 index 000000000000..48018de5770a --- /dev/null +++ b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2021_02_01_preview/aio/operations/_roles_operations.py @@ -0,0 +1,428 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling + +from ... import models as _models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class RolesOperations: + """RolesOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.databoxedge.v2021_02_01_preview.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[~azure.mgmt.databoxedge.v2021_02_01_preview.models.RoleList] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.RoleList"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01-preview" + 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: ~azure.mgmt.databoxedge.v2021_02_01_preview.models.Role + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.Role"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01-preview" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('Role', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/roles/{name}'} # type: ignore + + async def _create_or_update_initial( + self, + device_name: str, + name: str, + resource_group_name: str, + role: "_models.Role", + **kwargs + ) -> Optional["_models.Role"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.Role"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01-preview" + 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: ~azure.mgmt.databoxedge.v2021_02_01_preview.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: Pass in True if you'd like the AsyncARMPolling polling method, + False for no polling, or your own initialized polling object for a 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[~azure.mgmt.databoxedge.v2021_02_01_preview.models.Role] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Role"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._create_or_update_initial( + device_name=device_name, + name=name, + resource_group_name=resource_group_name, + role=role, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('Role', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/roles/{name}'} # type: ignore + + async def _delete_initial( + self, + device_name: str, + name: str, + resource_group_name: str, + **kwargs + ) -> None: + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01-preview" + 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: Pass in True if you'd like the AsyncARMPolling polling method, + False for no polling, or your own initialized polling object for a 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/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2021_02_01_preview/aio/operations/_shares_operations.py b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2021_02_01_preview/aio/operations/_shares_operations.py new file mode 100644 index 000000000000..f8b3bcb3f44a --- /dev/null +++ b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2021_02_01_preview/aio/operations/_shares_operations.py @@ -0,0 +1,551 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling + +from ... import models as _models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class SharesOperations: + """SharesOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.databoxedge.v2021_02_01_preview.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[~azure.mgmt.databoxedge.v2021_02_01_preview.models.ShareList] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ShareList"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01-preview" + 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: ~azure.mgmt.databoxedge.v2021_02_01_preview.models.Share + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.Share"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01-preview" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('Share', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/shares/{name}'} # type: ignore + + async def _create_or_update_initial( + self, + device_name: str, + name: str, + resource_group_name: str, + share: "_models.Share", + **kwargs + ) -> Optional["_models.Share"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.Share"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01-preview" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._create_or_update_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(share, 'Share') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('Share', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/shares/{name}'} # type: ignore + + async def begin_create_or_update( + self, + device_name: str, + name: str, + resource_group_name: str, + share: "_models.Share", + **kwargs + ) -> AsyncLROPoller["_models.Share"]: + """Creates a new share or updates an existing share on the device. + + Creates a new share or updates an existing share on the device. + + :param device_name: The device name. + :type device_name: str + :param name: The share name. + :type name: str + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param share: The share properties. + :type share: ~azure.mgmt.databoxedge.v2021_02_01_preview.models.Share + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: Pass in True if you'd like the AsyncARMPolling polling method, + False for no polling, or your own initialized polling object for a 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[~azure.mgmt.databoxedge.v2021_02_01_preview.models.Share] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Share"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._create_or_update_initial( + device_name=device_name, + name=name, + resource_group_name=resource_group_name, + share=share, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('Share', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/shares/{name}'} # type: ignore + + async def _delete_initial( + self, + device_name: str, + name: str, + resource_group_name: str, + **kwargs + ) -> None: + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01-preview" + 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: Pass in True if you'd like the AsyncARMPolling polling method, + False for no polling, or your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._delete_initial( + device_name=device_name, + name=name, + resource_group_name=resource_group_name, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/shares/{name}'} # type: ignore + + async def _refresh_initial( + self, + device_name: str, + name: str, + resource_group_name: str, + **kwargs + ) -> None: + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01-preview" + 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: Pass in True if you'd like the AsyncARMPolling polling method, + False for no polling, or your own initialized polling object for a 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/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2021_02_01_preview/aio/operations/_storage_account_credentials_operations.py b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2021_02_01_preview/aio/operations/_storage_account_credentials_operations.py new file mode 100644 index 000000000000..23af9ec14777 --- /dev/null +++ b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2021_02_01_preview/aio/operations/_storage_account_credentials_operations.py @@ -0,0 +1,430 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling + +from ... import models as _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: ~azure.mgmt.databoxedge.v2021_02_01_preview.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[~azure.mgmt.databoxedge.v2021_02_01_preview.models.StorageAccountCredentialList] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.StorageAccountCredentialList"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01-preview" + 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: ~azure.mgmt.databoxedge.v2021_02_01_preview.models.StorageAccountCredential + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.StorageAccountCredential"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01-preview" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('StorageAccountCredential', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/storageAccountCredentials/{name}'} # type: ignore + + async def _create_or_update_initial( + self, + device_name: str, + name: str, + resource_group_name: str, + storage_account_credential: "_models.StorageAccountCredential", + **kwargs + ) -> Optional["_models.StorageAccountCredential"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.StorageAccountCredential"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01-preview" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._create_or_update_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(storage_account_credential, 'StorageAccountCredential') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('StorageAccountCredential', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/storageAccountCredentials/{name}'} # type: ignore + + async def begin_create_or_update( + self, + device_name: str, + name: str, + resource_group_name: str, + storage_account_credential: "_models.StorageAccountCredential", + **kwargs + ) -> AsyncLROPoller["_models.StorageAccountCredential"]: + """Creates or updates the storage account credential. + + :param device_name: The device name. + :type device_name: str + :param name: The storage account credential name. + :type name: str + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param storage_account_credential: The storage account credential. + :type storage_account_credential: ~azure.mgmt.databoxedge.v2021_02_01_preview.models.StorageAccountCredential + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: Pass in True if you'd like the AsyncARMPolling polling method, + False for no polling, or your own initialized polling object for a 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[~azure.mgmt.databoxedge.v2021_02_01_preview.models.StorageAccountCredential] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.StorageAccountCredential"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._create_or_update_initial( + device_name=device_name, + name=name, + resource_group_name=resource_group_name, + storage_account_credential=storage_account_credential, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('StorageAccountCredential', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/storageAccountCredentials/{name}'} # type: ignore + + async def _delete_initial( + self, + device_name: str, + name: str, + resource_group_name: str, + **kwargs + ) -> None: + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01-preview" + 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: Pass in True if you'd like the AsyncARMPolling polling method, + False for no polling, or your own initialized polling object for a 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/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2021_02_01_preview/aio/operations/_storage_accounts_operations.py b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2021_02_01_preview/aio/operations/_storage_accounts_operations.py new file mode 100644 index 000000000000..f3e0964591b0 --- /dev/null +++ b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2021_02_01_preview/aio/operations/_storage_accounts_operations.py @@ -0,0 +1,434 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling + +from ... import models as _models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class StorageAccountsOperations: + """StorageAccountsOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.databoxedge.v2021_02_01_preview.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list_by_data_box_edge_device( + self, + device_name: str, + resource_group_name: str, + **kwargs + ) -> AsyncIterable["_models.StorageAccountList"]: + """Lists all the StorageAccounts in a Data Box Edge/Data Box Gateway device. + + Lists all the StorageAccounts in a Data Box Edge/Data Box Gateway device. + + :param device_name: The device name. + :type device_name: str + :param resource_group_name: The resource group name. + :type resource_group_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either StorageAccountList or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.databoxedge.v2021_02_01_preview.models.StorageAccountList] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.StorageAccountList"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01-preview" + 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: ~azure.mgmt.databoxedge.v2021_02_01_preview.models.StorageAccount + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.StorageAccount"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01-preview" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'storageAccountName': self._serialize.url("storage_account_name", storage_account_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('StorageAccount', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/storageAccounts/{storageAccountName}'} # type: ignore + + async def _create_or_update_initial( + self, + device_name: str, + storage_account_name: str, + resource_group_name: str, + storage_account: "_models.StorageAccount", + **kwargs + ) -> Optional["_models.StorageAccount"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.StorageAccount"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01-preview" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._create_or_update_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'storageAccountName': self._serialize.url("storage_account_name", storage_account_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(storage_account, 'StorageAccount') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('StorageAccount', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/storageAccounts/{storageAccountName}'} # type: ignore + + async def begin_create_or_update( + self, + device_name: str, + storage_account_name: str, + resource_group_name: str, + storage_account: "_models.StorageAccount", + **kwargs + ) -> AsyncLROPoller["_models.StorageAccount"]: + """Creates a new StorageAccount or updates an existing StorageAccount on the device. + + Creates a new StorageAccount or updates an existing StorageAccount on the device. + + :param device_name: The device name. + :type device_name: str + :param storage_account_name: The StorageAccount name. + :type storage_account_name: str + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param storage_account: The StorageAccount properties. + :type storage_account: ~azure.mgmt.databoxedge.v2021_02_01_preview.models.StorageAccount + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: Pass in True if you'd like the AsyncARMPolling polling method, + False for no polling, or your own initialized polling object for a 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[~azure.mgmt.databoxedge.v2021_02_01_preview.models.StorageAccount] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.StorageAccount"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._create_or_update_initial( + device_name=device_name, + storage_account_name=storage_account_name, + resource_group_name=resource_group_name, + storage_account=storage_account, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('StorageAccount', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'storageAccountName': self._serialize.url("storage_account_name", storage_account_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/storageAccounts/{storageAccountName}'} # type: ignore + + async def _delete_initial( + self, + device_name: str, + storage_account_name: str, + resource_group_name: str, + **kwargs + ) -> None: + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01-preview" + 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: Pass in True if you'd like the AsyncARMPolling polling method, + False for no polling, or your own initialized polling object for a 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/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2021_02_01_preview/aio/operations/_triggers_operations.py b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2021_02_01_preview/aio/operations/_triggers_operations.py new file mode 100644 index 000000000000..6f3140528c6f --- /dev/null +++ b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2021_02_01_preview/aio/operations/_triggers_operations.py @@ -0,0 +1,434 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling + +from ... import models as _models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class TriggersOperations: + """TriggersOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.databoxedge.v2021_02_01_preview.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[~azure.mgmt.databoxedge.v2021_02_01_preview.models.TriggerList] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.TriggerList"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01-preview" + 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: ~azure.mgmt.databoxedge.v2021_02_01_preview.models.Trigger + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.Trigger"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01-preview" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('Trigger', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/triggers/{name}'} # type: ignore + + async def _create_or_update_initial( + self, + device_name: str, + name: str, + resource_group_name: str, + trigger: "_models.Trigger", + **kwargs + ) -> Optional["_models.Trigger"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.Trigger"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01-preview" + 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: ~azure.mgmt.databoxedge.v2021_02_01_preview.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: Pass in True if you'd like the AsyncARMPolling polling method, + False for no polling, or your own initialized polling object for a 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[~azure.mgmt.databoxedge.v2021_02_01_preview.models.Trigger] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Trigger"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._create_or_update_initial( + device_name=device_name, + name=name, + resource_group_name=resource_group_name, + trigger=trigger, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('Trigger', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/triggers/{name}'} # type: ignore + + async def _delete_initial( + self, + device_name: str, + name: str, + resource_group_name: str, + **kwargs + ) -> None: + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01-preview" + 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: Pass in True if you'd like the AsyncARMPolling polling method, + False for no polling, or your own initialized polling object for a 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/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2021_02_01_preview/aio/operations/_users_operations.py b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2021_02_01_preview/aio/operations/_users_operations.py new file mode 100644 index 000000000000..ae5d2249538f --- /dev/null +++ b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2021_02_01_preview/aio/operations/_users_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 as _models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class UsersOperations: + """UsersOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.databoxedge.v2021_02_01_preview.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, + expand: 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 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 UserList or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.databoxedge.v2021_02_01_preview.models.UserList] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.UserList"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01-preview" + 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 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('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: ~azure.mgmt.databoxedge.v2021_02_01_preview.models.User + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.User"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01-preview" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('User', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/users/{name}'} # type: ignore + + async def _create_or_update_initial( + self, + device_name: str, + name: str, + resource_group_name: str, + user: "_models.User", + **kwargs + ) -> Optional["_models.User"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.User"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01-preview" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._create_or_update_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(user, 'User') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('User', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/users/{name}'} # type: ignore + + async def begin_create_or_update( + self, + device_name: str, + name: str, + resource_group_name: str, + user: "_models.User", + **kwargs + ) -> AsyncLROPoller["_models.User"]: + """Creates a new user or updates an existing user's information on a Data Box Edge/Data Box + Gateway device. + + :param device_name: The device name. + :type device_name: str + :param name: The user name. + :type name: str + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param user: The user details. + :type user: ~azure.mgmt.databoxedge.v2021_02_01_preview.models.User + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: Pass in True if you'd like the AsyncARMPolling polling method, + False for no polling, or your own initialized polling object for a 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[~azure.mgmt.databoxedge.v2021_02_01_preview.models.User] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.User"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._create_or_update_initial( + device_name=device_name, + name=name, + resource_group_name=resource_group_name, + user=user, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('User', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/users/{name}'} # type: ignore + + async def _delete_initial( + self, + device_name: str, + name: str, + resource_group_name: str, + **kwargs + ) -> None: + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01-preview" + 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: Pass in True if you'd like the AsyncARMPolling polling method, + False for no polling, or your own initialized polling object for a 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/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2021_02_01_preview/models/__init__.py b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2021_02_01_preview/models/__init__.py new file mode 100644 index 000000000000..427bbdbc0d20 --- /dev/null +++ b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2021_02_01_preview/models/__init__.py @@ -0,0 +1,488 @@ +# 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 ARMBaseModel + from ._models_py3 import Addon + from ._models_py3 import AddonList + from ._models_py3 import Address + from ._models_py3 import Alert + from ._models_py3 import AlertErrorDetails + from ._models_py3 import AlertList + from ._models_py3 import ArcAddon + from ._models_py3 import AsymmetricEncryptedSecret + from ._models_py3 import Authentication + from ._models_py3 import AzureContainerInfo + from ._models_py3 import BandwidthSchedule + from ._models_py3 import BandwidthSchedulesList + from ._models_py3 import ClientAccessRight + from ._models_py3 import CloudEdgeManagementRole + from ._models_py3 import CloudErrorBody + from ._models_py3 import CniConfig + from ._models_py3 import ComputeResource + from ._models_py3 import ContactDetails + from ._models_py3 import Container + from ._models_py3 import ContainerList + from ._models_py3 import DCAccessCode + from ._models_py3 import DataBoxEdgeDevice + from ._models_py3 import DataBoxEdgeDeviceExtendedInfo + from ._models_py3 import DataBoxEdgeDeviceExtendedInfoPatch + from ._models_py3 import DataBoxEdgeDeviceList + from ._models_py3 import DataBoxEdgeDevicePatch + from ._models_py3 import DataBoxEdgeMoveRequest + from ._models_py3 import DataBoxEdgeSku + from ._models_py3 import DataBoxEdgeSkuList + from ._models_py3 import EdgeProfile + from ._models_py3 import EdgeProfilePatch + from ._models_py3 import EdgeProfileSubscription + from ._models_py3 import EdgeProfileSubscriptionPatch + from ._models_py3 import EtcdInfo + from ._models_py3 import FileEventTrigger + from ._models_py3 import FileSourceInfo + from ._models_py3 import GenerateCertResponse + from ._models_py3 import ImageRepositoryCredential + from ._models_py3 import IoTAddon + from ._models_py3 import IoTDeviceInfo + from ._models_py3 import IoTEdgeAgentInfo + from ._models_py3 import IoTRole + from ._models_py3 import Ipv4Config + from ._models_py3 import Ipv6Config + from ._models_py3 import Job + from ._models_py3 import JobErrorDetails + from ._models_py3 import JobErrorItem + from ._models_py3 import KubernetesClusterInfo + from ._models_py3 import KubernetesIPConfiguration + from ._models_py3 import KubernetesRole + from ._models_py3 import KubernetesRoleCompute + from ._models_py3 import KubernetesRoleNetwork + from ._models_py3 import KubernetesRoleResources + from ._models_py3 import KubernetesRoleStorage + from ._models_py3 import KubernetesRoleStorageClassInfo + from ._models_py3 import LoadBalancerConfig + from ._models_py3 import MECRole + from ._models_py3 import MetricConfiguration + from ._models_py3 import MetricCounter + from ._models_py3 import MetricCounterSet + from ._models_py3 import MetricDimension + from ._models_py3 import MetricDimensionV1 + from ._models_py3 import MetricSpecificationV1 + from ._models_py3 import MonitoringMetricConfiguration + from ._models_py3 import MonitoringMetricConfigurationList + from ._models_py3 import MountPointMap + from ._models_py3 import NetworkAdapter + from ._models_py3 import NetworkAdapterPosition + from ._models_py3 import NetworkSettings + from ._models_py3 import Node + from ._models_py3 import NodeInfo + from ._models_py3 import NodeList + from ._models_py3 import Operation + from ._models_py3 import OperationDisplay + from ._models_py3 import OperationsList + from ._models_py3 import Order + from ._models_py3 import OrderList + from ._models_py3 import OrderStatus + from ._models_py3 import PeriodicTimerEventTrigger + from ._models_py3 import PeriodicTimerSourceInfo + from ._models_py3 import RefreshDetails + from ._models_py3 import ResourceIdentity + from ._models_py3 import ResourceMoveDetails + from ._models_py3 import ResourceTypeSku + from ._models_py3 import Role + from ._models_py3 import RoleList + from ._models_py3 import RoleSinkInfo + from ._models_py3 import Secret + from ._models_py3 import SecuritySettings + from ._models_py3 import ServiceSpecification + from ._models_py3 import Share + from ._models_py3 import ShareAccessRight + from ._models_py3 import ShareList + from ._models_py3 import Sku + from ._models_py3 import SkuCost + from ._models_py3 import SkuInformation + from ._models_py3 import SkuInformationList + from ._models_py3 import SkuLocationInfo + from ._models_py3 import StorageAccount + from ._models_py3 import StorageAccountCredential + from ._models_py3 import StorageAccountCredentialList + from ._models_py3 import StorageAccountList + from ._models_py3 import SubscriptionRegisteredFeatures + from ._models_py3 import SymmetricKey + from ._models_py3 import SystemData + from ._models_py3 import TrackingInfo + from ._models_py3 import Trigger + from ._models_py3 import TriggerList + from ._models_py3 import UpdateDetails + from ._models_py3 import UpdateDownloadProgress + from ._models_py3 import UpdateInstallProgress + from ._models_py3 import UpdateSummary + from ._models_py3 import UploadCertificateRequest + from ._models_py3 import UploadCertificateResponse + from ._models_py3 import User + from ._models_py3 import UserAccessRight + from ._models_py3 import UserList +except (SyntaxError, ImportError): + from ._models import ARMBaseModel # type: ignore + from ._models import Addon # type: ignore + from ._models import AddonList # type: ignore + from ._models import Address # type: ignore + from ._models import Alert # type: ignore + from ._models import AlertErrorDetails # type: ignore + from ._models import AlertList # type: ignore + from ._models import ArcAddon # type: ignore + from ._models import AsymmetricEncryptedSecret # type: ignore + from ._models import Authentication # type: ignore + from ._models import AzureContainerInfo # type: ignore + from ._models import BandwidthSchedule # type: ignore + from ._models import BandwidthSchedulesList # type: ignore + from ._models import ClientAccessRight # type: ignore + from ._models import CloudEdgeManagementRole # type: ignore + from ._models import CloudErrorBody # type: ignore + from ._models import CniConfig # type: ignore + from ._models import ComputeResource # type: ignore + from ._models import ContactDetails # type: ignore + from ._models import Container # type: ignore + from ._models import ContainerList # type: ignore + from ._models import DCAccessCode # type: ignore + from ._models import DataBoxEdgeDevice # type: ignore + from ._models import DataBoxEdgeDeviceExtendedInfo # type: ignore + from ._models import DataBoxEdgeDeviceExtendedInfoPatch # type: ignore + from ._models import DataBoxEdgeDeviceList # type: ignore + from ._models import DataBoxEdgeDevicePatch # type: ignore + from ._models import DataBoxEdgeMoveRequest # type: ignore + from ._models import DataBoxEdgeSku # type: ignore + from ._models import DataBoxEdgeSkuList # type: ignore + from ._models import EdgeProfile # type: ignore + from ._models import EdgeProfilePatch # type: ignore + from ._models import EdgeProfileSubscription # type: ignore + from ._models import EdgeProfileSubscriptionPatch # type: ignore + from ._models import EtcdInfo # type: ignore + from ._models import FileEventTrigger # type: ignore + from ._models import FileSourceInfo # type: ignore + from ._models import GenerateCertResponse # type: ignore + from ._models import ImageRepositoryCredential # type: ignore + from ._models import IoTAddon # type: ignore + from ._models import IoTDeviceInfo # type: ignore + from ._models import IoTEdgeAgentInfo # type: ignore + from ._models import IoTRole # type: ignore + from ._models import Ipv4Config # type: ignore + from ._models import Ipv6Config # type: ignore + from ._models import Job # type: ignore + from ._models import JobErrorDetails # type: ignore + from ._models import JobErrorItem # type: ignore + from ._models import KubernetesClusterInfo # type: ignore + from ._models import KubernetesIPConfiguration # type: ignore + from ._models import KubernetesRole # type: ignore + from ._models import KubernetesRoleCompute # type: ignore + from ._models import KubernetesRoleNetwork # type: ignore + from ._models import KubernetesRoleResources # type: ignore + from ._models import KubernetesRoleStorage # type: ignore + from ._models import KubernetesRoleStorageClassInfo # type: ignore + from ._models import LoadBalancerConfig # type: ignore + from ._models import MECRole # type: ignore + from ._models import MetricConfiguration # type: ignore + from ._models import MetricCounter # type: ignore + from ._models import MetricCounterSet # type: ignore + from ._models import MetricDimension # type: ignore + from ._models import MetricDimensionV1 # type: ignore + from ._models import MetricSpecificationV1 # type: ignore + from ._models import MonitoringMetricConfiguration # type: ignore + from ._models import MonitoringMetricConfigurationList # type: ignore + from ._models import MountPointMap # type: ignore + from ._models import NetworkAdapter # type: ignore + from ._models import NetworkAdapterPosition # type: ignore + from ._models import NetworkSettings # type: ignore + from ._models import Node # type: ignore + from ._models import NodeInfo # type: ignore + from ._models import NodeList # type: ignore + from ._models import Operation # type: ignore + from ._models import OperationDisplay # type: ignore + from ._models import OperationsList # type: ignore + from ._models import Order # type: ignore + from ._models import OrderList # type: ignore + from ._models import OrderStatus # type: ignore + from ._models import PeriodicTimerEventTrigger # type: ignore + from ._models import PeriodicTimerSourceInfo # type: ignore + from ._models import RefreshDetails # type: ignore + from ._models import ResourceIdentity # type: ignore + from ._models import ResourceMoveDetails # type: ignore + from ._models import ResourceTypeSku # type: ignore + from ._models import Role # type: ignore + from ._models import RoleList # type: ignore + from ._models import RoleSinkInfo # type: ignore + from ._models import Secret # type: ignore + from ._models import SecuritySettings # type: ignore + from ._models import ServiceSpecification # type: ignore + from ._models import Share # type: ignore + from ._models import ShareAccessRight # type: ignore + from ._models import ShareList # type: ignore + from ._models import Sku # type: ignore + from ._models import SkuCost # type: ignore + from ._models import SkuInformation # type: ignore + from ._models import SkuInformationList # type: ignore + from ._models import SkuLocationInfo # type: ignore + from ._models import StorageAccount # type: ignore + from ._models import StorageAccountCredential # type: ignore + from ._models import StorageAccountCredentialList # type: ignore + from ._models import StorageAccountList # type: ignore + from ._models import SubscriptionRegisteredFeatures # type: ignore + from ._models import SymmetricKey # type: ignore + from ._models import SystemData # type: ignore + from ._models import TrackingInfo # type: ignore + from ._models import Trigger # type: ignore + from ._models import TriggerList # type: ignore + from ._models import UpdateDetails # type: ignore + from ._models import UpdateDownloadProgress # type: ignore + from ._models import UpdateInstallProgress # type: ignore + from ._models import UpdateSummary # type: ignore + from ._models import UploadCertificateRequest # type: ignore + from ._models import UploadCertificateResponse # type: ignore + from ._models import User # type: ignore + from ._models import UserAccessRight # type: ignore + from ._models import UserList # type: ignore + +from ._data_box_edge_management_client_enums import ( + AccountType, + AddonState, + AddonType, + AlertSeverity, + AuthenticationType, + AzureContainerDataFormat, + ClientPermissionType, + ContainerStatus, + CreatedByType, + DataBoxEdgeDeviceKind, + DataBoxEdgeDeviceStatus, + DataPolicy, + DayOfWeek, + DeviceType, + DownloadPhase, + EncryptionAlgorithm, + HostPlatformType, + InstallRebootBehavior, + JobStatus, + JobType, + KeyVaultSyncStatus, + KubernetesNodeType, + KubernetesState, + MetricAggregationType, + MetricCategory, + MetricUnit, + MonitoringStatus, + MountType, + MsiIdentityType, + NetworkAdapterDHCPStatus, + NetworkAdapterRDMAStatus, + NetworkAdapterStatus, + NetworkGroup, + NodeStatus, + OrderState, + PlatformType, + PosixComplianceStatus, + ResourceMoveStatus, + RoleStatus, + RoleTypes, + SSLStatus, + ShareAccessProtocol, + ShareAccessType, + ShareStatus, + ShipmentType, + SkuAvailability, + SkuName, + SkuSignupOption, + SkuTier, + SkuVersion, + StorageAccountStatus, + SubscriptionState, + TimeGrain, + TriggerEventType, + UpdateOperation, + UpdateOperationStage, + UpdateStatus, + UpdateType, + UserType, +) + +__all__ = [ + 'ARMBaseModel', + 'Addon', + 'AddonList', + 'Address', + 'Alert', + 'AlertErrorDetails', + 'AlertList', + 'ArcAddon', + 'AsymmetricEncryptedSecret', + 'Authentication', + 'AzureContainerInfo', + 'BandwidthSchedule', + 'BandwidthSchedulesList', + 'ClientAccessRight', + 'CloudEdgeManagementRole', + 'CloudErrorBody', + 'CniConfig', + 'ComputeResource', + 'ContactDetails', + 'Container', + 'ContainerList', + 'DCAccessCode', + 'DataBoxEdgeDevice', + 'DataBoxEdgeDeviceExtendedInfo', + 'DataBoxEdgeDeviceExtendedInfoPatch', + 'DataBoxEdgeDeviceList', + 'DataBoxEdgeDevicePatch', + 'DataBoxEdgeMoveRequest', + 'DataBoxEdgeSku', + 'DataBoxEdgeSkuList', + 'EdgeProfile', + 'EdgeProfilePatch', + 'EdgeProfileSubscription', + 'EdgeProfileSubscriptionPatch', + 'EtcdInfo', + 'FileEventTrigger', + 'FileSourceInfo', + 'GenerateCertResponse', + 'ImageRepositoryCredential', + 'IoTAddon', + 'IoTDeviceInfo', + 'IoTEdgeAgentInfo', + 'IoTRole', + 'Ipv4Config', + 'Ipv6Config', + 'Job', + 'JobErrorDetails', + 'JobErrorItem', + 'KubernetesClusterInfo', + 'KubernetesIPConfiguration', + 'KubernetesRole', + 'KubernetesRoleCompute', + 'KubernetesRoleNetwork', + 'KubernetesRoleResources', + 'KubernetesRoleStorage', + 'KubernetesRoleStorageClassInfo', + 'LoadBalancerConfig', + 'MECRole', + 'MetricConfiguration', + 'MetricCounter', + 'MetricCounterSet', + 'MetricDimension', + 'MetricDimensionV1', + 'MetricSpecificationV1', + 'MonitoringMetricConfiguration', + 'MonitoringMetricConfigurationList', + 'MountPointMap', + 'NetworkAdapter', + 'NetworkAdapterPosition', + 'NetworkSettings', + 'Node', + 'NodeInfo', + 'NodeList', + 'Operation', + 'OperationDisplay', + 'OperationsList', + 'Order', + 'OrderList', + 'OrderStatus', + 'PeriodicTimerEventTrigger', + 'PeriodicTimerSourceInfo', + 'RefreshDetails', + 'ResourceIdentity', + 'ResourceMoveDetails', + 'ResourceTypeSku', + 'Role', + 'RoleList', + 'RoleSinkInfo', + 'Secret', + 'SecuritySettings', + 'ServiceSpecification', + 'Share', + 'ShareAccessRight', + 'ShareList', + 'Sku', + 'SkuCost', + 'SkuInformation', + 'SkuInformationList', + 'SkuLocationInfo', + 'StorageAccount', + 'StorageAccountCredential', + 'StorageAccountCredentialList', + 'StorageAccountList', + 'SubscriptionRegisteredFeatures', + 'SymmetricKey', + 'SystemData', + 'TrackingInfo', + 'Trigger', + 'TriggerList', + 'UpdateDetails', + 'UpdateDownloadProgress', + 'UpdateInstallProgress', + 'UpdateSummary', + 'UploadCertificateRequest', + 'UploadCertificateResponse', + 'User', + 'UserAccessRight', + 'UserList', + 'AccountType', + 'AddonState', + 'AddonType', + 'AlertSeverity', + 'AuthenticationType', + 'AzureContainerDataFormat', + 'ClientPermissionType', + 'ContainerStatus', + 'CreatedByType', + 'DataBoxEdgeDeviceKind', + 'DataBoxEdgeDeviceStatus', + 'DataPolicy', + 'DayOfWeek', + 'DeviceType', + 'DownloadPhase', + 'EncryptionAlgorithm', + 'HostPlatformType', + 'InstallRebootBehavior', + 'JobStatus', + 'JobType', + 'KeyVaultSyncStatus', + 'KubernetesNodeType', + 'KubernetesState', + 'MetricAggregationType', + 'MetricCategory', + 'MetricUnit', + 'MonitoringStatus', + 'MountType', + 'MsiIdentityType', + 'NetworkAdapterDHCPStatus', + 'NetworkAdapterRDMAStatus', + 'NetworkAdapterStatus', + 'NetworkGroup', + 'NodeStatus', + 'OrderState', + 'PlatformType', + 'PosixComplianceStatus', + 'ResourceMoveStatus', + 'RoleStatus', + 'RoleTypes', + 'SSLStatus', + 'ShareAccessProtocol', + 'ShareAccessType', + 'ShareStatus', + 'ShipmentType', + 'SkuAvailability', + 'SkuName', + 'SkuSignupOption', + 'SkuTier', + 'SkuVersion', + 'StorageAccountStatus', + 'SubscriptionState', + 'TimeGrain', + 'TriggerEventType', + 'UpdateOperation', + 'UpdateOperationStage', + 'UpdateStatus', + 'UpdateType', + 'UserType', +] diff --git a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2021_02_01_preview/models/_data_box_edge_management_client_enums.py b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2021_02_01_preview/models/_data_box_edge_management_client_enums.py new file mode 100644 index 000000000000..3f2a52eaabf0 --- /dev/null +++ b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2021_02_01_preview/models/_data_box_edge_management_client_enums.py @@ -0,0 +1,580 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from 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 AddonState(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Addon Provisioning State + """ + + INVALID = "Invalid" + CREATING = "Creating" + CREATED = "Created" + UPDATING = "Updating" + RECONFIGURING = "Reconfiguring" + FAILED = "Failed" + DELETING = "Deleting" + +class AddonType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Addon type. + """ + + IOT_EDGE = "IotEdge" + ARC_FOR_KUBERNETES = "ArcForKubernetes" + +class AlertSeverity(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Severity of the alert. + """ + + INFORMATIONAL = "Informational" + WARNING = "Warning" + CRITICAL = "Critical" + +class AuthenticationType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """The authentication type. + """ + + INVALID = "Invalid" + AZURE_ACTIVE_DIRECTORY = "AzureActiveDirectory" + +class AzureContainerDataFormat(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Storage format used for the file represented by the share. + """ + + BLOCK_BLOB = "BlockBlob" + PAGE_BLOB = "PageBlob" + AZURE_FILE = "AzureFile" + +class ClientPermissionType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Type of access to be allowed for the client. + """ + + NO_ACCESS = "NoAccess" + READ_ONLY = "ReadOnly" + READ_WRITE = "ReadWrite" + +class ContainerStatus(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Current status of the container. + """ + + OK = "OK" + OFFLINE = "Offline" + UNKNOWN = "Unknown" + UPDATING = "Updating" + NEEDS_ATTENTION = "NeedsAttention" + +class CreatedByType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """The type of identity that created the resource. + """ + + USER = "User" + APPLICATION = "Application" + MANAGED_IDENTITY = "ManagedIdentity" + KEY = "Key" + +class DataBoxEdgeDeviceKind(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """The etag for the devices. + """ + + AZURE_DATA_BOX_GATEWAY = "AzureDataBoxGateway" + AZURE_STACK_EDGE = "AzureStackEdge" + AZURE_STACK_HUB = "AzureStackHub" + AZURE_MODULAR_DATA_CENTRE = "AzureModularDataCentre" + +class DataBoxEdgeDeviceStatus(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """The status of the Data Box Edge/Gateway device. + """ + + READY_TO_SETUP = "ReadyToSetup" + ONLINE = "Online" + OFFLINE = "Offline" + NEEDS_ATTENTION = "NeedsAttention" + DISCONNECTED = "Disconnected" + PARTIALLY_DISCONNECTED = "PartiallyDisconnected" + MAINTENANCE = "Maintenance" + +class DataPolicy(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Data policy of the share. + """ + + CLOUD = "Cloud" + LOCAL = "Local" + +class DayOfWeek(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + + SUNDAY = "Sunday" + MONDAY = "Monday" + TUESDAY = "Tuesday" + WEDNESDAY = "Wednesday" + THURSDAY = "Thursday" + FRIDAY = "Friday" + SATURDAY = "Saturday" + +class DeviceType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """The type of the Data Box Edge/Gateway device. + """ + + DATA_BOX_EDGE_DEVICE = "DataBoxEdgeDevice" + +class DownloadPhase(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """The download phase. + """ + + UNKNOWN = "Unknown" + INITIALIZING = "Initializing" + DOWNLOADING = "Downloading" + VERIFYING = "Verifying" + +class EncryptionAlgorithm(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """The algorithm used to encrypt "Value". + """ + + NONE = "None" + AES256 = "AES256" + RSAES_PKCS1_V1_5 = "RSAES_PKCS1_v_1_5" + +class HostPlatformType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Platform where the runtime is hosted. + """ + + KUBERNETES_CLUSTER = "KubernetesCluster" + LINUX_VM = "LinuxVM" + +class InstallRebootBehavior(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Indicates if updates are available and at least one of the updates needs a reboot. + """ + + NEVER_REBOOTS = "NeverReboots" + REQUIRES_REBOOT = "RequiresReboot" + REQUEST_REBOOT = "RequestReboot" + +class JobStatus(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """The current status of the job. + """ + + INVALID = "Invalid" + RUNNING = "Running" + SUCCEEDED = "Succeeded" + FAILED = "Failed" + CANCELED = "Canceled" + PAUSED = "Paused" + SCHEDULED = "Scheduled" + +class JobType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """The type of the job. + """ + + INVALID = "Invalid" + SCAN_FOR_UPDATES = "ScanForUpdates" + DOWNLOAD_UPDATES = "DownloadUpdates" + INSTALL_UPDATES = "InstallUpdates" + REFRESH_SHARE = "RefreshShare" + REFRESH_CONTAINER = "RefreshContainer" + BACKUP = "Backup" + RESTORE = "Restore" + TRIGGER_SUPPORT_PACKAGE = "TriggerSupportPackage" + +class KeyVaultSyncStatus(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """For changing or to initiate the resync to key-vault set the status to KeyVaultSyncPending, rest + of the status will not be applicable. + """ + + KEY_VAULT_SYNCED = "KeyVaultSynced" + KEY_VAULT_SYNC_FAILED = "KeyVaultSyncFailed" + KEY_VAULT_NOT_CONFIGURED = "KeyVaultNotConfigured" + KEY_VAULT_SYNC_PENDING = "KeyVaultSyncPending" + KEY_VAULT_SYNCING = "KeyVaultSyncing" + KEY_VAULT_NOT_SYNCED = "KeyVaultNotSynced" + +class KubernetesNodeType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Node type - Master/Worker + """ + + INVALID = "Invalid" + MASTER = "Master" + WORKER = "Worker" + +class KubernetesState(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """State of Kubernetes deployment + """ + + INVALID = "Invalid" + CREATING = "Creating" + CREATED = "Created" + UPDATING = "Updating" + RECONFIGURING = "Reconfiguring" + FAILED = "Failed" + DELETING = "Deleting" + +class MetricAggregationType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Metric aggregation type. + """ + + NOT_SPECIFIED = "NotSpecified" + NONE = "None" + AVERAGE = "Average" + MINIMUM = "Minimum" + MAXIMUM = "Maximum" + TOTAL = "Total" + COUNT = "Count" + +class MetricCategory(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Metric category. + """ + + CAPACITY = "Capacity" + TRANSACTION = "Transaction" + +class MetricUnit(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Metric units. + """ + + NOT_SPECIFIED = "NotSpecified" + PERCENT = "Percent" + COUNT = "Count" + SECONDS = "Seconds" + MILLISECONDS = "Milliseconds" + BYTES = "Bytes" + BYTES_PER_SECOND = "BytesPerSecond" + COUNT_PER_SECOND = "CountPerSecond" + +class MonitoringStatus(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Current monitoring status of the share. + """ + + ENABLED = "Enabled" + DISABLED = "Disabled" + +class MountType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Mounting type. + """ + + VOLUME = "Volume" + HOST_PATH = "HostPath" + +class MsiIdentityType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Identity type + """ + + NONE = "None" + SYSTEM_ASSIGNED = "SystemAssigned" + USER_ASSIGNED = "UserAssigned" + +class NetworkAdapterDHCPStatus(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Value indicating whether this adapter has DHCP enabled. + """ + + DISABLED = "Disabled" + ENABLED = "Enabled" + +class NetworkAdapterRDMAStatus(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Value indicating whether this adapter is RDMA capable. + """ + + INCAPABLE = "Incapable" + CAPABLE = "Capable" + +class NetworkAdapterStatus(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Value indicating whether this adapter is valid. + """ + + INACTIVE = "Inactive" + ACTIVE = "Active" + +class NetworkGroup(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """The network group. + """ + + NONE = "None" + NON_RDMA = "NonRDMA" + RDMA = "RDMA" + +class NodeStatus(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """The current status of the individual node + """ + + UNKNOWN = "Unknown" + UP = "Up" + DOWN = "Down" + REBOOTING = "Rebooting" + SHUTTING_DOWN = "ShuttingDown" + +class OrderState(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Status of the order as per the allowed status types. + """ + + UNTRACKED = "Untracked" + AWAITING_FULFILLMENT = "AwaitingFulfillment" + AWAITING_PREPARATION = "AwaitingPreparation" + AWAITING_SHIPMENT = "AwaitingShipment" + SHIPPED = "Shipped" + ARRIVING = "Arriving" + DELIVERED = "Delivered" + REPLACEMENT_REQUESTED = "ReplacementRequested" + LOST_DEVICE = "LostDevice" + DECLINED = "Declined" + RETURN_INITIATED = "ReturnInitiated" + AWAITING_RETURN_SHIPMENT = "AwaitingReturnShipment" + SHIPPED_BACK = "ShippedBack" + COLLECTED_AT_MICROSOFT = "CollectedAtMicrosoft" + AWAITING_PICKUP = "AwaitingPickup" + PICKUP_COMPLETED = "PickupCompleted" + AWAITING_DROP = "AwaitingDrop" + +class PlatformType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Host OS supported by the Arc addon. + """ + + WINDOWS = "Windows" + LINUX = "Linux" + +class PosixComplianceStatus(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """If provisioned storage is posix compliant. + """ + + INVALID = "Invalid" + ENABLED = "Enabled" + DISABLED = "Disabled" + +class ResourceMoveStatus(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Denotes whether move operation is in progress + """ + + NONE = "None" + RESOURCE_MOVE_IN_PROGRESS = "ResourceMoveInProgress" + RESOURCE_MOVE_FAILED = "ResourceMoveFailed" + +class RoleStatus(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Local Edge Management Status + """ + + ENABLED = "Enabled" + DISABLED = "Disabled" + +class RoleTypes(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + + IOT = "IOT" + ASA = "ASA" + FUNCTIONS = "Functions" + COGNITIVE = "Cognitive" + MEC = "MEC" + CLOUD_EDGE_MANAGEMENT = "CloudEdgeManagement" + KUBERNETES = "Kubernetes" + +class ShareAccessProtocol(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Access protocol to be used by the share. + """ + + SMB = "SMB" + NFS = "NFS" + +class ShareAccessType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Type of access to be allowed on the share for this user. + """ + + CHANGE = "Change" + READ = "Read" + CUSTOM = "Custom" + +class ShareStatus(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Current status of the share. + """ + + OFFLINE = "Offline" + UNKNOWN = "Unknown" + OK = "OK" + UPDATING = "Updating" + NEEDS_ATTENTION = "NeedsAttention" + +class ShipmentType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + + NOT_APPLICABLE = "NotApplicable" + SHIPPED_TO_CUSTOMER = "ShippedToCustomer" + SELF_PICKUP = "SelfPickup" + +class SkuAvailability(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Links to the next set of results + """ + + AVAILABLE = "Available" + UNAVAILABLE = "Unavailable" + +class SkuName(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """The Sku name. + """ + + GATEWAY = "Gateway" + EDGE = "Edge" + TEA1_NODE = "TEA_1Node" + TEA1_NODE_UPS = "TEA_1Node_UPS" + TEA1_NODE_HEATER = "TEA_1Node_Heater" + TEA1_NODE_UPS_HEATER = "TEA_1Node_UPS_Heater" + TEA4_NODE_HEATER = "TEA_4Node_Heater" + TEA4_NODE_UPS_HEATER = "TEA_4Node_UPS_Heater" + TMA = "TMA" + TDC = "TDC" + TCA_SMALL = "TCA_Small" + GPU = "GPU" + TCA_LARGE = "TCA_Large" + EDGE_P_BASE = "EdgeP_Base" + EDGE_P_HIGH = "EdgeP_High" + EDGE_PR_BASE = "EdgePR_Base" + EDGE_PR_BASE_UPS = "EdgePR_Base_UPS" + EP2_64_1_VPU_W = "EP2_64_1VPU_W" + EP2_128_1_T4_MX1_W = "EP2_128_1T4_Mx1_W" + EP2_256_2_T4_W = "EP2_256_2T4_W" + EDGE_MR_MINI = "EdgeMR_Mini" + RCA_SMALL = "RCA_Small" + RCA_LARGE = "RCA_Large" + RDC = "RDC" + MANAGEMENT = "Management" + +class SkuSignupOption(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Sku can be signed up by customer or not. + """ + + NONE = "None" + AVAILABLE = "Available" + +class SkuTier(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """The Sku tier. + """ + + STANDARD = "Standard" + +class SkuVersion(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Availability of the Sku as preview/stable. + """ + + STABLE = "Stable" + PREVIEW = "Preview" + +class SSLStatus(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Signifies whether SSL needs to be enabled or not. + """ + + ENABLED = "Enabled" + DISABLED = "Disabled" + +class StorageAccountStatus(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Current status of the storage account + """ + + OK = "OK" + OFFLINE = "Offline" + UNKNOWN = "Unknown" + UPDATING = "Updating" + NEEDS_ATTENTION = "NeedsAttention" + +class SubscriptionState(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + + REGISTERED = "Registered" + WARNED = "Warned" + SUSPENDED = "Suspended" + DELETED = "Deleted" + UNREGISTERED = "Unregistered" + +class TimeGrain(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + + PT1_M = "PT1M" + PT5_M = "PT5M" + PT15_M = "PT15M" + PT30_M = "PT30M" + PT1_H = "PT1H" + PT6_H = "PT6H" + PT12_H = "PT12H" + PT1_D = "PT1D" + +class TriggerEventType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Trigger Kind. + """ + + FILE_EVENT = "FileEvent" + PERIODIC_TIMER_EVENT = "PeriodicTimerEvent" + +class UpdateOperation(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """The current update operation. + """ + + NONE = "None" + SCAN = "Scan" + DOWNLOAD = "Download" + INSTALL = "Install" + +class UpdateOperationStage(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Current stage of the update operation. + """ + + UNKNOWN = "Unknown" + INITIAL = "Initial" + SCAN_STARTED = "ScanStarted" + SCAN_COMPLETE = "ScanComplete" + SCAN_FAILED = "ScanFailed" + DOWNLOAD_STARTED = "DownloadStarted" + DOWNLOAD_COMPLETE = "DownloadComplete" + DOWNLOAD_FAILED = "DownloadFailed" + INSTALL_STARTED = "InstallStarted" + INSTALL_COMPLETE = "InstallComplete" + INSTALL_FAILED = "InstallFailed" + REBOOT_INITIATED = "RebootInitiated" + SUCCESS = "Success" + FAILURE = "Failure" + RESCAN_STARTED = "RescanStarted" + RESCAN_COMPLETE = "RescanComplete" + RESCAN_FAILED = "RescanFailed" + +class UpdateStatus(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Status of the update. + """ + + DOWNLOAD_PENDING = "DownloadPending" + DOWNLOAD_STARTED = "DownloadStarted" + DOWNLOAD_COMPLETED = "DownloadCompleted" + INSTALL_STARTED = "InstallStarted" + INSTALL_COMPLETED = "InstallCompleted" + +class UpdateType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Type of the Update + """ + + SOFTWARE = "Software" + KUBERNETES = "Kubernetes" + FIRMWARE = "Firmware" + +class UserType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Type of the user. + """ + + SHARE = "Share" + LOCAL_MANAGEMENT = "LocalManagement" + ARM = "ARM" diff --git a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2021_02_01_preview/models/_models.py b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2021_02_01_preview/models/_models.py new file mode 100644 index 000000000000..ed1d3c45a4dc --- /dev/null +++ b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2021_02_01_preview/models/_models.py @@ -0,0 +1,5195 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +import msrest.serialization + + +class ARMBaseModel(msrest.serialization.Model): + """Represents the base class for all object models. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: The path ID that uniquely identifies the object. + :vartype id: str + :ivar name: The object name. + :vartype name: str + :ivar type: The hierarchical type of the object. + :vartype type: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ARMBaseModel, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None + + +class Addon(ARMBaseModel): + """Role Addon. + + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: ArcAddon, IoTAddon. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: The path ID that uniquely identifies the object. + :vartype id: str + :ivar name: The object name. + :vartype name: str + :ivar type: The hierarchical type of the object. + :vartype type: str + :param kind: Required. Addon type.Constant filled by server. Possible values include: + "IotEdge", "ArcForKubernetes". + :type kind: str or ~azure.mgmt.databoxedge.v2021_02_01_preview.models.AddonType + :ivar system_data: Addon type. + :vartype system_data: ~azure.mgmt.databoxedge.v2021_02_01_preview.models.SystemData + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'kind': {'required': True}, + 'system_data': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + } + + _subtype_map = { + 'kind': {'ArcForKubernetes': 'ArcAddon', 'IotEdge': 'IoTAddon'} + } + + def __init__( + self, + **kwargs + ): + super(Addon, self).__init__(**kwargs) + self.kind = 'Addon' # type: str + self.system_data = None + + +class AddonList(msrest.serialization.Model): + """Collection of all the Role addon on the Azure Stack Edge device. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar value: The Value. + :vartype value: list[~azure.mgmt.databoxedge.v2021_02_01_preview.models.Addon] + :ivar next_link: Link to the next set of results. + :vartype next_link: str + """ + + _validation = { + 'value': {'readonly': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[Addon]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(AddonList, self).__init__(**kwargs) + self.value = None + self.next_link = None + + +class Address(msrest.serialization.Model): + """The shipping address of the customer. + + All required parameters must be populated in order to send to Azure. + + :param address_line1: The address line1. + :type address_line1: str + :param address_line2: The address line2. + :type address_line2: str + :param address_line3: The address line3. + :type address_line3: str + :param postal_code: The postal code. + :type postal_code: str + :param city: The city name. + :type city: str + :param state: The state name. + :type state: str + :param country: Required. The country name. + :type country: str + """ + + _validation = { + 'country': {'required': True}, + } + + _attribute_map = { + 'address_line1': {'key': 'addressLine1', 'type': 'str'}, + 'address_line2': {'key': 'addressLine2', 'type': 'str'}, + 'address_line3': {'key': 'addressLine3', 'type': 'str'}, + 'postal_code': {'key': 'postalCode', 'type': 'str'}, + 'city': {'key': 'city', 'type': 'str'}, + 'state': {'key': 'state', 'type': 'str'}, + 'country': {'key': 'country', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(Address, self).__init__(**kwargs) + self.address_line1 = kwargs.get('address_line1', None) + self.address_line2 = kwargs.get('address_line2', None) + self.address_line3 = kwargs.get('address_line3', None) + self.postal_code = kwargs.get('postal_code', None) + self.city = kwargs.get('city', None) + self.state = kwargs.get('state', None) + self.country = kwargs['country'] + + +class Alert(ARMBaseModel): + """Alert on the data box edge/gateway device. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: The path ID that uniquely identifies the object. + :vartype id: str + :ivar name: The object name. + :vartype name: str + :ivar type: The hierarchical type of the object. + :vartype type: str + :ivar system_data: Alert generated in the resource. + :vartype system_data: ~azure.mgmt.databoxedge.v2021_02_01_preview.models.SystemData + :ivar title: Alert title. + :vartype title: str + :ivar alert_type: Alert type. + :vartype alert_type: str + :ivar appeared_at_date_time: UTC time when the alert appeared. + :vartype appeared_at_date_time: ~datetime.datetime + :ivar recommendation: Alert recommendation. + :vartype recommendation: str + :ivar severity: Severity of the alert. Possible values include: "Informational", "Warning", + "Critical". + :vartype severity: str or ~azure.mgmt.databoxedge.v2021_02_01_preview.models.AlertSeverity + :ivar error_details: Error details of the alert. + :vartype error_details: ~azure.mgmt.databoxedge.v2021_02_01_preview.models.AlertErrorDetails + :ivar detailed_information: Alert details. + :vartype detailed_information: dict[str, str] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'system_data': {'readonly': True}, + 'title': {'readonly': True}, + 'alert_type': {'readonly': True}, + 'appeared_at_date_time': {'readonly': True}, + 'recommendation': {'readonly': True}, + 'severity': {'readonly': True}, + 'error_details': {'readonly': True}, + 'detailed_information': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'title': {'key': 'properties.title', 'type': 'str'}, + 'alert_type': {'key': 'properties.alertType', 'type': 'str'}, + 'appeared_at_date_time': {'key': 'properties.appearedAtDateTime', 'type': 'iso-8601'}, + 'recommendation': {'key': 'properties.recommendation', 'type': 'str'}, + 'severity': {'key': 'properties.severity', 'type': 'str'}, + 'error_details': {'key': 'properties.errorDetails', 'type': 'AlertErrorDetails'}, + 'detailed_information': {'key': 'properties.detailedInformation', 'type': '{str}'}, + } + + def __init__( + self, + **kwargs + ): + super(Alert, self).__init__(**kwargs) + self.system_data = None + self.title = None + self.alert_type = None + self.appeared_at_date_time = None + self.recommendation = None + self.severity = None + self.error_details = None + self.detailed_information = None + + +class AlertErrorDetails(msrest.serialization.Model): + """Error details for the alert. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar error_code: Error code. + :vartype error_code: str + :ivar error_message: Error Message. + :vartype error_message: str + :ivar occurrences: Number of occurrences. + :vartype occurrences: int + """ + + _validation = { + 'error_code': {'readonly': True}, + 'error_message': {'readonly': True}, + 'occurrences': {'readonly': True}, + } + + _attribute_map = { + 'error_code': {'key': 'errorCode', 'type': 'str'}, + 'error_message': {'key': 'errorMessage', 'type': 'str'}, + 'occurrences': {'key': 'occurrences', 'type': 'int'}, + } + + def __init__( + self, + **kwargs + ): + super(AlertErrorDetails, self).__init__(**kwargs) + self.error_code = None + self.error_message = None + self.occurrences = None + + +class AlertList(msrest.serialization.Model): + """Collection of alerts. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar value: The value. + :vartype value: list[~azure.mgmt.databoxedge.v2021_02_01_preview.models.Alert] + :ivar next_link: Link to the next set of results. + :vartype next_link: str + """ + + _validation = { + 'value': {'readonly': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[Alert]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(AlertList, self).__init__(**kwargs) + self.value = None + self.next_link = None + + +class ArcAddon(Addon): + """Arc Addon. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: The path ID that uniquely identifies the object. + :vartype id: str + :ivar name: The object name. + :vartype name: str + :ivar type: The hierarchical type of the object. + :vartype type: str + :param kind: Required. Addon type.Constant filled by server. Possible values include: + "IotEdge", "ArcForKubernetes". + :type kind: str or ~azure.mgmt.databoxedge.v2021_02_01_preview.models.AddonType + :ivar system_data: Addon type. + :vartype system_data: ~azure.mgmt.databoxedge.v2021_02_01_preview.models.SystemData + :param subscription_id: Required. Arc resource subscription Id. + :type subscription_id: str + :param resource_group_name: Required. Arc resource group name. + :type resource_group_name: str + :param resource_name: Required. Arc resource Name. + :type resource_name: str + :param resource_location: Required. Arc resource location. + :type resource_location: str + :ivar version: Arc resource version. + :vartype version: str + :ivar host_platform: Host OS supported by the Arc addon. Possible values include: "Windows", + "Linux". + :vartype host_platform: str or ~azure.mgmt.databoxedge.v2021_02_01_preview.models.PlatformType + :ivar host_platform_type: Platform where the runtime is hosted. Possible values include: + "KubernetesCluster", "LinuxVM". + :vartype host_platform_type: str or + ~azure.mgmt.databoxedge.v2021_02_01_preview.models.HostPlatformType + :ivar provisioning_state: Addon Provisioning State. Possible values include: "Invalid", + "Creating", "Created", "Updating", "Reconfiguring", "Failed", "Deleting". + :vartype provisioning_state: str or + ~azure.mgmt.databoxedge.v2021_02_01_preview.models.AddonState + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'kind': {'required': True}, + 'system_data': {'readonly': True}, + 'subscription_id': {'required': True}, + 'resource_group_name': {'required': True}, + 'resource_name': {'required': True}, + 'resource_location': {'required': True}, + 'version': {'readonly': True}, + 'host_platform': {'readonly': True}, + 'host_platform_type': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'subscription_id': {'key': 'properties.subscriptionId', 'type': 'str'}, + 'resource_group_name': {'key': 'properties.resourceGroupName', 'type': 'str'}, + 'resource_name': {'key': 'properties.resourceName', 'type': 'str'}, + 'resource_location': {'key': 'properties.resourceLocation', 'type': 'str'}, + 'version': {'key': 'properties.version', 'type': 'str'}, + 'host_platform': {'key': 'properties.hostPlatform', 'type': 'str'}, + 'host_platform_type': {'key': 'properties.hostPlatformType', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ArcAddon, self).__init__(**kwargs) + self.kind = 'ArcForKubernetes' # type: str + self.subscription_id = kwargs['subscription_id'] + self.resource_group_name = kwargs['resource_group_name'] + self.resource_name = kwargs['resource_name'] + self.resource_location = kwargs['resource_location'] + self.version = None + self.host_platform = None + self.host_platform_type = None + self.provisioning_state = None + + +class AsymmetricEncryptedSecret(msrest.serialization.Model): + """Represent the secrets intended for encryption with asymmetric key pair. + + All required parameters must be populated in order to send to Azure. + + :param value: Required. The value of the secret. + :type value: str + :param encryption_cert_thumbprint: Thumbprint certificate used to encrypt \"Value\". If the + value is unencrypted, it will be null. + :type encryption_cert_thumbprint: str + :param encryption_algorithm: Required. The algorithm used to encrypt "Value". Possible values + include: "None", "AES256", "RSAES_PKCS1_v_1_5". + :type encryption_algorithm: str or + ~azure.mgmt.databoxedge.v2021_02_01_preview.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: ~azure.mgmt.databoxedge.v2021_02_01_preview.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 + ~azure.mgmt.databoxedge.v2021_02_01_preview.models.AzureContainerDataFormat + """ + + _validation = { + 'storage_account_credential_id': {'required': True}, + 'container_name': {'required': True}, + 'data_format': {'required': True}, + } + + _attribute_map = { + 'storage_account_credential_id': {'key': 'storageAccountCredentialId', 'type': 'str'}, + 'container_name': {'key': 'containerName', 'type': 'str'}, + 'data_format': {'key': 'dataFormat', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(AzureContainerInfo, self).__init__(**kwargs) + self.storage_account_credential_id = kwargs['storage_account_credential_id'] + self.container_name = kwargs['container_name'] + self.data_format = kwargs['data_format'] + + +class BandwidthSchedule(ARMBaseModel): + """The bandwidth schedule details. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: The path ID that uniquely identifies the object. + :vartype id: str + :ivar name: The object name. + :vartype name: str + :ivar type: The hierarchical type of the object. + :vartype type: str + :ivar system_data: Bandwidth object related to ASE resource. + :vartype system_data: ~azure.mgmt.databoxedge.v2021_02_01_preview.models.SystemData + :param start: Required. The start time of the schedule in UTC. + :type start: str + :param stop: Required. The stop time of the schedule in UTC. + :type stop: str + :param rate_in_mbps: Required. The bandwidth rate in Mbps. + :type rate_in_mbps: int + :param days: Required. The days of the week when this schedule is applicable. + :type days: list[str or ~azure.mgmt.databoxedge.v2021_02_01_preview.models.DayOfWeek] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'system_data': {'readonly': True}, + 'start': {'required': True}, + 'stop': {'required': True}, + 'rate_in_mbps': {'required': True}, + 'days': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'start': {'key': 'properties.start', 'type': 'str'}, + 'stop': {'key': 'properties.stop', 'type': 'str'}, + 'rate_in_mbps': {'key': 'properties.rateInMbps', 'type': 'int'}, + 'days': {'key': 'properties.days', 'type': '[str]'}, + } + + def __init__( + self, + **kwargs + ): + super(BandwidthSchedule, self).__init__(**kwargs) + self.system_data = None + self.start = kwargs['start'] + self.stop = kwargs['stop'] + self.rate_in_mbps = kwargs['rate_in_mbps'] + self.days = kwargs['days'] + + +class BandwidthSchedulesList(msrest.serialization.Model): + """The collection of bandwidth schedules. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar value: The list of bandwidth schedules. + :vartype value: list[~azure.mgmt.databoxedge.v2021_02_01_preview.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 + ~azure.mgmt.databoxedge.v2021_02_01_preview.models.ClientPermissionType + """ + + _validation = { + 'client': {'required': True}, + 'access_permission': {'required': True}, + } + + _attribute_map = { + 'client': {'key': 'client', 'type': 'str'}, + 'access_permission': {'key': 'accessPermission', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ClientAccessRight, self).__init__(**kwargs) + self.client = kwargs['client'] + self.access_permission = kwargs['access_permission'] + + +class Role(ARMBaseModel): + """Compute role. + + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: CloudEdgeManagementRole, IoTRole, KubernetesRole, MECRole. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: The path ID that uniquely identifies the object. + :vartype id: str + :ivar name: The object name. + :vartype name: str + :ivar type: The hierarchical type of the object. + :vartype type: str + :param kind: Required. Role type.Constant filled by server. Possible values include: "IOT", + "ASA", "Functions", "Cognitive", "MEC", "CloudEdgeManagement", "Kubernetes". + :type kind: str or ~azure.mgmt.databoxedge.v2021_02_01_preview.models.RoleTypes + :ivar system_data: Role configured on ASE resource. + :vartype system_data: ~azure.mgmt.databoxedge.v2021_02_01_preview.models.SystemData + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'kind': {'required': True}, + 'system_data': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + } + + _subtype_map = { + 'kind': {'CloudEdgeManagement': 'CloudEdgeManagementRole', 'IOT': 'IoTRole', 'Kubernetes': 'KubernetesRole', 'MEC': 'MECRole'} + } + + def __init__( + self, + **kwargs + ): + super(Role, self).__init__(**kwargs) + self.kind = 'Role' # type: str + self.system_data = None + + +class CloudEdgeManagementRole(Role): + """CloudEdgeManagementRole role. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: The path ID that uniquely identifies the object. + :vartype id: str + :ivar name: The object name. + :vartype name: str + :ivar type: The hierarchical type of the object. + :vartype type: str + :param kind: Required. Role type.Constant filled by server. Possible values include: "IOT", + "ASA", "Functions", "Cognitive", "MEC", "CloudEdgeManagement", "Kubernetes". + :type kind: str or ~azure.mgmt.databoxedge.v2021_02_01_preview.models.RoleTypes + :ivar system_data: Role configured on ASE resource. + :vartype system_data: ~azure.mgmt.databoxedge.v2021_02_01_preview.models.SystemData + :ivar local_management_status: Local Edge Management Status. Possible values include: + "Enabled", "Disabled". + :vartype local_management_status: str or + ~azure.mgmt.databoxedge.v2021_02_01_preview.models.RoleStatus + :ivar edge_profile: Edge Profile of the resource. + :vartype edge_profile: ~azure.mgmt.databoxedge.v2021_02_01_preview.models.EdgeProfile + :param role_status: Role status. Possible values include: "Enabled", "Disabled". + :type role_status: str or ~azure.mgmt.databoxedge.v2021_02_01_preview.models.RoleStatus + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'kind': {'required': True}, + 'system_data': {'readonly': True}, + 'local_management_status': {'readonly': True}, + 'edge_profile': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'local_management_status': {'key': 'properties.localManagementStatus', 'type': 'str'}, + 'edge_profile': {'key': 'properties.edgeProfile', 'type': 'EdgeProfile'}, + 'role_status': {'key': 'properties.roleStatus', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(CloudEdgeManagementRole, self).__init__(**kwargs) + self.kind = 'CloudEdgeManagement' # type: str + self.local_management_status = None + self.edge_profile = None + self.role_status = kwargs.get('role_status', None) + + +class CloudErrorBody(msrest.serialization.Model): + """An error response from the service. + + :param code: An identifier for the error. Codes are invariant and are intended to be consumed + programmatically. + :type code: str + :param message: A message describing the error, intended to be suitable for display in a user + interface. + :type message: str + :param details: A list of additional details about the error. + :type details: list[~azure.mgmt.databoxedge.v2021_02_01_preview.models.CloudErrorBody] + """ + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + 'details': {'key': 'details', 'type': '[CloudErrorBody]'}, + } + + def __init__( + self, + **kwargs + ): + super(CloudErrorBody, self).__init__(**kwargs) + self.code = kwargs.get('code', None) + self.message = kwargs.get('message', None) + self.details = kwargs.get('details', None) + + +class CniConfig(msrest.serialization.Model): + """Cni configuration. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar type: Cni type. + :vartype type: str + :ivar version: Cni version. + :vartype version: str + :ivar pod_subnet: Pod Subnet. + :vartype pod_subnet: str + :ivar service_subnet: Service subnet. + :vartype service_subnet: str + """ + + _validation = { + 'type': {'readonly': True}, + 'version': {'readonly': True}, + 'pod_subnet': {'readonly': True}, + 'service_subnet': {'readonly': True}, + } + + _attribute_map = { + 'type': {'key': 'type', 'type': 'str'}, + 'version': {'key': 'version', 'type': 'str'}, + 'pod_subnet': {'key': 'podSubnet', 'type': 'str'}, + 'service_subnet': {'key': 'serviceSubnet', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(CniConfig, self).__init__(**kwargs) + self.type = None + self.version = None + self.pod_subnet = None + self.service_subnet = None + + +class ComputeResource(msrest.serialization.Model): + """Compute infrastructure Resource. + + All required parameters must be populated in order to send to Azure. + + :param processor_count: Required. Processor count. + :type processor_count: int + :param memory_in_gb: Required. Memory in GB. + :type memory_in_gb: long + """ + + _validation = { + 'processor_count': {'required': True}, + 'memory_in_gb': {'required': True}, + } + + _attribute_map = { + 'processor_count': {'key': 'processorCount', 'type': 'int'}, + 'memory_in_gb': {'key': 'memoryInGB', 'type': 'long'}, + } + + def __init__( + self, + **kwargs + ): + super(ComputeResource, self).__init__(**kwargs) + self.processor_count = kwargs['processor_count'] + self.memory_in_gb = kwargs['memory_in_gb'] + + +class ContactDetails(msrest.serialization.Model): + """Contains all the contact details of the customer. + + All required parameters must be populated in order to send to Azure. + + :param contact_person: Required. The contact person name. + :type contact_person: str + :param company_name: Required. The name of the company. + :type company_name: str + :param phone: Required. The phone number. + :type phone: str + :param email_list: Required. The email list. + :type email_list: list[str] + """ + + _validation = { + 'contact_person': {'required': True}, + 'company_name': {'required': True}, + 'phone': {'required': True}, + 'email_list': {'required': True}, + } + + _attribute_map = { + 'contact_person': {'key': 'contactPerson', 'type': 'str'}, + 'company_name': {'key': 'companyName', 'type': 'str'}, + 'phone': {'key': 'phone', 'type': 'str'}, + 'email_list': {'key': 'emailList', 'type': '[str]'}, + } + + def __init__( + self, + **kwargs + ): + super(ContactDetails, self).__init__(**kwargs) + self.contact_person = kwargs['contact_person'] + self.company_name = kwargs['company_name'] + self.phone = kwargs['phone'] + self.email_list = kwargs['email_list'] + + +class Container(ARMBaseModel): + """Represents a container on the Data Box Edge/Gateway device. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: The path ID that uniquely identifies the object. + :vartype id: str + :ivar name: The object name. + :vartype name: str + :ivar type: The hierarchical type of the object. + :vartype type: str + :ivar system_data: Container in DataBoxEdge Resource. + :vartype system_data: ~azure.mgmt.databoxedge.v2021_02_01_preview.models.SystemData + :ivar container_status: Current status of the container. Possible values include: "OK", + "Offline", "Unknown", "Updating", "NeedsAttention". + :vartype container_status: str or + ~azure.mgmt.databoxedge.v2021_02_01_preview.models.ContainerStatus + :param data_format: Required. DataFormat for Container. Possible values include: "BlockBlob", + "PageBlob", "AzureFile". + :type data_format: str or + ~azure.mgmt.databoxedge.v2021_02_01_preview.models.AzureContainerDataFormat + :ivar refresh_details: Details of the refresh job on this container. + :vartype refresh_details: ~azure.mgmt.databoxedge.v2021_02_01_preview.models.RefreshDetails + :ivar created_date_time: The UTC time when container got created. + :vartype created_date_time: ~datetime.datetime + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'system_data': {'readonly': True}, + 'container_status': {'readonly': True}, + 'data_format': {'required': True}, + 'refresh_details': {'readonly': True}, + 'created_date_time': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'container_status': {'key': 'properties.containerStatus', 'type': 'str'}, + 'data_format': {'key': 'properties.dataFormat', 'type': 'str'}, + 'refresh_details': {'key': 'properties.refreshDetails', 'type': 'RefreshDetails'}, + 'created_date_time': {'key': 'properties.createdDateTime', 'type': 'iso-8601'}, + } + + def __init__( + self, + **kwargs + ): + super(Container, self).__init__(**kwargs) + self.system_data = None + self.container_status = None + self.data_format = kwargs['data_format'] + self.refresh_details = None + self.created_date_time = None + + +class ContainerList(msrest.serialization.Model): + """Collection of all the containers on the Data Box Edge/Gateway device. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar value: The list of containers. + :vartype value: list[~azure.mgmt.databoxedge.v2021_02_01_preview.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: ~azure.mgmt.databoxedge.v2021_02_01_preview.models.Sku + :param etag: The etag for the devices. + :type etag: str + :param identity: Msi identity of the resource. + :type identity: ~azure.mgmt.databoxedge.v2021_02_01_preview.models.ResourceIdentity + :ivar kind: The etag for the devices. Possible values include: "AzureDataBoxGateway", + "AzureStackEdge", "AzureStackHub", "AzureModularDataCentre". + :vartype kind: str or ~azure.mgmt.databoxedge.v2021_02_01_preview.models.DataBoxEdgeDeviceKind + :ivar system_data: DataBoxEdge Resource. + :vartype system_data: ~azure.mgmt.databoxedge.v2021_02_01_preview.models.SystemData + :param data_box_edge_device_status: The status of the Data Box Edge/Gateway device. Possible + values include: "ReadyToSetup", "Online", "Offline", "NeedsAttention", "Disconnected", + "PartiallyDisconnected", "Maintenance". + :type data_box_edge_device_status: str or + ~azure.mgmt.databoxedge.v2021_02_01_preview.models.DataBoxEdgeDeviceStatus + :ivar serial_number: The Serial Number of Data Box Edge/Gateway device. + :vartype serial_number: str + :ivar description: The Description of the Data Box Edge/Gateway device. + :vartype description: str + :ivar model_description: The description of the Data Box Edge/Gateway device model. + :vartype model_description: str + :ivar device_type: The type of the Data Box Edge/Gateway device. Possible values include: + "DataBoxEdgeDevice". + :vartype device_type: str or ~azure.mgmt.databoxedge.v2021_02_01_preview.models.DeviceType + :ivar friendly_name: The Data Box Edge/Gateway device name. + :vartype friendly_name: str + :ivar culture: The Data Box Edge/Gateway device culture. + :vartype culture: str + :ivar device_model: The Data Box Edge/Gateway device model. + :vartype device_model: str + :ivar device_software_version: The Data Box Edge/Gateway device software version. + :vartype device_software_version: str + :ivar device_local_capacity: The Data Box Edge/Gateway device local capacity in MB. + :vartype device_local_capacity: long + :ivar time_zone: The Data Box Edge/Gateway device timezone. + :vartype time_zone: str + :ivar device_hcs_version: The device software version number of the device (eg: 1.2.18105.6). + :vartype device_hcs_version: str + :ivar configured_role_types: Type of compute roles configured. + :vartype configured_role_types: list[str or + ~azure.mgmt.databoxedge.v2021_02_01_preview.models.RoleTypes] + :ivar node_count: The number of nodes in the cluster. + :vartype node_count: int + :ivar resource_move_details: The details of the move operation on this resource. + :vartype resource_move_details: + ~azure.mgmt.databoxedge.v2021_02_01_preview.models.ResourceMoveDetails + :ivar edge_profile: The details of Edge Profile for this resource. + :vartype edge_profile: ~azure.mgmt.databoxedge.v2021_02_01_preview.models.EdgeProfile + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': True}, + 'kind': {'readonly': True}, + 'system_data': {'readonly': True}, + 'serial_number': {'readonly': True}, + 'description': {'readonly': True}, + 'model_description': {'readonly': True}, + 'device_type': {'readonly': True}, + 'friendly_name': {'readonly': True}, + 'culture': {'readonly': True}, + 'device_model': {'readonly': True}, + 'device_software_version': {'readonly': True}, + 'device_local_capacity': {'readonly': True}, + 'time_zone': {'readonly': True}, + 'device_hcs_version': {'readonly': True}, + 'configured_role_types': {'readonly': True}, + 'node_count': {'readonly': True}, + 'resource_move_details': {'readonly': True}, + 'edge_profile': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'sku': {'key': 'sku', 'type': 'Sku'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'identity': {'key': 'identity', 'type': 'ResourceIdentity'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'data_box_edge_device_status': {'key': 'properties.dataBoxEdgeDeviceStatus', 'type': 'str'}, + 'serial_number': {'key': 'properties.serialNumber', 'type': 'str'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + 'model_description': {'key': 'properties.modelDescription', 'type': 'str'}, + 'device_type': {'key': 'properties.deviceType', 'type': 'str'}, + 'friendly_name': {'key': 'properties.friendlyName', 'type': 'str'}, + 'culture': {'key': 'properties.culture', 'type': 'str'}, + 'device_model': {'key': 'properties.deviceModel', 'type': 'str'}, + 'device_software_version': {'key': 'properties.deviceSoftwareVersion', 'type': 'str'}, + 'device_local_capacity': {'key': 'properties.deviceLocalCapacity', 'type': 'long'}, + 'time_zone': {'key': 'properties.timeZone', 'type': 'str'}, + 'device_hcs_version': {'key': 'properties.deviceHcsVersion', 'type': 'str'}, + 'configured_role_types': {'key': 'properties.configuredRoleTypes', 'type': '[str]'}, + 'node_count': {'key': 'properties.nodeCount', 'type': 'int'}, + 'resource_move_details': {'key': 'properties.resourceMoveDetails', 'type': 'ResourceMoveDetails'}, + 'edge_profile': {'key': 'properties.edgeProfile', 'type': 'EdgeProfile'}, + } + + def __init__( + self, + **kwargs + ): + super(DataBoxEdgeDevice, self).__init__(**kwargs) + self.location = kwargs['location'] + self.tags = kwargs.get('tags', None) + self.sku = kwargs.get('sku', None) + self.etag = kwargs.get('etag', None) + self.identity = kwargs.get('identity', None) + self.kind = None + self.system_data = None + self.data_box_edge_device_status = kwargs.get('data_box_edge_device_status', None) + self.serial_number = None + self.description = None + self.model_description = None + self.device_type = None + self.friendly_name = None + self.culture = None + self.device_model = None + self.device_software_version = None + self.device_local_capacity = None + self.time_zone = None + self.device_hcs_version = None + self.configured_role_types = None + self.node_count = None + self.resource_move_details = None + self.edge_profile = None + + +class DataBoxEdgeDeviceExtendedInfo(ARMBaseModel): + """The extended Info of the Data Box Edge/Gateway device. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: The path ID that uniquely identifies the object. + :vartype id: str + :ivar name: The object name. + :vartype name: str + :ivar type: The hierarchical type of the object. + :vartype type: str + :param encryption_key_thumbprint: The digital signature of encrypted certificate. + :type encryption_key_thumbprint: str + :param encryption_key: The public part of the encryption certificate. Client uses this to + encrypt any secret. + :type encryption_key: str + :ivar resource_key: The Resource ID of the Resource. + :vartype resource_key: str + :param client_secret_store_id: The Key Vault ARM Id for client secrets. + :type client_secret_store_id: str + :param client_secret_store_url: The url to access the Client Key Vault. + :type client_secret_store_url: str + :param channel_integrity_key_name: The name of Channel Integrity Key stored in the Client Key + Vault. + :type channel_integrity_key_name: str + :param channel_integrity_key_version: The version of Channel Integrity Key stored in the Client + Key Vault. + :type channel_integrity_key_version: str + :param key_vault_sync_status: Key vault sync status. Possible values include: "KeyVaultSynced", + "KeyVaultSyncFailed", "KeyVaultNotConfigured", "KeyVaultSyncPending", "KeyVaultSyncing", + "KeyVaultNotSynced". + :type key_vault_sync_status: str or + ~azure.mgmt.databoxedge.v2021_02_01_preview.models.KeyVaultSyncStatus + :ivar device_secrets: Device secrets, will be returned only with ODataFilter + $expand=deviceSecrets. + :vartype device_secrets: dict[str, ~azure.mgmt.databoxedge.v2021_02_01_preview.models.Secret] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'resource_key': {'readonly': True}, + 'device_secrets': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'encryption_key_thumbprint': {'key': 'properties.encryptionKeyThumbprint', 'type': 'str'}, + 'encryption_key': {'key': 'properties.encryptionKey', 'type': 'str'}, + 'resource_key': {'key': 'properties.resourceKey', 'type': 'str'}, + 'client_secret_store_id': {'key': 'properties.clientSecretStoreId', 'type': 'str'}, + 'client_secret_store_url': {'key': 'properties.clientSecretStoreUrl', 'type': 'str'}, + 'channel_integrity_key_name': {'key': 'properties.channelIntegrityKeyName', 'type': 'str'}, + 'channel_integrity_key_version': {'key': 'properties.channelIntegrityKeyVersion', 'type': 'str'}, + 'key_vault_sync_status': {'key': 'properties.keyVaultSyncStatus', 'type': 'str'}, + 'device_secrets': {'key': 'properties.deviceSecrets', 'type': '{Secret}'}, + } + + def __init__( + self, + **kwargs + ): + super(DataBoxEdgeDeviceExtendedInfo, self).__init__(**kwargs) + self.encryption_key_thumbprint = kwargs.get('encryption_key_thumbprint', None) + self.encryption_key = kwargs.get('encryption_key', None) + self.resource_key = None + self.client_secret_store_id = kwargs.get('client_secret_store_id', None) + self.client_secret_store_url = kwargs.get('client_secret_store_url', None) + self.channel_integrity_key_name = kwargs.get('channel_integrity_key_name', None) + self.channel_integrity_key_version = kwargs.get('channel_integrity_key_version', None) + self.key_vault_sync_status = kwargs.get('key_vault_sync_status', None) + self.device_secrets = None + + +class DataBoxEdgeDeviceExtendedInfoPatch(msrest.serialization.Model): + """The Data Box Edge/Gateway device extended info patch. + + :param client_secret_store_id: The Key Vault ARM Id for client secrets. + :type client_secret_store_id: str + :param client_secret_store_url: The url to access the Client Key Vault. + :type client_secret_store_url: str + :param channel_integrity_key_name: The name for Channel Integrity Key stored in the Client Key + Vault. + :type channel_integrity_key_name: str + :param channel_integrity_key_version: The version of Channel Integrity Key stored in the Client + Key Vault. + :type channel_integrity_key_version: str + :param sync_status: For changing or to initiate the resync to key-vault set the status to + KeyVaultSyncPending, rest of the status will not be applicable. Possible values include: + "KeyVaultSynced", "KeyVaultSyncFailed", "KeyVaultNotConfigured", "KeyVaultSyncPending", + "KeyVaultSyncing", "KeyVaultNotSynced". + :type sync_status: str or ~azure.mgmt.databoxedge.v2021_02_01_preview.models.KeyVaultSyncStatus + """ + + _attribute_map = { + 'client_secret_store_id': {'key': 'clientSecretStoreId', 'type': 'str'}, + 'client_secret_store_url': {'key': 'clientSecretStoreUrl', 'type': 'str'}, + 'channel_integrity_key_name': {'key': 'channelIntegrityKeyName', 'type': 'str'}, + 'channel_integrity_key_version': {'key': 'channelIntegrityKeyVersion', 'type': 'str'}, + 'sync_status': {'key': 'syncStatus', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(DataBoxEdgeDeviceExtendedInfoPatch, self).__init__(**kwargs) + self.client_secret_store_id = kwargs.get('client_secret_store_id', None) + self.client_secret_store_url = kwargs.get('client_secret_store_url', None) + self.channel_integrity_key_name = kwargs.get('channel_integrity_key_name', None) + self.channel_integrity_key_version = kwargs.get('channel_integrity_key_version', None) + self.sync_status = kwargs.get('sync_status', None) + + +class DataBoxEdgeDeviceList(msrest.serialization.Model): + """The collection of Data Box Edge/Gateway devices. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar value: The list of Data Box Edge/Gateway devices. + :vartype value: list[~azure.mgmt.databoxedge.v2021_02_01_preview.models.DataBoxEdgeDevice] + :ivar next_link: Link to the next set of results. + :vartype next_link: str + """ + + _validation = { + 'value': {'readonly': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[DataBoxEdgeDevice]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(DataBoxEdgeDeviceList, self).__init__(**kwargs) + self.value = None + self.next_link = None + + +class DataBoxEdgeDevicePatch(msrest.serialization.Model): + """The Data Box Edge/Gateway device patch. + + :param tags: A set of tags. The tags attached to the Data Box Edge/Gateway resource. + :type tags: dict[str, str] + :param identity: Msi identity of the resource. + :type identity: ~azure.mgmt.databoxedge.v2021_02_01_preview.models.ResourceIdentity + :param edge_profile: Edge Profile property of the Data Box Edge/Gateway device. + :type edge_profile: ~azure.mgmt.databoxedge.v2021_02_01_preview.models.EdgeProfilePatch + """ + + _attribute_map = { + 'tags': {'key': 'tags', 'type': '{str}'}, + 'identity': {'key': 'identity', 'type': 'ResourceIdentity'}, + 'edge_profile': {'key': 'properties.edgeProfile', 'type': 'EdgeProfilePatch'}, + } + + def __init__( + self, + **kwargs + ): + super(DataBoxEdgeDevicePatch, self).__init__(**kwargs) + self.tags = kwargs.get('tags', None) + self.identity = kwargs.get('identity', None) + self.edge_profile = kwargs.get('edge_profile', None) + + +class DataBoxEdgeMoveRequest(msrest.serialization.Model): + """Resource Move details. + + All required parameters must be populated in order to send to Azure. + + :param target_resource_group: Required. Target resource group ARMId. + :type target_resource_group: str + :param resources: Required. List of resources to be moved. + :type resources: list[str] + """ + + _validation = { + 'target_resource_group': {'required': True}, + 'resources': {'required': True}, + } + + _attribute_map = { + 'target_resource_group': {'key': 'targetResourceGroup', 'type': 'str'}, + 'resources': {'key': 'resources', 'type': '[str]'}, + } + + def __init__( + self, + **kwargs + ): + super(DataBoxEdgeMoveRequest, self).__init__(**kwargs) + self.target_resource_group = kwargs['target_resource_group'] + self.resources = kwargs['resources'] + + +class DataBoxEdgeSku(msrest.serialization.Model): + """The Sku information. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar resource_type: The type of the resource. + :vartype resource_type: str + :ivar name: The Sku name. Possible values include: "Gateway", "Edge", "TEA_1Node", + "TEA_1Node_UPS", "TEA_1Node_Heater", "TEA_1Node_UPS_Heater", "TEA_4Node_Heater", + "TEA_4Node_UPS_Heater", "TMA", "TDC", "TCA_Small", "GPU", "TCA_Large", "EdgeP_Base", + "EdgeP_High", "EdgePR_Base", "EdgePR_Base_UPS", "EP2_64_1VPU_W", "EP2_128_1T4_Mx1_W", + "EP2_256_2T4_W", "EdgeMR_Mini", "RCA_Small", "RCA_Large", "RDC", "Management". + :vartype name: str or ~azure.mgmt.databoxedge.v2021_02_01_preview.models.SkuName + :ivar kind: The Sku kind. + :vartype kind: str + :ivar tier: The Sku tier. Possible values include: "Standard". + :vartype tier: str or ~azure.mgmt.databoxedge.v2021_02_01_preview.models.SkuTier + :ivar size: The Sku kind. + :vartype size: str + :ivar family: The Sku family. + :vartype family: str + :ivar locations: Availability of the Sku for the region. + :vartype locations: list[str] + :ivar api_versions: The API versions in which Sku is available. + :vartype api_versions: list[str] + :ivar location_info: Availability of the Sku for the location/zone/site. + :vartype location_info: + list[~azure.mgmt.databoxedge.v2021_02_01_preview.models.SkuLocationInfo] + :ivar costs: The pricing info of the Sku. + :vartype costs: list[~azure.mgmt.databoxedge.v2021_02_01_preview.models.SkuCost] + :ivar signup_option: Sku can be signed up by customer or not. Possible values include: "None", + "Available". + :vartype signup_option: str or + ~azure.mgmt.databoxedge.v2021_02_01_preview.models.SkuSignupOption + :ivar version: Availability of the Sku as preview/stable. Possible values include: "Stable", + "Preview". + :vartype version: str or ~azure.mgmt.databoxedge.v2021_02_01_preview.models.SkuVersion + :ivar availability: Links to the next set of results. Possible values include: "Available", + "Unavailable". + :vartype availability: str or + ~azure.mgmt.databoxedge.v2021_02_01_preview.models.SkuAvailability + :ivar shipment_types: List of Shipment Types supported by this SKU. + :vartype shipment_types: list[str or + ~azure.mgmt.databoxedge.v2021_02_01_preview.models.ShipmentType] + """ + + _validation = { + 'resource_type': {'readonly': True}, + 'name': {'readonly': True}, + 'kind': {'readonly': True}, + 'tier': {'readonly': True}, + 'size': {'readonly': True}, + 'family': {'readonly': True}, + 'locations': {'readonly': True}, + 'api_versions': {'readonly': True}, + 'location_info': {'readonly': True}, + 'costs': {'readonly': True}, + 'signup_option': {'readonly': True}, + 'version': {'readonly': True}, + 'availability': {'readonly': True}, + 'shipment_types': {'readonly': True}, + } + + _attribute_map = { + 'resource_type': {'key': 'resourceType', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'tier': {'key': 'tier', 'type': 'str'}, + 'size': {'key': 'size', 'type': 'str'}, + 'family': {'key': 'family', 'type': 'str'}, + 'locations': {'key': 'locations', 'type': '[str]'}, + 'api_versions': {'key': 'apiVersions', 'type': '[str]'}, + 'location_info': {'key': 'locationInfo', 'type': '[SkuLocationInfo]'}, + 'costs': {'key': 'costs', 'type': '[SkuCost]'}, + 'signup_option': {'key': 'signupOption', 'type': 'str'}, + 'version': {'key': 'version', 'type': 'str'}, + 'availability': {'key': 'availability', 'type': 'str'}, + 'shipment_types': {'key': 'shipmentTypes', 'type': '[str]'}, + } + + def __init__( + self, + **kwargs + ): + super(DataBoxEdgeSku, self).__init__(**kwargs) + self.resource_type = None + self.name = None + self.kind = None + self.tier = None + self.size = None + self.family = None + self.locations = None + self.api_versions = None + self.location_info = None + self.costs = None + self.signup_option = None + self.version = None + self.availability = None + self.shipment_types = None + + +class DataBoxEdgeSkuList(msrest.serialization.Model): + """List of SKU Information objects. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar value: List of ResourceType Sku. + :vartype value: list[~azure.mgmt.databoxedge.v2021_02_01_preview.models.DataBoxEdgeSku] + :ivar next_link: Links to the next set of results. + :vartype next_link: str + """ + + _validation = { + 'value': {'readonly': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[DataBoxEdgeSku]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(DataBoxEdgeSkuList, self).__init__(**kwargs) + self.value = None + self.next_link = None + + +class DCAccessCode(msrest.serialization.Model): + """DC Access code in the case of Self Managed Shipping. + + :param auth_code: DCAccess Code for the Self Managed shipment. + :type auth_code: str + """ + + _attribute_map = { + 'auth_code': {'key': 'properties.authCode', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(DCAccessCode, self).__init__(**kwargs) + self.auth_code = kwargs.get('auth_code', None) + + +class EdgeProfile(msrest.serialization.Model): + """Details about Edge Profile for the resource. + + :param subscription: Edge Profile Subscription. + :type subscription: ~azure.mgmt.databoxedge.v2021_02_01_preview.models.EdgeProfileSubscription + """ + + _attribute_map = { + 'subscription': {'key': 'subscription', 'type': 'EdgeProfileSubscription'}, + } + + def __init__( + self, + **kwargs + ): + super(EdgeProfile, self).__init__(**kwargs) + self.subscription = kwargs.get('subscription', None) + + +class EdgeProfilePatch(msrest.serialization.Model): + """The Data Box Edge/Gateway Edge Profile patch. + + :param subscription: The Data Box Edge/Gateway Edge Profile Subscription patch. + :type subscription: + ~azure.mgmt.databoxedge.v2021_02_01_preview.models.EdgeProfileSubscriptionPatch + """ + + _attribute_map = { + 'subscription': {'key': 'subscription', 'type': 'EdgeProfileSubscriptionPatch'}, + } + + def __init__( + self, + **kwargs + ): + super(EdgeProfilePatch, self).__init__(**kwargs) + self.subscription = kwargs.get('subscription', None) + + +class EdgeProfileSubscription(msrest.serialization.Model): + """Subscription details for the Edge Profile. + + :param registration_id: Edge Subscription Registration ID. + :type registration_id: str + :param id: ARM ID of the subscription. + :type id: str + :param state: Possible values include: "Registered", "Warned", "Suspended", "Deleted", + "Unregistered". + :type state: str or ~azure.mgmt.databoxedge.v2021_02_01_preview.models.SubscriptionState + :param registration_date: + :type registration_date: str + :param subscription_id: + :type subscription_id: str + :param tenant_id: + :type tenant_id: str + :param location_placement_id: + :type location_placement_id: str + :param quota_id: + :type quota_id: str + :param serialized_details: + :type serialized_details: str + :param registered_features: + :type registered_features: + list[~azure.mgmt.databoxedge.v2021_02_01_preview.models.SubscriptionRegisteredFeatures] + """ + + _attribute_map = { + 'registration_id': {'key': 'registrationId', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + 'state': {'key': 'state', 'type': 'str'}, + 'registration_date': {'key': 'registrationDate', 'type': 'str'}, + 'subscription_id': {'key': 'subscriptionId', 'type': 'str'}, + 'tenant_id': {'key': 'properties.tenantId', 'type': 'str'}, + 'location_placement_id': {'key': 'properties.locationPlacementId', 'type': 'str'}, + 'quota_id': {'key': 'properties.quotaId', 'type': 'str'}, + 'serialized_details': {'key': 'properties.serializedDetails', 'type': 'str'}, + 'registered_features': {'key': 'properties.registeredFeatures', 'type': '[SubscriptionRegisteredFeatures]'}, + } + + def __init__( + self, + **kwargs + ): + super(EdgeProfileSubscription, self).__init__(**kwargs) + self.registration_id = kwargs.get('registration_id', None) + self.id = kwargs.get('id', None) + self.state = kwargs.get('state', None) + self.registration_date = kwargs.get('registration_date', None) + self.subscription_id = kwargs.get('subscription_id', None) + self.tenant_id = kwargs.get('tenant_id', None) + self.location_placement_id = kwargs.get('location_placement_id', None) + self.quota_id = kwargs.get('quota_id', None) + self.serialized_details = kwargs.get('serialized_details', None) + self.registered_features = kwargs.get('registered_features', None) + + +class EdgeProfileSubscriptionPatch(msrest.serialization.Model): + """The Data Box Edge/Gateway Edge Profile Subscription patch. + + :param id: The path ID that uniquely identifies the subscription of the edge profile. + :type id: str + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(EdgeProfileSubscriptionPatch, self).__init__(**kwargs) + self.id = kwargs.get('id', None) + + +class EtcdInfo(msrest.serialization.Model): + """Etcd configuration. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar type: Etcd type. + :vartype type: str + :ivar version: Etcd version. + :vartype version: str + """ + + _validation = { + 'type': {'readonly': True}, + 'version': {'readonly': True}, + } + + _attribute_map = { + 'type': {'key': 'type', 'type': 'str'}, + 'version': {'key': 'version', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(EtcdInfo, self).__init__(**kwargs) + self.type = None + self.version = None + + +class Trigger(ARMBaseModel): + """Trigger details. + + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: FileEventTrigger, PeriodicTimerEventTrigger. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: The path ID that uniquely identifies the object. + :vartype id: str + :ivar name: The object name. + :vartype name: str + :ivar type: The hierarchical type of the object. + :vartype type: str + :ivar system_data: Trigger in DataBoxEdge Resource. + :vartype system_data: ~azure.mgmt.databoxedge.v2021_02_01_preview.models.SystemData + :param kind: Required. Trigger Kind.Constant filled by server. Possible values include: + "FileEvent", "PeriodicTimerEvent". + :type kind: str or ~azure.mgmt.databoxedge.v2021_02_01_preview.models.TriggerEventType + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'system_data': {'readonly': True}, + 'kind': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'kind': {'key': 'kind', 'type': 'str'}, + } + + _subtype_map = { + 'kind': {'FileEvent': 'FileEventTrigger', 'PeriodicTimerEvent': 'PeriodicTimerEventTrigger'} + } + + def __init__( + self, + **kwargs + ): + super(Trigger, self).__init__(**kwargs) + self.system_data = None + self.kind = 'Trigger' # type: str + + +class FileEventTrigger(Trigger): + """Trigger details. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: The path ID that uniquely identifies the object. + :vartype id: str + :ivar name: The object name. + :vartype name: str + :ivar type: The hierarchical type of the object. + :vartype type: str + :ivar system_data: Trigger in DataBoxEdge Resource. + :vartype system_data: ~azure.mgmt.databoxedge.v2021_02_01_preview.models.SystemData + :param kind: Required. Trigger Kind.Constant filled by server. Possible values include: + "FileEvent", "PeriodicTimerEvent". + :type kind: str or ~azure.mgmt.databoxedge.v2021_02_01_preview.models.TriggerEventType + :param source_info: Required. File event source details. + :type source_info: ~azure.mgmt.databoxedge.v2021_02_01_preview.models.FileSourceInfo + :param sink_info: Required. Role sink info. + :type sink_info: ~azure.mgmt.databoxedge.v2021_02_01_preview.models.RoleSinkInfo + :param custom_context_tag: A custom context tag typically used to correlate the trigger against + its usage. For example, if a periodic timer trigger is intended for certain specific IoT + modules in the device, the tag can be the name or the image URL of the module. + :type custom_context_tag: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'system_data': {'readonly': True}, + 'kind': {'required': True}, + 'source_info': {'required': True}, + 'sink_info': {'required': True}, + 'custom_context_tag': {'max_length': 192, 'min_length': 0}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'source_info': {'key': 'properties.sourceInfo', 'type': 'FileSourceInfo'}, + 'sink_info': {'key': 'properties.sinkInfo', 'type': 'RoleSinkInfo'}, + 'custom_context_tag': {'key': 'properties.customContextTag', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(FileEventTrigger, self).__init__(**kwargs) + self.kind = 'FileEvent' # type: str + self.source_info = kwargs['source_info'] + self.sink_info = kwargs['sink_info'] + self.custom_context_tag = kwargs.get('custom_context_tag', None) + + +class FileSourceInfo(msrest.serialization.Model): + """File source details. + + All required parameters must be populated in order to send to Azure. + + :param share_id: Required. File share ID. + :type share_id: str + """ + + _validation = { + 'share_id': {'required': True}, + } + + _attribute_map = { + 'share_id': {'key': 'shareId', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(FileSourceInfo, self).__init__(**kwargs) + self.share_id = kwargs['share_id'] + + +class GenerateCertResponse(msrest.serialization.Model): + """Used in activation key generation flow. + + :param public_key: Gets or sets base64 encoded certificate raw data, + this is the public part needed to be uploaded to cert vault. + :type public_key: str + :param private_key: Gets or sets base64 encoded private part of the certificate, + needed to form the activation key. + :type private_key: str + :param expiry_time_in_utc: Gets or sets expiry time in UTC. + :type expiry_time_in_utc: str + """ + + _attribute_map = { + 'public_key': {'key': 'publicKey', 'type': 'str'}, + 'private_key': {'key': 'privateKey', 'type': 'str'}, + 'expiry_time_in_utc': {'key': 'expiryTimeInUTC', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(GenerateCertResponse, self).__init__(**kwargs) + self.public_key = kwargs.get('public_key', None) + self.private_key = kwargs.get('private_key', None) + self.expiry_time_in_utc = kwargs.get('expiry_time_in_utc', None) + + +class ImageRepositoryCredential(msrest.serialization.Model): + """Image repository credential. + + All required parameters must be populated in order to send to Azure. + + :param image_repository_url: Required. Image repository url (e.g.: mcr.microsoft.com). + :type image_repository_url: str + :param user_name: Required. Repository user name. + :type user_name: str + :param password: Repository user password. + :type password: ~azure.mgmt.databoxedge.v2021_02_01_preview.models.AsymmetricEncryptedSecret + """ + + _validation = { + 'image_repository_url': {'required': True}, + 'user_name': {'required': True}, + } + + _attribute_map = { + 'image_repository_url': {'key': 'imageRepositoryUrl', 'type': 'str'}, + 'user_name': {'key': 'userName', 'type': 'str'}, + 'password': {'key': 'password', 'type': 'AsymmetricEncryptedSecret'}, + } + + def __init__( + self, + **kwargs + ): + super(ImageRepositoryCredential, self).__init__(**kwargs) + self.image_repository_url = kwargs['image_repository_url'] + self.user_name = kwargs['user_name'] + self.password = kwargs.get('password', None) + + +class IoTAddon(Addon): + """IoT Addon. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: The path ID that uniquely identifies the object. + :vartype id: str + :ivar name: The object name. + :vartype name: str + :ivar type: The hierarchical type of the object. + :vartype type: str + :param kind: Required. Addon type.Constant filled by server. Possible values include: + "IotEdge", "ArcForKubernetes". + :type kind: str or ~azure.mgmt.databoxedge.v2021_02_01_preview.models.AddonType + :ivar system_data: Addon type. + :vartype system_data: ~azure.mgmt.databoxedge.v2021_02_01_preview.models.SystemData + :param io_t_device_details: Required. IoT device metadata to which appliance needs to be + connected. + :type io_t_device_details: ~azure.mgmt.databoxedge.v2021_02_01_preview.models.IoTDeviceInfo + :param io_t_edge_device_details: Required. IoT edge device to which the IoT Addon needs to be + configured. + :type io_t_edge_device_details: + ~azure.mgmt.databoxedge.v2021_02_01_preview.models.IoTDeviceInfo + :ivar version: Version of IoT running on the appliance. + :vartype version: str + :ivar host_platform: Host OS supported by the IoT addon. Possible values include: "Windows", + "Linux". + :vartype host_platform: str or ~azure.mgmt.databoxedge.v2021_02_01_preview.models.PlatformType + :ivar host_platform_type: Platform where the runtime is hosted. Possible values include: + "KubernetesCluster", "LinuxVM". + :vartype host_platform_type: str or + ~azure.mgmt.databoxedge.v2021_02_01_preview.models.HostPlatformType + :ivar provisioning_state: Addon Provisioning State. Possible values include: "Invalid", + "Creating", "Created", "Updating", "Reconfiguring", "Failed", "Deleting". + :vartype provisioning_state: str or + ~azure.mgmt.databoxedge.v2021_02_01_preview.models.AddonState + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'kind': {'required': True}, + 'system_data': {'readonly': True}, + 'io_t_device_details': {'required': True}, + 'io_t_edge_device_details': {'required': True}, + 'version': {'readonly': True}, + 'host_platform': {'readonly': True}, + 'host_platform_type': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'io_t_device_details': {'key': 'properties.ioTDeviceDetails', 'type': 'IoTDeviceInfo'}, + 'io_t_edge_device_details': {'key': 'properties.ioTEdgeDeviceDetails', 'type': 'IoTDeviceInfo'}, + 'version': {'key': 'properties.version', 'type': 'str'}, + 'host_platform': {'key': 'properties.hostPlatform', 'type': 'str'}, + 'host_platform_type': {'key': 'properties.hostPlatformType', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(IoTAddon, self).__init__(**kwargs) + self.kind = 'IotEdge' # type: str + self.io_t_device_details = kwargs['io_t_device_details'] + self.io_t_edge_device_details = kwargs['io_t_edge_device_details'] + self.version = None + self.host_platform = None + self.host_platform_type = None + self.provisioning_state = None + + +class IoTDeviceInfo(msrest.serialization.Model): + """Metadata of IoT device/IoT Edge device to be configured. + + All required parameters must be populated in order to send to Azure. + + :param device_id: Required. ID of the IoT device/edge device. + :type device_id: str + :param io_t_host_hub: Required. Host name for the IoT hub associated to the device. + :type io_t_host_hub: str + :param io_t_host_hub_id: Id for the IoT hub associated to the device. + :type io_t_host_hub_id: str + :param authentication: Encrypted IoT device/IoT edge device connection string. + :type authentication: ~azure.mgmt.databoxedge.v2021_02_01_preview.models.Authentication + """ + + _validation = { + 'device_id': {'required': True}, + 'io_t_host_hub': {'required': True}, + } + + _attribute_map = { + 'device_id': {'key': 'deviceId', 'type': 'str'}, + 'io_t_host_hub': {'key': 'ioTHostHub', 'type': 'str'}, + 'io_t_host_hub_id': {'key': 'ioTHostHubId', 'type': 'str'}, + 'authentication': {'key': 'authentication', 'type': 'Authentication'}, + } + + def __init__( + self, + **kwargs + ): + super(IoTDeviceInfo, self).__init__(**kwargs) + self.device_id = kwargs['device_id'] + self.io_t_host_hub = kwargs['io_t_host_hub'] + self.io_t_host_hub_id = kwargs.get('io_t_host_hub_id', None) + self.authentication = kwargs.get('authentication', None) + + +class IoTEdgeAgentInfo(msrest.serialization.Model): + """IoT edge agent details is optional, this will be used for download system Agent module while bootstrapping IoT Role if specified. + + All required parameters must be populated in order to send to Azure. + + :param image_name: Required. Name of the IoT edge agent image. + :type image_name: str + :param tag: Required. Image Tag. + :type tag: str + :param image_repository: Image repository details. + :type image_repository: + ~azure.mgmt.databoxedge.v2021_02_01_preview.models.ImageRepositoryCredential + """ + + _validation = { + 'image_name': {'required': True}, + 'tag': {'required': True}, + } + + _attribute_map = { + 'image_name': {'key': 'imageName', 'type': 'str'}, + 'tag': {'key': 'tag', 'type': 'str'}, + 'image_repository': {'key': 'imageRepository', 'type': 'ImageRepositoryCredential'}, + } + + def __init__( + self, + **kwargs + ): + super(IoTEdgeAgentInfo, self).__init__(**kwargs) + self.image_name = kwargs['image_name'] + self.tag = kwargs['tag'] + self.image_repository = kwargs.get('image_repository', None) + + +class IoTRole(Role): + """Compute role. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: The path ID that uniquely identifies the object. + :vartype id: str + :ivar name: The object name. + :vartype name: str + :ivar type: The hierarchical type of the object. + :vartype type: str + :param kind: Required. Role type.Constant filled by server. Possible values include: "IOT", + "ASA", "Functions", "Cognitive", "MEC", "CloudEdgeManagement", "Kubernetes". + :type kind: str or ~azure.mgmt.databoxedge.v2021_02_01_preview.models.RoleTypes + :ivar system_data: Role configured on ASE resource. + :vartype system_data: ~azure.mgmt.databoxedge.v2021_02_01_preview.models.SystemData + :param host_platform: Host OS supported by the IoT role. Possible values include: "Windows", + "Linux". + :type host_platform: str or ~azure.mgmt.databoxedge.v2021_02_01_preview.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: ~azure.mgmt.databoxedge.v2021_02_01_preview.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: + ~azure.mgmt.databoxedge.v2021_02_01_preview.models.IoTDeviceInfo + :param share_mappings: Mount points of shares in role(s). + :type share_mappings: list[~azure.mgmt.databoxedge.v2021_02_01_preview.models.MountPointMap] + :param io_t_edge_agent_info: Iot edge agent details to download the agent and bootstrap iot + runtime. + :type io_t_edge_agent_info: ~azure.mgmt.databoxedge.v2021_02_01_preview.models.IoTEdgeAgentInfo + :ivar host_platform_type: Platform where the Iot runtime is hosted. Possible values include: + "KubernetesCluster", "LinuxVM". + :vartype host_platform_type: str or + ~azure.mgmt.databoxedge.v2021_02_01_preview.models.HostPlatformType + :param compute_resource: Resource allocation. + :type compute_resource: ~azure.mgmt.databoxedge.v2021_02_01_preview.models.ComputeResource + :param role_status: Role status. Possible values include: "Enabled", "Disabled". + :type role_status: str or ~azure.mgmt.databoxedge.v2021_02_01_preview.models.RoleStatus + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'kind': {'required': True}, + 'system_data': {'readonly': True}, + 'host_platform_type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'host_platform': {'key': 'properties.hostPlatform', 'type': 'str'}, + 'io_t_device_details': {'key': 'properties.ioTDeviceDetails', 'type': 'IoTDeviceInfo'}, + 'io_t_edge_device_details': {'key': 'properties.ioTEdgeDeviceDetails', 'type': 'IoTDeviceInfo'}, + 'share_mappings': {'key': 'properties.shareMappings', 'type': '[MountPointMap]'}, + 'io_t_edge_agent_info': {'key': 'properties.ioTEdgeAgentInfo', 'type': 'IoTEdgeAgentInfo'}, + 'host_platform_type': {'key': 'properties.hostPlatformType', 'type': 'str'}, + 'compute_resource': {'key': 'properties.computeResource', 'type': 'ComputeResource'}, + 'role_status': {'key': 'properties.roleStatus', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(IoTRole, self).__init__(**kwargs) + self.kind = 'IOT' # type: str + self.host_platform = kwargs.get('host_platform', None) + self.io_t_device_details = kwargs.get('io_t_device_details', None) + self.io_t_edge_device_details = kwargs.get('io_t_edge_device_details', None) + self.share_mappings = kwargs.get('share_mappings', None) + self.io_t_edge_agent_info = kwargs.get('io_t_edge_agent_info', None) + self.host_platform_type = None + self.compute_resource = kwargs.get('compute_resource', None) + self.role_status = kwargs.get('role_status', None) + + +class Ipv4Config(msrest.serialization.Model): + """Details related to the IPv4 address configuration. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar ip_address: The IPv4 address of the network adapter. + :vartype ip_address: str + :ivar subnet: The IPv4 subnet of the network adapter. + :vartype subnet: str + :ivar gateway: The IPv4 gateway of the network adapter. + :vartype gateway: str + """ + + _validation = { + 'ip_address': {'readonly': True}, + 'subnet': {'readonly': True}, + 'gateway': {'readonly': True}, + } + + _attribute_map = { + 'ip_address': {'key': 'ipAddress', 'type': 'str'}, + 'subnet': {'key': 'subnet', 'type': 'str'}, + 'gateway': {'key': 'gateway', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(Ipv4Config, self).__init__(**kwargs) + self.ip_address = None + self.subnet = None + self.gateway = None + + +class Ipv6Config(msrest.serialization.Model): + """Details related to the IPv6 address configuration. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar ip_address: The IPv6 address of the network adapter. + :vartype ip_address: str + :ivar prefix_length: The IPv6 prefix of the network adapter. + :vartype prefix_length: int + :ivar gateway: The IPv6 gateway of the network adapter. + :vartype gateway: str + """ + + _validation = { + 'ip_address': {'readonly': True}, + 'prefix_length': {'readonly': True}, + 'gateway': {'readonly': True}, + } + + _attribute_map = { + 'ip_address': {'key': 'ipAddress', 'type': 'str'}, + 'prefix_length': {'key': 'prefixLength', 'type': 'int'}, + 'gateway': {'key': 'gateway', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(Ipv6Config, self).__init__(**kwargs) + self.ip_address = None + self.prefix_length = None + self.gateway = None + + +class Job(msrest.serialization.Model): + """A device job. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: The path ID that uniquely identifies the object. + :vartype id: str + :ivar name: The name of the object. + :vartype name: str + :ivar type: The hierarchical type of the object. + :vartype type: str + :ivar status: The current status of the job. Possible values include: "Invalid", "Running", + "Succeeded", "Failed", "Canceled", "Paused", "Scheduled". + :vartype status: str or ~azure.mgmt.databoxedge.v2021_02_01_preview.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: ~azure.mgmt.databoxedge.v2021_02_01_preview.models.JobErrorDetails + :ivar job_type: The type of the job. Possible values include: "Invalid", "ScanForUpdates", + "DownloadUpdates", "InstallUpdates", "RefreshShare", "RefreshContainer", "Backup", "Restore", + "TriggerSupportPackage". + :vartype job_type: str or ~azure.mgmt.databoxedge.v2021_02_01_preview.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 + ~azure.mgmt.databoxedge.v2021_02_01_preview.models.UpdateOperationStage + :ivar download_progress: The download progress. + :vartype download_progress: + ~azure.mgmt.databoxedge.v2021_02_01_preview.models.UpdateDownloadProgress + :ivar install_progress: The install progress. + :vartype install_progress: + ~azure.mgmt.databoxedge.v2021_02_01_preview.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[~azure.mgmt.databoxedge.v2021_02_01_preview.models.JobErrorItem] + :ivar code: The code intended for programmatic access. + :vartype code: str + :ivar message: The message that describes the error in detail. + :vartype message: str + """ + + _validation = { + 'error_details': {'readonly': True}, + 'code': {'readonly': True}, + 'message': {'readonly': True}, + } + + _attribute_map = { + 'error_details': {'key': 'errorDetails', 'type': '[JobErrorItem]'}, + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(JobErrorDetails, self).__init__(**kwargs) + self.error_details = None + self.code = None + self.message = None + + +class JobErrorItem(msrest.serialization.Model): + """The job error items. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar recommendations: The recommended actions. + :vartype recommendations: list[str] + :ivar code: The code intended for programmatic access. + :vartype code: str + :ivar message: The message that describes the error in detail. + :vartype message: str + """ + + _validation = { + 'recommendations': {'readonly': True}, + 'code': {'readonly': True}, + 'message': {'readonly': True}, + } + + _attribute_map = { + 'recommendations': {'key': 'recommendations', 'type': '[str]'}, + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(JobErrorItem, self).__init__(**kwargs) + self.recommendations = None + self.code = None + self.message = None + + +class KubernetesClusterInfo(msrest.serialization.Model): + """Kubernetes cluster configuration. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar etcd_info: Etcd configuration. + :vartype etcd_info: ~azure.mgmt.databoxedge.v2021_02_01_preview.models.EtcdInfo + :ivar nodes: Kubernetes cluster nodes. + :vartype nodes: list[~azure.mgmt.databoxedge.v2021_02_01_preview.models.NodeInfo] + :param version: Required. Kubernetes cluster version. + :type version: str + """ + + _validation = { + 'etcd_info': {'readonly': True}, + 'nodes': {'readonly': True}, + 'version': {'required': True}, + } + + _attribute_map = { + 'etcd_info': {'key': 'etcdInfo', 'type': 'EtcdInfo'}, + 'nodes': {'key': 'nodes', 'type': '[NodeInfo]'}, + 'version': {'key': 'version', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(KubernetesClusterInfo, self).__init__(**kwargs) + self.etcd_info = None + self.nodes = None + self.version = kwargs['version'] + + +class KubernetesIPConfiguration(msrest.serialization.Model): + """Kubernetes node IP configuration. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar port: Port of the Kubernetes node. + :vartype port: str + :param ip_address: IP address of the Kubernetes node. + :type ip_address: str + """ + + _validation = { + 'port': {'readonly': True}, + } + + _attribute_map = { + 'port': {'key': 'port', 'type': 'str'}, + 'ip_address': {'key': 'ipAddress', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(KubernetesIPConfiguration, self).__init__(**kwargs) + self.port = None + self.ip_address = kwargs.get('ip_address', None) + + +class KubernetesRole(Role): + """Kubernetes role. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: The path ID that uniquely identifies the object. + :vartype id: str + :ivar name: The object name. + :vartype name: str + :ivar type: The hierarchical type of the object. + :vartype type: str + :param kind: Required. Role type.Constant filled by server. Possible values include: "IOT", + "ASA", "Functions", "Cognitive", "MEC", "CloudEdgeManagement", "Kubernetes". + :type kind: str or ~azure.mgmt.databoxedge.v2021_02_01_preview.models.RoleTypes + :ivar system_data: Role configured on ASE resource. + :vartype system_data: ~azure.mgmt.databoxedge.v2021_02_01_preview.models.SystemData + :param host_platform: Host OS supported by the Kubernetes role. Possible values include: + "Windows", "Linux". + :type host_platform: str or ~azure.mgmt.databoxedge.v2021_02_01_preview.models.PlatformType + :ivar provisioning_state: State of Kubernetes deployment. Possible values include: "Invalid", + "Creating", "Created", "Updating", "Reconfiguring", "Failed", "Deleting". + :vartype provisioning_state: str or + ~azure.mgmt.databoxedge.v2021_02_01_preview.models.KubernetesState + :ivar host_platform_type: Platform where the runtime is hosted. Possible values include: + "KubernetesCluster", "LinuxVM". + :vartype host_platform_type: str or + ~azure.mgmt.databoxedge.v2021_02_01_preview.models.HostPlatformType + :param kubernetes_cluster_info: Kubernetes cluster configuration. + :type kubernetes_cluster_info: + ~azure.mgmt.databoxedge.v2021_02_01_preview.models.KubernetesClusterInfo + :param kubernetes_role_resources: Kubernetes role resources. + :type kubernetes_role_resources: + ~azure.mgmt.databoxedge.v2021_02_01_preview.models.KubernetesRoleResources + :param role_status: Role status. Possible values include: "Enabled", "Disabled". + :type role_status: str or ~azure.mgmt.databoxedge.v2021_02_01_preview.models.RoleStatus + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'kind': {'required': True}, + 'system_data': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + 'host_platform_type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'host_platform': {'key': 'properties.hostPlatform', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'host_platform_type': {'key': 'properties.hostPlatformType', 'type': 'str'}, + 'kubernetes_cluster_info': {'key': 'properties.kubernetesClusterInfo', 'type': 'KubernetesClusterInfo'}, + 'kubernetes_role_resources': {'key': 'properties.kubernetesRoleResources', 'type': 'KubernetesRoleResources'}, + 'role_status': {'key': 'properties.roleStatus', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(KubernetesRole, self).__init__(**kwargs) + self.kind = 'Kubernetes' # type: str + self.host_platform = kwargs.get('host_platform', None) + self.provisioning_state = None + self.host_platform_type = None + self.kubernetes_cluster_info = kwargs.get('kubernetes_cluster_info', None) + self.kubernetes_role_resources = kwargs.get('kubernetes_role_resources', None) + self.role_status = kwargs.get('role_status', None) + + +class KubernetesRoleCompute(msrest.serialization.Model): + """Kubernetes role compute resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :param vm_profile: Required. VM profile. + :type vm_profile: str + :ivar memory_in_bytes: Memory in bytes. + :vartype memory_in_bytes: long + :ivar processor_count: Processor count. + :vartype processor_count: int + """ + + _validation = { + 'vm_profile': {'required': True}, + 'memory_in_bytes': {'readonly': True}, + 'processor_count': {'readonly': True}, + } + + _attribute_map = { + 'vm_profile': {'key': 'vmProfile', 'type': 'str'}, + 'memory_in_bytes': {'key': 'memoryInBytes', 'type': 'long'}, + 'processor_count': {'key': 'processorCount', 'type': 'int'}, + } + + def __init__( + self, + **kwargs + ): + super(KubernetesRoleCompute, self).__init__(**kwargs) + self.vm_profile = kwargs['vm_profile'] + self.memory_in_bytes = None + self.processor_count = None + + +class KubernetesRoleNetwork(msrest.serialization.Model): + """Kubernetes role network resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar cni_config: Cni configuration. + :vartype cni_config: ~azure.mgmt.databoxedge.v2021_02_01_preview.models.CniConfig + :ivar load_balancer_config: Load balancer configuration. + :vartype load_balancer_config: + ~azure.mgmt.databoxedge.v2021_02_01_preview.models.LoadBalancerConfig + """ + + _validation = { + 'cni_config': {'readonly': True}, + 'load_balancer_config': {'readonly': True}, + } + + _attribute_map = { + 'cni_config': {'key': 'cniConfig', 'type': 'CniConfig'}, + 'load_balancer_config': {'key': 'loadBalancerConfig', 'type': 'LoadBalancerConfig'}, + } + + def __init__( + self, + **kwargs + ): + super(KubernetesRoleNetwork, self).__init__(**kwargs) + self.cni_config = None + self.load_balancer_config = None + + +class KubernetesRoleResources(msrest.serialization.Model): + """Kubernetes role resources. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :param storage: Kubernetes role storage resource. + :type storage: ~azure.mgmt.databoxedge.v2021_02_01_preview.models.KubernetesRoleStorage + :param compute: Required. Kubernetes role compute resource. + :type compute: ~azure.mgmt.databoxedge.v2021_02_01_preview.models.KubernetesRoleCompute + :ivar network: Kubernetes role network resource. + :vartype network: ~azure.mgmt.databoxedge.v2021_02_01_preview.models.KubernetesRoleNetwork + """ + + _validation = { + 'compute': {'required': True}, + 'network': {'readonly': True}, + } + + _attribute_map = { + 'storage': {'key': 'storage', 'type': 'KubernetesRoleStorage'}, + 'compute': {'key': 'compute', 'type': 'KubernetesRoleCompute'}, + 'network': {'key': 'network', 'type': 'KubernetesRoleNetwork'}, + } + + def __init__( + self, + **kwargs + ): + super(KubernetesRoleResources, self).__init__(**kwargs) + self.storage = kwargs.get('storage', None) + self.compute = kwargs['compute'] + self.network = None + + +class KubernetesRoleStorage(msrest.serialization.Model): + """Kubernetes role storage resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar storage_classes: Kubernetes storage class info. + :vartype storage_classes: + list[~azure.mgmt.databoxedge.v2021_02_01_preview.models.KubernetesRoleStorageClassInfo] + :param endpoints: Mount points of shares in role(s). + :type endpoints: list[~azure.mgmt.databoxedge.v2021_02_01_preview.models.MountPointMap] + """ + + _validation = { + 'storage_classes': {'readonly': True}, + } + + _attribute_map = { + 'storage_classes': {'key': 'storageClasses', 'type': '[KubernetesRoleStorageClassInfo]'}, + 'endpoints': {'key': 'endpoints', 'type': '[MountPointMap]'}, + } + + def __init__( + self, + **kwargs + ): + super(KubernetesRoleStorage, self).__init__(**kwargs) + self.storage_classes = None + self.endpoints = kwargs.get('endpoints', None) + + +class KubernetesRoleStorageClassInfo(msrest.serialization.Model): + """Kubernetes storage class info. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar name: Storage class name. + :vartype name: str + :ivar type: Storage class type. + :vartype type: str + :ivar posix_compliant: If provisioned storage is posix compliant. Possible values include: + "Invalid", "Enabled", "Disabled". + :vartype posix_compliant: str or + ~azure.mgmt.databoxedge.v2021_02_01_preview.models.PosixComplianceStatus + """ + + _validation = { + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'posix_compliant': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'posix_compliant': {'key': 'posixCompliant', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(KubernetesRoleStorageClassInfo, self).__init__(**kwargs) + self.name = None + self.type = None + self.posix_compliant = None + + +class LoadBalancerConfig(msrest.serialization.Model): + """Load balancer configuration. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar type: Load balancer type. + :vartype type: str + :ivar version: Load balancer version. + :vartype version: str + """ + + _validation = { + 'type': {'readonly': True}, + 'version': {'readonly': True}, + } + + _attribute_map = { + 'type': {'key': 'type', 'type': 'str'}, + 'version': {'key': 'version', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(LoadBalancerConfig, self).__init__(**kwargs) + self.type = None + self.version = None + + +class MECRole(Role): + """MEC role. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: The path ID that uniquely identifies the object. + :vartype id: str + :ivar name: The object name. + :vartype name: str + :ivar type: The hierarchical type of the object. + :vartype type: str + :param kind: Required. Role type.Constant filled by server. Possible values include: "IOT", + "ASA", "Functions", "Cognitive", "MEC", "CloudEdgeManagement", "Kubernetes". + :type kind: str or ~azure.mgmt.databoxedge.v2021_02_01_preview.models.RoleTypes + :ivar system_data: Role configured on ASE resource. + :vartype system_data: ~azure.mgmt.databoxedge.v2021_02_01_preview.models.SystemData + :param connection_string: Activation key of the MEC. + :type connection_string: + ~azure.mgmt.databoxedge.v2021_02_01_preview.models.AsymmetricEncryptedSecret + :param controller_endpoint: Controller Endpoint. + :type controller_endpoint: str + :param resource_unique_id: Unique Id of the Resource. + :type resource_unique_id: str + :param role_status: Role status. Possible values include: "Enabled", "Disabled". + :type role_status: str or ~azure.mgmt.databoxedge.v2021_02_01_preview.models.RoleStatus + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'kind': {'required': True}, + 'system_data': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'connection_string': {'key': 'properties.connectionString', 'type': 'AsymmetricEncryptedSecret'}, + 'controller_endpoint': {'key': 'properties.controllerEndpoint', 'type': 'str'}, + 'resource_unique_id': {'key': 'properties.resourceUniqueId', 'type': 'str'}, + 'role_status': {'key': 'properties.roleStatus', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(MECRole, self).__init__(**kwargs) + self.kind = 'MEC' # type: str + self.connection_string = kwargs.get('connection_string', None) + self.controller_endpoint = kwargs.get('controller_endpoint', None) + self.resource_unique_id = kwargs.get('resource_unique_id', None) + self.role_status = kwargs.get('role_status', None) + + +class MetricConfiguration(msrest.serialization.Model): + """Metric configuration. + + All required parameters must be populated in order to send to Azure. + + :param resource_id: Required. The Resource ID on which the metrics should be pushed. + :type resource_id: str + :param mdm_account: The MDM account to which the counters should be pushed. + :type mdm_account: str + :param metric_name_space: The MDM namespace to which the counters should be pushed. This is + required if MDMAccount is specified. + :type metric_name_space: str + :param counter_sets: Required. Host name for the IoT hub associated to the device. + :type counter_sets: list[~azure.mgmt.databoxedge.v2021_02_01_preview.models.MetricCounterSet] + """ + + _validation = { + 'resource_id': {'required': True}, + 'counter_sets': {'required': True}, + } + + _attribute_map = { + 'resource_id': {'key': 'resourceId', 'type': 'str'}, + 'mdm_account': {'key': 'mdmAccount', 'type': 'str'}, + 'metric_name_space': {'key': 'metricNameSpace', 'type': 'str'}, + 'counter_sets': {'key': 'counterSets', 'type': '[MetricCounterSet]'}, + } + + def __init__( + self, + **kwargs + ): + super(MetricConfiguration, self).__init__(**kwargs) + self.resource_id = kwargs['resource_id'] + self.mdm_account = kwargs.get('mdm_account', None) + self.metric_name_space = kwargs.get('metric_name_space', None) + self.counter_sets = kwargs['counter_sets'] + + +class MetricCounter(msrest.serialization.Model): + """The metric counter. + + All required parameters must be populated in order to send to Azure. + + :param name: Required. The counter name. + :type name: str + :param instance: The instance from which counter should be collected. + :type instance: str + :param dimension_filter: The dimension filter. + :type dimension_filter: + list[~azure.mgmt.databoxedge.v2021_02_01_preview.models.MetricDimension] + :param additional_dimensions: The additional dimensions to be added to metric. + :type additional_dimensions: + list[~azure.mgmt.databoxedge.v2021_02_01_preview.models.MetricDimension] + """ + + _validation = { + 'name': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'instance': {'key': 'instance', 'type': 'str'}, + 'dimension_filter': {'key': 'dimensionFilter', 'type': '[MetricDimension]'}, + 'additional_dimensions': {'key': 'additionalDimensions', 'type': '[MetricDimension]'}, + } + + def __init__( + self, + **kwargs + ): + super(MetricCounter, self).__init__(**kwargs) + self.name = kwargs['name'] + self.instance = kwargs.get('instance', None) + self.dimension_filter = kwargs.get('dimension_filter', None) + self.additional_dimensions = kwargs.get('additional_dimensions', None) + + +class MetricCounterSet(msrest.serialization.Model): + """The metric counter set. + + All required parameters must be populated in order to send to Azure. + + :param counters: Required. The counters that should be collected in this set. + :type counters: list[~azure.mgmt.databoxedge.v2021_02_01_preview.models.MetricCounter] + """ + + _validation = { + 'counters': {'required': True}, + } + + _attribute_map = { + 'counters': {'key': 'counters', 'type': '[MetricCounter]'}, + } + + def __init__( + self, + **kwargs + ): + super(MetricCounterSet, self).__init__(**kwargs) + self.counters = kwargs['counters'] + + +class MetricDimension(msrest.serialization.Model): + """The metric dimension. + + All required parameters must be populated in order to send to Azure. + + :param source_type: Required. The dimension type. + :type source_type: str + :param source_name: Required. The dimension value. + :type source_name: str + """ + + _validation = { + 'source_type': {'required': True}, + 'source_name': {'required': True}, + } + + _attribute_map = { + 'source_type': {'key': 'sourceType', 'type': 'str'}, + 'source_name': {'key': 'sourceName', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(MetricDimension, self).__init__(**kwargs) + self.source_type = kwargs['source_type'] + self.source_name = kwargs['source_name'] + + +class MetricDimensionV1(msrest.serialization.Model): + """Metric Dimension v1. + + :param name: Name of the metrics dimension. + :type name: str + :param display_name: Display name of the metrics dimension. + :type display_name: str + :param to_be_exported_for_shoebox: To be exported to shoe box. + :type to_be_exported_for_shoebox: bool + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'display_name': {'key': 'displayName', 'type': 'str'}, + 'to_be_exported_for_shoebox': {'key': 'toBeExportedForShoebox', 'type': 'bool'}, + } + + def __init__( + self, + **kwargs + ): + super(MetricDimensionV1, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.display_name = kwargs.get('display_name', None) + self.to_be_exported_for_shoebox = kwargs.get('to_be_exported_for_shoebox', None) + + +class MetricSpecificationV1(msrest.serialization.Model): + """Metric specification version 1. + + :param name: Name of the metric. + :type name: str + :param display_name: Display name of the metric. + :type display_name: str + :param display_description: Description of the metric to be displayed. + :type display_description: str + :param unit: Metric units. Possible values include: "NotSpecified", "Percent", "Count", + "Seconds", "Milliseconds", "Bytes", "BytesPerSecond", "CountPerSecond". + :type unit: str or ~azure.mgmt.databoxedge.v2021_02_01_preview.models.MetricUnit + :param aggregation_type: Metric aggregation type. Possible values include: "NotSpecified", + "None", "Average", "Minimum", "Maximum", "Total", "Count". + :type aggregation_type: str or + ~azure.mgmt.databoxedge.v2021_02_01_preview.models.MetricAggregationType + :param dimensions: Metric dimensions, other than default dimension which is resource. + :type dimensions: list[~azure.mgmt.databoxedge.v2021_02_01_preview.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 ~azure.mgmt.databoxedge.v2021_02_01_preview.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 + ~azure.mgmt.databoxedge.v2021_02_01_preview.models.TimeGrain] + :param supported_aggregation_types: Support metric aggregation type. + :type supported_aggregation_types: list[str or + ~azure.mgmt.databoxedge.v2021_02_01_preview.models.MetricAggregationType] + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'display_name': {'key': 'displayName', 'type': 'str'}, + 'display_description': {'key': 'displayDescription', 'type': 'str'}, + 'unit': {'key': 'unit', 'type': 'str'}, + 'aggregation_type': {'key': 'aggregationType', 'type': 'str'}, + 'dimensions': {'key': 'dimensions', 'type': '[MetricDimensionV1]'}, + 'fill_gap_with_zero': {'key': 'fillGapWithZero', 'type': 'bool'}, + 'category': {'key': 'category', 'type': 'str'}, + 'resource_id_dimension_name_override': {'key': 'resourceIdDimensionNameOverride', 'type': 'str'}, + 'supported_time_grain_types': {'key': 'supportedTimeGrainTypes', 'type': '[str]'}, + 'supported_aggregation_types': {'key': 'supportedAggregationTypes', 'type': '[str]'}, + } + + def __init__( + self, + **kwargs + ): + super(MetricSpecificationV1, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.display_name = kwargs.get('display_name', None) + self.display_description = kwargs.get('display_description', None) + self.unit = kwargs.get('unit', None) + self.aggregation_type = kwargs.get('aggregation_type', None) + self.dimensions = kwargs.get('dimensions', None) + self.fill_gap_with_zero = kwargs.get('fill_gap_with_zero', None) + self.category = kwargs.get('category', None) + self.resource_id_dimension_name_override = kwargs.get('resource_id_dimension_name_override', None) + self.supported_time_grain_types = kwargs.get('supported_time_grain_types', None) + self.supported_aggregation_types = kwargs.get('supported_aggregation_types', None) + + +class MonitoringMetricConfiguration(ARMBaseModel): + """The metric setting details for the role. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: The path ID that uniquely identifies the object. + :vartype id: str + :ivar name: The object name. + :vartype name: str + :ivar type: The hierarchical type of the object. + :vartype type: str + :ivar system_data: MonitoringConfiguration on ASE device. + :vartype system_data: ~azure.mgmt.databoxedge.v2021_02_01_preview.models.SystemData + :param metric_configurations: Required. The metrics configuration details. + :type metric_configurations: + list[~azure.mgmt.databoxedge.v2021_02_01_preview.models.MetricConfiguration] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'system_data': {'readonly': True}, + 'metric_configurations': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'metric_configurations': {'key': 'properties.metricConfigurations', 'type': '[MetricConfiguration]'}, + } + + def __init__( + self, + **kwargs + ): + super(MonitoringMetricConfiguration, self).__init__(**kwargs) + self.system_data = None + self.metric_configurations = kwargs['metric_configurations'] + + +class MonitoringMetricConfigurationList(msrest.serialization.Model): + """Collection of metric configurations. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar value: The list of metric configurations. + :vartype value: + list[~azure.mgmt.databoxedge.v2021_02_01_preview.models.MonitoringMetricConfiguration] + :ivar next_link: Link to the next set of results. + :vartype next_link: str + """ + + _validation = { + 'value': {'readonly': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[MonitoringMetricConfiguration]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(MonitoringMetricConfigurationList, self).__init__(**kwargs) + self.value = None + self.next_link = None + + +class MountPointMap(msrest.serialization.Model): + """The share mount point. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :param share_id: Required. ID of the share mounted to the role VM. + :type share_id: str + :ivar role_id: ID of the role to which share is mounted. + :vartype role_id: str + :ivar mount_point: Mount point for the share. + :vartype mount_point: str + :ivar mount_type: Mounting type. Possible values include: "Volume", "HostPath". + :vartype mount_type: str or ~azure.mgmt.databoxedge.v2021_02_01_preview.models.MountType + :ivar role_type: Role type. Possible values include: "IOT", "ASA", "Functions", "Cognitive", + "MEC", "CloudEdgeManagement", "Kubernetes". + :vartype role_type: str or ~azure.mgmt.databoxedge.v2021_02_01_preview.models.RoleTypes + """ + + _validation = { + 'share_id': {'required': True}, + 'role_id': {'readonly': True}, + 'mount_point': {'readonly': True}, + 'mount_type': {'readonly': True}, + 'role_type': {'readonly': True}, + } + + _attribute_map = { + 'share_id': {'key': 'shareId', 'type': 'str'}, + 'role_id': {'key': 'roleId', 'type': 'str'}, + 'mount_point': {'key': 'mountPoint', 'type': 'str'}, + 'mount_type': {'key': 'mountType', 'type': 'str'}, + 'role_type': {'key': 'roleType', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(MountPointMap, self).__init__(**kwargs) + self.share_id = kwargs['share_id'] + self.role_id = None + self.mount_point = None + self.mount_type = None + self.role_type = None + + +class NetworkAdapter(msrest.serialization.Model): + """Represents the networkAdapter on a device. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar adapter_id: Instance ID of network adapter. + :vartype adapter_id: str + :ivar adapter_position: Hardware position of network adapter. + :vartype adapter_position: + ~azure.mgmt.databoxedge.v2021_02_01_preview.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 ~azure.mgmt.databoxedge.v2021_02_01_preview.models.NetworkAdapterStatus + :param rdma_status: Value indicating whether this adapter is RDMA capable. Possible values + include: "Incapable", "Capable". + :type rdma_status: str or + ~azure.mgmt.databoxedge.v2021_02_01_preview.models.NetworkAdapterRDMAStatus + :param dhcp_status: Value indicating whether this adapter has DHCP enabled. Possible values + include: "Disabled", "Enabled". + :type dhcp_status: str or + ~azure.mgmt.databoxedge.v2021_02_01_preview.models.NetworkAdapterDHCPStatus + :ivar ipv4_configuration: The IPv4 configuration of the network adapter. + :vartype ipv4_configuration: ~azure.mgmt.databoxedge.v2021_02_01_preview.models.Ipv4Config + :ivar ipv6_configuration: The IPv6 configuration of the network adapter. + :vartype ipv6_configuration: ~azure.mgmt.databoxedge.v2021_02_01_preview.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 ~azure.mgmt.databoxedge.v2021_02_01_preview.models.NetworkGroup + :ivar port: The port. + :vartype port: int + """ + + _validation = { + 'network_group': {'readonly': True}, + 'port': {'readonly': True}, + } + + _attribute_map = { + 'network_group': {'key': 'networkGroup', 'type': 'str'}, + 'port': {'key': 'port', 'type': 'int'}, + } + + def __init__( + self, + **kwargs + ): + super(NetworkAdapterPosition, self).__init__(**kwargs) + self.network_group = None + self.port = None + + +class NetworkSettings(ARMBaseModel): + """The network settings of a device. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: The path ID that uniquely identifies the object. + :vartype id: str + :ivar name: The object name. + :vartype name: str + :ivar type: The hierarchical type of the object. + :vartype type: str + :ivar system_data: NetworkSettings on ASE device. + :vartype system_data: ~azure.mgmt.databoxedge.v2021_02_01_preview.models.SystemData + :ivar network_adapters: The network adapter list on the device. + :vartype network_adapters: + list[~azure.mgmt.databoxedge.v2021_02_01_preview.models.NetworkAdapter] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'system_data': {'readonly': True}, + 'network_adapters': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'network_adapters': {'key': 'properties.networkAdapters', 'type': '[NetworkAdapter]'}, + } + + def __init__( + self, + **kwargs + ): + super(NetworkSettings, self).__init__(**kwargs) + self.system_data = None + self.network_adapters = None + + +class Node(ARMBaseModel): + """Represents a single node in a Data box Edge/Gateway device +Gateway devices, standalone Edge devices and a single node cluster Edge device will all have 1 node +Multi-node Edge devices will have more than 1 nodes. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: The path ID that uniquely identifies the object. + :vartype id: str + :ivar name: The object name. + :vartype name: str + :ivar type: The hierarchical type of the object. + :vartype type: str + :ivar node_status: The current status of the individual node. Possible values include: + "Unknown", "Up", "Down", "Rebooting", "ShuttingDown". + :vartype node_status: str or ~azure.mgmt.databoxedge.v2021_02_01_preview.models.NodeStatus + :ivar node_chassis_serial_number: Serial number of the Chassis. + :vartype node_chassis_serial_number: str + :ivar node_serial_number: Serial number of the individual node. + :vartype node_serial_number: str + :ivar node_display_name: Display Name of the individual node. + :vartype node_display_name: str + :ivar node_friendly_software_version: Friendly software version name that is currently + installed on the node. + :vartype node_friendly_software_version: str + :ivar node_hcs_version: HCS version that is currently installed on the node. + :vartype node_hcs_version: str + :ivar node_instance_id: Guid instance id of the node. + :vartype node_instance_id: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'node_status': {'readonly': True}, + 'node_chassis_serial_number': {'readonly': True}, + 'node_serial_number': {'readonly': True}, + 'node_display_name': {'readonly': True}, + 'node_friendly_software_version': {'readonly': True}, + 'node_hcs_version': {'readonly': True}, + 'node_instance_id': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'node_status': {'key': 'properties.nodeStatus', 'type': 'str'}, + 'node_chassis_serial_number': {'key': 'properties.nodeChassisSerialNumber', 'type': 'str'}, + 'node_serial_number': {'key': 'properties.nodeSerialNumber', 'type': 'str'}, + 'node_display_name': {'key': 'properties.nodeDisplayName', 'type': 'str'}, + 'node_friendly_software_version': {'key': 'properties.nodeFriendlySoftwareVersion', 'type': 'str'}, + 'node_hcs_version': {'key': 'properties.nodeHcsVersion', 'type': 'str'}, + 'node_instance_id': {'key': 'properties.nodeInstanceId', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(Node, self).__init__(**kwargs) + self.node_status = None + self.node_chassis_serial_number = None + self.node_serial_number = None + self.node_display_name = None + self.node_friendly_software_version = None + self.node_hcs_version = None + self.node_instance_id = None + + +class NodeInfo(msrest.serialization.Model): + """Kubernetes node info. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar name: Node name. + :vartype name: str + :ivar type: Node type - Master/Worker. Possible values include: "Invalid", "Master", "Worker". + :vartype type: str or ~azure.mgmt.databoxedge.v2021_02_01_preview.models.KubernetesNodeType + :param ip_configuration: IP Configuration of the Kubernetes node. + :type ip_configuration: + list[~azure.mgmt.databoxedge.v2021_02_01_preview.models.KubernetesIPConfiguration] + """ + + _validation = { + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'ip_configuration': {'key': 'ipConfiguration', 'type': '[KubernetesIPConfiguration]'}, + } + + def __init__( + self, + **kwargs + ): + super(NodeInfo, self).__init__(**kwargs) + self.name = None + self.type = None + self.ip_configuration = kwargs.get('ip_configuration', None) + + +class NodeList(msrest.serialization.Model): + """Collection of Nodes. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar value: The list of Nodes. + :vartype value: list[~azure.mgmt.databoxedge.v2021_02_01_preview.models.Node] + :param next_link: Link to the next set of results. + :type next_link: str + """ + + _validation = { + 'value': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[Node]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(NodeList, self).__init__(**kwargs) + self.value = None + self.next_link = kwargs.get('next_link', 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: ~azure.mgmt.databoxedge.v2021_02_01_preview.models.OperationDisplay + :param origin: Origin of the operation. + :type origin: str + :param is_data_action: Indicates whether the operation is a data action. + :type is_data_action: bool + :param service_specification: Service specification. + :type service_specification: + ~azure.mgmt.databoxedge.v2021_02_01_preview.models.ServiceSpecification + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'display': {'key': 'display', 'type': 'OperationDisplay'}, + 'origin': {'key': 'origin', 'type': 'str'}, + 'is_data_action': {'key': 'isDataAction', 'type': 'bool'}, + '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.is_data_action = kwargs.get('is_data_action', 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[~azure.mgmt.databoxedge.v2021_02_01_preview.models.Operation] + :param next_link: Link to the next set of results. + :type next_link: str + """ + + _validation = { + 'value': {'required': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[Operation]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(OperationsList, self).__init__(**kwargs) + self.value = kwargs['value'] + self.next_link = kwargs.get('next_link', None) + + +class Order(ARMBaseModel): + """The order details. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: The path ID that uniquely identifies the object. + :vartype id: str + :ivar name: The object name. + :vartype name: str + :ivar type: The hierarchical type of the object. + :vartype type: str + :ivar system_data: Order configured on ASE resource. + :vartype system_data: ~azure.mgmt.databoxedge.v2021_02_01_preview.models.SystemData + :param contact_information: The contact details. + :type contact_information: ~azure.mgmt.databoxedge.v2021_02_01_preview.models.ContactDetails + :param shipping_address: The shipping address. + :type shipping_address: ~azure.mgmt.databoxedge.v2021_02_01_preview.models.Address + :ivar current_status: Current status of the order. + :vartype current_status: ~azure.mgmt.databoxedge.v2021_02_01_preview.models.OrderStatus + :ivar order_history: List of status changes in the order. + :vartype order_history: list[~azure.mgmt.databoxedge.v2021_02_01_preview.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[~azure.mgmt.databoxedge.v2021_02_01_preview.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[~azure.mgmt.databoxedge.v2021_02_01_preview.models.TrackingInfo] + :param shipment_type: ShipmentType of the order. Possible values include: "NotApplicable", + "ShippedToCustomer", "SelfPickup". + :type shipment_type: str or ~azure.mgmt.databoxedge.v2021_02_01_preview.models.ShipmentType + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'system_data': {'readonly': True}, + 'current_status': {'readonly': True}, + 'order_history': {'readonly': True}, + 'serial_number': {'readonly': True}, + 'delivery_tracking_info': {'readonly': True}, + 'return_tracking_info': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'contact_information': {'key': 'properties.contactInformation', 'type': 'ContactDetails'}, + 'shipping_address': {'key': 'properties.shippingAddress', 'type': 'Address'}, + 'current_status': {'key': 'properties.currentStatus', 'type': 'OrderStatus'}, + 'order_history': {'key': 'properties.orderHistory', 'type': '[OrderStatus]'}, + 'serial_number': {'key': 'properties.serialNumber', 'type': 'str'}, + 'delivery_tracking_info': {'key': 'properties.deliveryTrackingInfo', 'type': '[TrackingInfo]'}, + 'return_tracking_info': {'key': 'properties.returnTrackingInfo', 'type': '[TrackingInfo]'}, + 'shipment_type': {'key': 'properties.shipmentType', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(Order, self).__init__(**kwargs) + self.system_data = None + self.contact_information = kwargs.get('contact_information', None) + self.shipping_address = kwargs.get('shipping_address', None) + self.current_status = None + self.order_history = None + self.serial_number = None + self.delivery_tracking_info = None + self.return_tracking_info = None + self.shipment_type = kwargs.get('shipment_type', None) + + +class OrderList(msrest.serialization.Model): + """List of order entities. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar value: The list of orders. + :vartype value: list[~azure.mgmt.databoxedge.v2021_02_01_preview.models.Order] + :ivar next_link: Link to the next set of results. + :vartype next_link: str + """ + + _validation = { + 'value': {'readonly': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[Order]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(OrderList, self).__init__(**kwargs) + self.value = None + self.next_link = None + + +class OrderStatus(msrest.serialization.Model): + """Represents a single status change. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :param status: Required. Status of the order as per the allowed status types. Possible values + include: "Untracked", "AwaitingFulfillment", "AwaitingPreparation", "AwaitingShipment", + "Shipped", "Arriving", "Delivered", "ReplacementRequested", "LostDevice", "Declined", + "ReturnInitiated", "AwaitingReturnShipment", "ShippedBack", "CollectedAtMicrosoft", + "AwaitingPickup", "PickupCompleted", "AwaitingDrop". + :type status: str or ~azure.mgmt.databoxedge.v2021_02_01_preview.models.OrderState + :ivar update_date_time: Time of status update. + :vartype update_date_time: ~datetime.datetime + :param comments: Comments related to this status change. + :type comments: str + :ivar tracking_information: Tracking information related to the state in the ordering flow. + :vartype tracking_information: ~azure.mgmt.databoxedge.v2021_02_01_preview.models.TrackingInfo + :ivar additional_order_details: Dictionary to hold generic information which is not stored + by the already existing properties. + :vartype additional_order_details: dict[str, str] + """ + + _validation = { + 'status': {'required': True}, + 'update_date_time': {'readonly': True}, + 'tracking_information': {'readonly': True}, + 'additional_order_details': {'readonly': True}, + } + + _attribute_map = { + 'status': {'key': 'status', 'type': 'str'}, + 'update_date_time': {'key': 'updateDateTime', 'type': 'iso-8601'}, + 'comments': {'key': 'comments', 'type': 'str'}, + 'tracking_information': {'key': 'trackingInformation', 'type': 'TrackingInfo'}, + 'additional_order_details': {'key': 'additionalOrderDetails', 'type': '{str}'}, + } + + def __init__( + self, + **kwargs + ): + super(OrderStatus, self).__init__(**kwargs) + self.status = kwargs['status'] + self.update_date_time = None + self.comments = kwargs.get('comments', None) + self.tracking_information = None + self.additional_order_details = None + + +class PeriodicTimerEventTrigger(Trigger): + """Trigger details. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: The path ID that uniquely identifies the object. + :vartype id: str + :ivar name: The object name. + :vartype name: str + :ivar type: The hierarchical type of the object. + :vartype type: str + :ivar system_data: Trigger in DataBoxEdge Resource. + :vartype system_data: ~azure.mgmt.databoxedge.v2021_02_01_preview.models.SystemData + :param kind: Required. Trigger Kind.Constant filled by server. Possible values include: + "FileEvent", "PeriodicTimerEvent". + :type kind: str or ~azure.mgmt.databoxedge.v2021_02_01_preview.models.TriggerEventType + :param source_info: Required. Periodic timer details. + :type source_info: ~azure.mgmt.databoxedge.v2021_02_01_preview.models.PeriodicTimerSourceInfo + :param sink_info: Required. Role Sink information. + :type sink_info: ~azure.mgmt.databoxedge.v2021_02_01_preview.models.RoleSinkInfo + :param custom_context_tag: A custom context tag typically used to correlate the trigger against + its usage. For example, if a periodic timer trigger is intended for certain specific IoT + modules in the device, the tag can be the name or the image URL of the module. + :type custom_context_tag: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'system_data': {'readonly': True}, + 'kind': {'required': True}, + 'source_info': {'required': True}, + 'sink_info': {'required': True}, + 'custom_context_tag': {'max_length': 192, 'min_length': 0}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'source_info': {'key': 'properties.sourceInfo', 'type': 'PeriodicTimerSourceInfo'}, + 'sink_info': {'key': 'properties.sinkInfo', 'type': 'RoleSinkInfo'}, + 'custom_context_tag': {'key': 'properties.customContextTag', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(PeriodicTimerEventTrigger, self).__init__(**kwargs) + self.kind = 'PeriodicTimerEvent' # type: str + self.source_info = kwargs['source_info'] + self.sink_info = kwargs['sink_info'] + self.custom_context_tag = kwargs.get('custom_context_tag', None) + + +class PeriodicTimerSourceInfo(msrest.serialization.Model): + """Periodic timer event source. + + All required parameters must be populated in order to send to Azure. + + :param start_time: Required. The time of the day that results in a valid trigger. Schedule is + computed with reference to the time specified upto seconds. If timezone is not specified the + time will considered to be in device timezone. The value will always be returned as UTC time. + :type start_time: ~datetime.datetime + :param schedule: Required. Periodic frequency at which timer event needs to be raised. Supports + daily, hourly, minutes, and seconds. + :type schedule: str + :param topic: Topic where periodic events are published to IoT device. + :type topic: str + """ + + _validation = { + 'start_time': {'required': True}, + 'schedule': {'required': True}, + } + + _attribute_map = { + 'start_time': {'key': 'startTime', 'type': 'iso-8601'}, + 'schedule': {'key': 'schedule', 'type': 'str'}, + 'topic': {'key': 'topic', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(PeriodicTimerSourceInfo, self).__init__(**kwargs) + self.start_time = kwargs['start_time'] + self.schedule = kwargs['schedule'] + self.topic = kwargs.get('topic', None) + + +class RefreshDetails(msrest.serialization.Model): + """Fields for tracking refresh job on the share or container. + + :param in_progress_refresh_job_id: If a refresh job is currently in progress on this share or + container, this field indicates the ARM resource ID of that job. The field is empty if no job + is in progress. + :type in_progress_refresh_job_id: str + :param last_completed_refresh_job_time_in_utc: Indicates the completed time for the last + refresh job on this particular share or container, if any.This could be a failed job or a + successful job. + :type last_completed_refresh_job_time_in_utc: ~datetime.datetime + :param error_manifest_file: Indicates the relative path of the error xml for the last refresh + job on this particular share or container, if any. This could be a failed job or a successful + job. + :type error_manifest_file: str + :param last_job: Indicates the id of the last refresh job on this particular share or + container,if any. This could be a failed job or a successful job. + :type last_job: str + """ + + _attribute_map = { + 'in_progress_refresh_job_id': {'key': 'inProgressRefreshJobId', 'type': 'str'}, + 'last_completed_refresh_job_time_in_utc': {'key': 'lastCompletedRefreshJobTimeInUTC', 'type': 'iso-8601'}, + 'error_manifest_file': {'key': 'errorManifestFile', 'type': 'str'}, + 'last_job': {'key': 'lastJob', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(RefreshDetails, self).__init__(**kwargs) + self.in_progress_refresh_job_id = kwargs.get('in_progress_refresh_job_id', None) + self.last_completed_refresh_job_time_in_utc = kwargs.get('last_completed_refresh_job_time_in_utc', None) + self.error_manifest_file = kwargs.get('error_manifest_file', None) + self.last_job = kwargs.get('last_job', None) + + +class ResourceIdentity(msrest.serialization.Model): + """Msi identity details of the resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param type: Identity type. Possible values include: "None", "SystemAssigned", "UserAssigned". + :type type: str or ~azure.mgmt.databoxedge.v2021_02_01_preview.models.MsiIdentityType + :ivar principal_id: Service Principal Id backing the Msi. + :vartype principal_id: str + :ivar tenant_id: Home Tenant Id. + :vartype tenant_id: str + """ + + _validation = { + 'principal_id': {'readonly': True}, + 'tenant_id': {'readonly': True}, + } + + _attribute_map = { + 'type': {'key': 'type', 'type': 'str'}, + 'principal_id': {'key': 'principalId', 'type': 'str'}, + 'tenant_id': {'key': 'tenantId', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ResourceIdentity, self).__init__(**kwargs) + self.type = kwargs.get('type', None) + self.principal_id = None + self.tenant_id = None + + +class ResourceMoveDetails(msrest.serialization.Model): + """Fields for tracking resource move. + + :param operation_in_progress: Denotes whether move operation is in progress. Possible values + include: "None", "ResourceMoveInProgress", "ResourceMoveFailed". + :type operation_in_progress: str or + ~azure.mgmt.databoxedge.v2021_02_01_preview.models.ResourceMoveStatus + :param operation_in_progress_lock_timeout_in_utc: Denotes the timeout of the operation to + finish. + :type operation_in_progress_lock_timeout_in_utc: ~datetime.datetime + """ + + _attribute_map = { + 'operation_in_progress': {'key': 'operationInProgress', 'type': 'str'}, + 'operation_in_progress_lock_timeout_in_utc': {'key': 'operationInProgressLockTimeoutInUTC', 'type': 'iso-8601'}, + } + + def __init__( + self, + **kwargs + ): + super(ResourceMoveDetails, self).__init__(**kwargs) + self.operation_in_progress = kwargs.get('operation_in_progress', None) + self.operation_in_progress_lock_timeout_in_utc = kwargs.get('operation_in_progress_lock_timeout_in_utc', None) + + +class ResourceTypeSku(msrest.serialization.Model): + """Resource type Sku object. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar resource_type: The resource type. + :vartype resource_type: str + :ivar skus: The skus. + :vartype skus: list[~azure.mgmt.databoxedge.v2021_02_01_preview.models.SkuInformation] + """ + + _validation = { + 'resource_type': {'readonly': True}, + 'skus': {'readonly': True}, + } + + _attribute_map = { + 'resource_type': {'key': 'resourceType', 'type': 'str'}, + 'skus': {'key': 'skus', 'type': '[SkuInformation]'}, + } + + def __init__( + self, + **kwargs + ): + super(ResourceTypeSku, self).__init__(**kwargs) + self.resource_type = None + self.skus = None + + +class RoleList(msrest.serialization.Model): + """Collection of all the roles on the Data Box Edge device. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar value: The Value. + :vartype value: list[~azure.mgmt.databoxedge.v2021_02_01_preview.models.Role] + :ivar next_link: Link to the next set of results. + :vartype next_link: str + """ + + _validation = { + 'value': {'readonly': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[Role]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(RoleList, self).__init__(**kwargs) + self.value = None + self.next_link = None + + +class RoleSinkInfo(msrest.serialization.Model): + """Compute role against which events will be raised. + + All required parameters must be populated in order to send to Azure. + + :param role_id: Required. Compute role ID. + :type role_id: str + """ + + _validation = { + 'role_id': {'required': True}, + } + + _attribute_map = { + 'role_id': {'key': 'roleId', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(RoleSinkInfo, self).__init__(**kwargs) + self.role_id = kwargs['role_id'] + + +class Secret(msrest.serialization.Model): + """Holds device secret either as a KeyVault reference or as an encrypted value. + + :param encrypted_secret: Encrypted (using device public key) secret value. + :type encrypted_secret: + ~azure.mgmt.databoxedge.v2021_02_01_preview.models.AsymmetricEncryptedSecret + :param key_vault_id: Id of the Key-Vault where secret is stored (ex: + secrets/AuthClientSecret/82ef4346187a4033a10d629cde07d740). + :type key_vault_id: str + """ + + _attribute_map = { + 'encrypted_secret': {'key': 'encryptedSecret', 'type': 'AsymmetricEncryptedSecret'}, + 'key_vault_id': {'key': 'keyVaultId', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(Secret, self).__init__(**kwargs) + self.encrypted_secret = kwargs.get('encrypted_secret', None) + self.key_vault_id = kwargs.get('key_vault_id', None) + + +class SecuritySettings(ARMBaseModel): + """The security settings of a device. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: The path ID that uniquely identifies the object. + :vartype id: str + :ivar name: The object name. + :vartype name: str + :ivar type: The hierarchical type of the object. + :vartype type: str + :param device_admin_password: Required. Device administrator password as an encrypted string + (encrypted using RSA PKCS #1) is used to sign into the local web UI of the device. The Actual + password should have at least 8 characters that are a combination of uppercase, lowercase, + numeric, and special characters. + :type device_admin_password: + ~azure.mgmt.databoxedge.v2021_02_01_preview.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[~azure.mgmt.databoxedge.v2021_02_01_preview.models.MetricSpecificationV1] + """ + + _attribute_map = { + 'metric_specifications': {'key': 'metricSpecifications', 'type': '[MetricSpecificationV1]'}, + } + + def __init__( + self, + **kwargs + ): + super(ServiceSpecification, self).__init__(**kwargs) + self.metric_specifications = kwargs.get('metric_specifications', None) + + +class Share(ARMBaseModel): + """Represents a share on the Data Box Edge/Gateway device. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: The path ID that uniquely identifies the object. + :vartype id: str + :ivar name: The object name. + :vartype name: str + :ivar type: The hierarchical type of the object. + :vartype type: str + :ivar system_data: Share on ASE device. + :vartype system_data: ~azure.mgmt.databoxedge.v2021_02_01_preview.models.SystemData + :param description: Description for the share. + :type description: str + :param share_status: Required. Current status of the share. Possible values include: "Offline", + "Unknown", "OK", "Updating", "NeedsAttention". + :type share_status: str or ~azure.mgmt.databoxedge.v2021_02_01_preview.models.ShareStatus + :param monitoring_status: Required. Current monitoring status of the share. Possible values + include: "Enabled", "Disabled". + :type monitoring_status: str or + ~azure.mgmt.databoxedge.v2021_02_01_preview.models.MonitoringStatus + :param azure_container_info: Azure container mapping for the share. + :type azure_container_info: + ~azure.mgmt.databoxedge.v2021_02_01_preview.models.AzureContainerInfo + :param access_protocol: Required. Access protocol to be used by the share. Possible values + include: "SMB", "NFS". + :type access_protocol: str or + ~azure.mgmt.databoxedge.v2021_02_01_preview.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[~azure.mgmt.databoxedge.v2021_02_01_preview.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[~azure.mgmt.databoxedge.v2021_02_01_preview.models.ClientAccessRight] + :param refresh_details: Details of the refresh job on this share. + :type refresh_details: ~azure.mgmt.databoxedge.v2021_02_01_preview.models.RefreshDetails + :ivar share_mappings: Share mount point to the role. + :vartype share_mappings: list[~azure.mgmt.databoxedge.v2021_02_01_preview.models.MountPointMap] + :param data_policy: Data policy of the share. Possible values include: "Cloud", "Local". + :type data_policy: str or ~azure.mgmt.databoxedge.v2021_02_01_preview.models.DataPolicy + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'system_data': {'readonly': True}, + 'share_status': {'required': True}, + 'monitoring_status': {'required': True}, + 'access_protocol': {'required': True}, + 'share_mappings': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + 'share_status': {'key': 'properties.shareStatus', 'type': 'str'}, + 'monitoring_status': {'key': 'properties.monitoringStatus', 'type': 'str'}, + 'azure_container_info': {'key': 'properties.azureContainerInfo', 'type': 'AzureContainerInfo'}, + 'access_protocol': {'key': 'properties.accessProtocol', 'type': 'str'}, + 'user_access_rights': {'key': 'properties.userAccessRights', 'type': '[UserAccessRight]'}, + 'client_access_rights': {'key': 'properties.clientAccessRights', 'type': '[ClientAccessRight]'}, + 'refresh_details': {'key': 'properties.refreshDetails', 'type': 'RefreshDetails'}, + 'share_mappings': {'key': 'properties.shareMappings', 'type': '[MountPointMap]'}, + 'data_policy': {'key': 'properties.dataPolicy', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(Share, self).__init__(**kwargs) + self.system_data = None + self.description = kwargs.get('description', None) + self.share_status = kwargs['share_status'] + self.monitoring_status = kwargs['monitoring_status'] + self.azure_container_info = kwargs.get('azure_container_info', None) + self.access_protocol = kwargs['access_protocol'] + self.user_access_rights = kwargs.get('user_access_rights', None) + self.client_access_rights = kwargs.get('client_access_rights', None) + self.refresh_details = kwargs.get('refresh_details', None) + self.share_mappings = None + self.data_policy = kwargs.get('data_policy', None) + + +class ShareAccessRight(msrest.serialization.Model): + """Specifies the mapping between this particular user and the type of access he has on shares on this device. + + All required parameters must be populated in order to send to Azure. + + :param share_id: Required. The share ID. + :type share_id: str + :param access_type: Required. Type of access to be allowed on the share for this user. Possible + values include: "Change", "Read", "Custom". + :type access_type: str or ~azure.mgmt.databoxedge.v2021_02_01_preview.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[~azure.mgmt.databoxedge.v2021_02_01_preview.models.Share] + :ivar next_link: Link to the next set of results. + :vartype next_link: str + """ + + _validation = { + 'value': {'readonly': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[Share]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ShareList, self).__init__(**kwargs) + self.value = None + self.next_link = None + + +class Sku(msrest.serialization.Model): + """The SKU type. + + :param name: SKU name. Possible values include: "Gateway", "Edge", "TEA_1Node", + "TEA_1Node_UPS", "TEA_1Node_Heater", "TEA_1Node_UPS_Heater", "TEA_4Node_Heater", + "TEA_4Node_UPS_Heater", "TMA", "TDC", "TCA_Small", "GPU", "TCA_Large", "EdgeP_Base", + "EdgeP_High", "EdgePR_Base", "EdgePR_Base_UPS", "EP2_64_1VPU_W", "EP2_128_1T4_Mx1_W", + "EP2_256_2T4_W", "EdgeMR_Mini", "RCA_Small", "RCA_Large", "RDC", "Management". + :type name: str or ~azure.mgmt.databoxedge.v2021_02_01_preview.models.SkuName + :param tier: The SKU tier. This is based on the SKU name. Possible values include: "Standard". + :type tier: str or ~azure.mgmt.databoxedge.v2021_02_01_preview.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: The extended unit. + :vartype extended_unit: str + """ + + _validation = { + 'meter_id': {'readonly': True}, + 'quantity': {'readonly': True}, + 'extended_unit': {'readonly': True}, + } + + _attribute_map = { + 'meter_id': {'key': 'meterId', 'type': 'str'}, + 'quantity': {'key': 'quantity', 'type': 'long'}, + 'extended_unit': {'key': 'extendedUnit', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(SkuCost, self).__init__(**kwargs) + self.meter_id = None + self.quantity = None + self.extended_unit = None + + +class SkuInformation(msrest.serialization.Model): + """Sku information. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar name: The sku name. + :vartype name: str + :ivar tier: The sku tier. + :vartype tier: str + :ivar kind: The sku kind. + :vartype kind: str + :ivar family: The Sku family. + :vartype family: str + :ivar costs: The pricing info of the Sku. + :vartype costs: list[~azure.mgmt.databoxedge.v2021_02_01_preview.models.SkuCost] + :ivar locations: The locations where Sku is available. + :vartype locations: list[str] + :ivar location_info: The locations where Sku is available with zones and sites info. + :vartype location_info: + list[~azure.mgmt.databoxedge.v2021_02_01_preview.models.SkuLocationInfo] + :ivar required_quota_ids: The required quotaIds for the sku to be available. + :vartype required_quota_ids: list[str] + :ivar required_features: The required features for the sku to be available. + :vartype required_features: list[str] + """ + + _validation = { + 'name': {'readonly': True}, + 'tier': {'readonly': True}, + 'kind': {'readonly': True}, + 'family': {'readonly': True}, + 'costs': {'readonly': True}, + 'locations': {'readonly': True}, + 'location_info': {'readonly': True}, + 'required_quota_ids': {'readonly': True}, + 'required_features': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'tier': {'key': 'tier', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'family': {'key': 'family', 'type': 'str'}, + 'costs': {'key': 'costs', 'type': '[SkuCost]'}, + 'locations': {'key': 'locations', 'type': '[str]'}, + 'location_info': {'key': 'locationInfo', 'type': '[SkuLocationInfo]'}, + 'required_quota_ids': {'key': 'requiredQuotaIds', 'type': '[str]'}, + 'required_features': {'key': 'requiredFeatures', 'type': '[str]'}, + } + + def __init__( + self, + **kwargs + ): + super(SkuInformation, self).__init__(**kwargs) + self.name = None + self.tier = None + self.kind = None + self.family = None + self.costs = None + self.locations = None + self.location_info = None + self.required_quota_ids = None + self.required_features = None + + +class SkuInformationList(msrest.serialization.Model): + """List of SKU Information objects. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar value: List of ResourceTypeSku objects. + :vartype value: list[~azure.mgmt.databoxedge.v2021_02_01_preview.models.ResourceTypeSku] + :ivar next_link: Links to the next set of results. + :vartype next_link: str + """ + + _validation = { + 'value': {'readonly': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[ResourceTypeSku]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(SkuInformationList, self).__init__(**kwargs) + self.value = None + self.next_link = None + + +class SkuLocationInfo(msrest.serialization.Model): + """The location info. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar location: The location. + :vartype location: str + :ivar zones: The zones. + :vartype zones: list[str] + :ivar sites: The sites. + :vartype sites: list[str] + """ + + _validation = { + 'location': {'readonly': True}, + 'zones': {'readonly': True}, + 'sites': {'readonly': True}, + } + + _attribute_map = { + 'location': {'key': 'location', 'type': 'str'}, + 'zones': {'key': 'zones', 'type': '[str]'}, + 'sites': {'key': 'sites', 'type': '[str]'}, + } + + def __init__( + self, + **kwargs + ): + super(SkuLocationInfo, self).__init__(**kwargs) + self.location = None + self.zones = None + self.sites = None + + +class StorageAccount(ARMBaseModel): + """Represents a Storage Account on the Data Box Edge/Gateway device. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: The path ID that uniquely identifies the object. + :vartype id: str + :ivar name: The object name. + :vartype name: str + :ivar type: The hierarchical type of the object. + :vartype type: str + :ivar system_data: StorageAccount object on ASE device. + :vartype system_data: ~azure.mgmt.databoxedge.v2021_02_01_preview.models.SystemData + :param description: Description for the storage Account. + :type description: str + :param storage_account_status: Current status of the storage account. Possible values include: + "OK", "Offline", "Unknown", "Updating", "NeedsAttention". + :type storage_account_status: str or + ~azure.mgmt.databoxedge.v2021_02_01_preview.models.StorageAccountStatus + :param data_policy: Required. Data policy of the storage Account. Possible values include: + "Cloud", "Local". + :type data_policy: str or ~azure.mgmt.databoxedge.v2021_02_01_preview.models.DataPolicy + :param storage_account_credential_id: Storage Account Credential Id. + :type storage_account_credential_id: str + :ivar blob_endpoint: BlobEndpoint of Storage Account. + :vartype blob_endpoint: str + :ivar container_count: The Container Count. Present only for Storage Accounts with DataPolicy + set to Cloud. + :vartype container_count: int + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'system_data': {'readonly': True}, + 'data_policy': {'required': True}, + 'blob_endpoint': {'readonly': True}, + 'container_count': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + 'storage_account_status': {'key': 'properties.storageAccountStatus', 'type': 'str'}, + 'data_policy': {'key': 'properties.dataPolicy', 'type': 'str'}, + 'storage_account_credential_id': {'key': 'properties.storageAccountCredentialId', 'type': 'str'}, + 'blob_endpoint': {'key': 'properties.blobEndpoint', 'type': 'str'}, + 'container_count': {'key': 'properties.containerCount', 'type': 'int'}, + } + + def __init__( + self, + **kwargs + ): + super(StorageAccount, self).__init__(**kwargs) + self.system_data = None + self.description = kwargs.get('description', None) + self.storage_account_status = kwargs.get('storage_account_status', None) + self.data_policy = kwargs['data_policy'] + self.storage_account_credential_id = kwargs.get('storage_account_credential_id', None) + self.blob_endpoint = None + self.container_count = None + + +class StorageAccountCredential(ARMBaseModel): + """The storage account credential. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: The path ID that uniquely identifies the object. + :vartype id: str + :ivar name: The object name. + :vartype name: str + :ivar type: The hierarchical type of the object. + :vartype type: str + :ivar system_data: StorageAccountCredential object. + :vartype system_data: ~azure.mgmt.databoxedge.v2021_02_01_preview.models.SystemData + :param alias: Required. Alias for the storage account. + :type alias: str + :param user_name: Username for the storage account. + :type user_name: str + :param account_key: Encrypted storage key. + :type account_key: ~azure.mgmt.databoxedge.v2021_02_01_preview.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 ~azure.mgmt.databoxedge.v2021_02_01_preview.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 ~azure.mgmt.databoxedge.v2021_02_01_preview.models.AccountType + :param storage_account_id: Id of the storage account. + :type storage_account_id: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'system_data': {'readonly': True}, + 'alias': {'required': True}, + 'ssl_status': {'required': True}, + 'account_type': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'alias': {'key': 'properties.alias', 'type': 'str'}, + 'user_name': {'key': 'properties.userName', 'type': 'str'}, + 'account_key': {'key': 'properties.accountKey', 'type': 'AsymmetricEncryptedSecret'}, + 'connection_string': {'key': 'properties.connectionString', 'type': 'str'}, + 'ssl_status': {'key': 'properties.sslStatus', 'type': 'str'}, + 'blob_domain_name': {'key': 'properties.blobDomainName', 'type': 'str'}, + 'account_type': {'key': 'properties.accountType', 'type': 'str'}, + 'storage_account_id': {'key': 'properties.storageAccountId', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(StorageAccountCredential, self).__init__(**kwargs) + self.system_data = None + self.alias = kwargs['alias'] + self.user_name = kwargs.get('user_name', None) + self.account_key = kwargs.get('account_key', None) + self.connection_string = kwargs.get('connection_string', None) + self.ssl_status = kwargs['ssl_status'] + self.blob_domain_name = kwargs.get('blob_domain_name', None) + self.account_type = kwargs['account_type'] + self.storage_account_id = kwargs.get('storage_account_id', None) + + +class StorageAccountCredentialList(msrest.serialization.Model): + """The collection of storage account credentials. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar value: The value. + :vartype value: + list[~azure.mgmt.databoxedge.v2021_02_01_preview.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[~azure.mgmt.databoxedge.v2021_02_01_preview.models.StorageAccount] + :ivar next_link: Link to the next set of results. + :vartype next_link: str + """ + + _validation = { + 'value': {'readonly': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[StorageAccount]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(StorageAccountList, self).__init__(**kwargs) + self.value = None + self.next_link = None + + +class SubscriptionRegisteredFeatures(msrest.serialization.Model): + """SubscriptionRegisteredFeatures. + + :param name: + :type name: str + :param state: + :type state: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'state': {'key': 'state', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(SubscriptionRegisteredFeatures, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.state = kwargs.get('state', None) + + +class SymmetricKey(msrest.serialization.Model): + """Symmetric key for authentication. + + :param connection_string: Connection string based on the symmetric key. + :type connection_string: + ~azure.mgmt.databoxedge.v2021_02_01_preview.models.AsymmetricEncryptedSecret + """ + + _attribute_map = { + 'connection_string': {'key': 'connectionString', 'type': 'AsymmetricEncryptedSecret'}, + } + + def __init__( + self, + **kwargs + ): + super(SymmetricKey, self).__init__(**kwargs) + self.connection_string = kwargs.get('connection_string', None) + + +class SystemData(msrest.serialization.Model): + """Metadata pertaining to creation and last modification of the resource. + + :param created_by: The identity that created the resource. + :type created_by: str + :param created_by_type: The type of identity that created the resource. Possible values + include: "User", "Application", "ManagedIdentity", "Key". + :type created_by_type: str or ~azure.mgmt.databoxedge.v2021_02_01_preview.models.CreatedByType + :param created_at: The timestamp of resource creation (UTC). + :type created_at: ~datetime.datetime + :param last_modified_by: The identity that last modified the resource. + :type last_modified_by: str + :param last_modified_by_type: The type of identity that last modified the resource. Possible + values include: "User", "Application", "ManagedIdentity", "Key". + :type last_modified_by_type: str or + ~azure.mgmt.databoxedge.v2021_02_01_preview.models.CreatedByType + :param last_modified_at: The type of identity that last modified the resource. + :type last_modified_at: ~datetime.datetime + """ + + _attribute_map = { + 'created_by': {'key': 'createdBy', 'type': 'str'}, + 'created_by_type': {'key': 'createdByType', 'type': 'str'}, + 'created_at': {'key': 'createdAt', 'type': 'iso-8601'}, + 'last_modified_by': {'key': 'lastModifiedBy', 'type': 'str'}, + 'last_modified_by_type': {'key': 'lastModifiedByType', 'type': 'str'}, + 'last_modified_at': {'key': 'lastModifiedAt', 'type': 'iso-8601'}, + } + + def __init__( + self, + **kwargs + ): + super(SystemData, self).__init__(**kwargs) + self.created_by = kwargs.get('created_by', None) + self.created_by_type = kwargs.get('created_by_type', None) + self.created_at = kwargs.get('created_at', None) + self.last_modified_by = kwargs.get('last_modified_by', None) + self.last_modified_by_type = kwargs.get('last_modified_by_type', None) + self.last_modified_at = kwargs.get('last_modified_at', None) + + +class TrackingInfo(msrest.serialization.Model): + """Tracking courier information. + + :param serial_number: Serial number of the device being tracked. + :type serial_number: str + :param carrier_name: Name of the carrier used in the delivery. + :type carrier_name: str + :param tracking_id: Tracking ID of the shipment. + :type tracking_id: str + :param tracking_url: Tracking URL of the shipment. + :type tracking_url: str + """ + + _attribute_map = { + 'serial_number': {'key': 'serialNumber', 'type': 'str'}, + 'carrier_name': {'key': 'carrierName', 'type': 'str'}, + 'tracking_id': {'key': 'trackingId', 'type': 'str'}, + 'tracking_url': {'key': 'trackingUrl', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(TrackingInfo, self).__init__(**kwargs) + self.serial_number = kwargs.get('serial_number', None) + self.carrier_name = kwargs.get('carrier_name', None) + self.tracking_id = kwargs.get('tracking_id', None) + self.tracking_url = kwargs.get('tracking_url', None) + + +class TriggerList(msrest.serialization.Model): + """Collection of all trigger on the data box edge device. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar value: The list of triggers. + :vartype value: list[~azure.mgmt.databoxedge.v2021_02_01_preview.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 UpdateDetails(msrest.serialization.Model): + """Update Specific attributes. + + :param update_title: Title of the Update. + :type update_title: str + :param update_size: Size of the update(In Bytes). + :type update_size: float + :param update_type: Type of the Update. Possible values include: "Software", "Kubernetes", + "Firmware". + :type update_type: str or ~azure.mgmt.databoxedge.v2021_02_01_preview.models.UpdateType + :param target_version: Target Version number. + :type target_version: str + :param estimated_install_time_in_mins: Estimated Install Time for the update. + :type estimated_install_time_in_mins: int + :param reboot_behavior: Indicates if updates are available and at least one of the updates + needs a reboot. Possible values include: "NeverReboots", "RequiresReboot", "RequestReboot". + :type reboot_behavior: str or + ~azure.mgmt.databoxedge.v2021_02_01_preview.models.InstallRebootBehavior + :param status: Status of the update. Possible values include: "DownloadPending", + "DownloadStarted", "DownloadCompleted", "InstallStarted", "InstallCompleted". + :type status: str or ~azure.mgmt.databoxedge.v2021_02_01_preview.models.UpdateStatus + """ + + _attribute_map = { + 'update_title': {'key': 'updateTitle', 'type': 'str'}, + 'update_size': {'key': 'updateSize', 'type': 'float'}, + 'update_type': {'key': 'updateType', 'type': 'str'}, + 'target_version': {'key': 'targetVersion', 'type': 'str'}, + 'estimated_install_time_in_mins': {'key': 'estimatedInstallTimeInMins', 'type': 'int'}, + 'reboot_behavior': {'key': 'rebootBehavior', 'type': 'str'}, + 'status': {'key': 'status', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(UpdateDetails, self).__init__(**kwargs) + self.update_title = kwargs.get('update_title', None) + self.update_size = kwargs.get('update_size', None) + self.update_type = kwargs.get('update_type', None) + self.target_version = kwargs.get('target_version', None) + self.estimated_install_time_in_mins = kwargs.get('estimated_install_time_in_mins', None) + self.reboot_behavior = kwargs.get('reboot_behavior', None) + self.status = kwargs.get('status', None) + + +class UpdateDownloadProgress(msrest.serialization.Model): + """Details about the download progress of update. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar download_phase: The download phase. Possible values include: "Unknown", "Initializing", + "Downloading", "Verifying". + :vartype download_phase: str or + ~azure.mgmt.databoxedge.v2021_02_01_preview.models.DownloadPhase + :ivar percent_complete: Percentage of completion. + :vartype percent_complete: int + :ivar total_bytes_to_download: Total bytes to download. + :vartype total_bytes_to_download: float + :ivar total_bytes_downloaded: Total bytes downloaded. + :vartype total_bytes_downloaded: float + :ivar number_of_updates_to_download: Number of updates to download. + :vartype number_of_updates_to_download: int + :ivar number_of_updates_downloaded: Number of updates downloaded. + :vartype number_of_updates_downloaded: int + """ + + _validation = { + 'download_phase': {'readonly': True}, + 'percent_complete': {'readonly': True}, + 'total_bytes_to_download': {'readonly': True}, + 'total_bytes_downloaded': {'readonly': True}, + 'number_of_updates_to_download': {'readonly': True}, + 'number_of_updates_downloaded': {'readonly': True}, + } + + _attribute_map = { + 'download_phase': {'key': 'downloadPhase', 'type': 'str'}, + 'percent_complete': {'key': 'percentComplete', 'type': 'int'}, + 'total_bytes_to_download': {'key': 'totalBytesToDownload', 'type': 'float'}, + 'total_bytes_downloaded': {'key': 'totalBytesDownloaded', 'type': 'float'}, + 'number_of_updates_to_download': {'key': 'numberOfUpdatesToDownload', 'type': 'int'}, + 'number_of_updates_downloaded': {'key': 'numberOfUpdatesDownloaded', 'type': 'int'}, + } + + def __init__( + self, + **kwargs + ): + super(UpdateDownloadProgress, self).__init__(**kwargs) + self.download_phase = None + self.percent_complete = None + self.total_bytes_to_download = None + self.total_bytes_downloaded = None + self.number_of_updates_to_download = None + self.number_of_updates_downloaded = None + + +class UpdateInstallProgress(msrest.serialization.Model): + """Progress details during installation of updates. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar percent_complete: Percentage completed. + :vartype percent_complete: int + :ivar number_of_updates_to_install: Number of updates to install. + :vartype number_of_updates_to_install: int + :ivar number_of_updates_installed: Number of updates installed. + :vartype number_of_updates_installed: int + """ + + _validation = { + 'percent_complete': {'readonly': True}, + 'number_of_updates_to_install': {'readonly': True}, + 'number_of_updates_installed': {'readonly': True}, + } + + _attribute_map = { + 'percent_complete': {'key': 'percentComplete', 'type': 'int'}, + 'number_of_updates_to_install': {'key': 'numberOfUpdatesToInstall', 'type': 'int'}, + 'number_of_updates_installed': {'key': 'numberOfUpdatesInstalled', 'type': 'int'}, + } + + def __init__( + self, + **kwargs + ): + super(UpdateInstallProgress, self).__init__(**kwargs) + self.percent_complete = None + self.number_of_updates_to_install = None + self.number_of_updates_installed = None + + +class UpdateSummary(ARMBaseModel): + """Details about ongoing updates and availability of updates on the device. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: The path ID that uniquely identifies the object. + :vartype id: str + :ivar name: The object name. + :vartype name: str + :ivar type: The hierarchical type of the object. + :vartype type: str + :ivar system_data: UpdateSummary Result. + :vartype system_data: ~azure.mgmt.databoxedge.v2021_02_01_preview.models.SystemData + :param device_version_number: The current version of the device in format: 1.2.17312.13.",. + :type device_version_number: str + :param friendly_device_version_name: The current version of the device in text format. + :type friendly_device_version_name: str + :param device_last_scanned_date_time: The last time when a scan was done on the device. + :type device_last_scanned_date_time: ~datetime.datetime + :param last_completed_scan_job_date_time: The time when the last scan job was completed + (success/cancelled/failed) on the appliance. + :type last_completed_scan_job_date_time: ~datetime.datetime + :ivar last_completed_download_job_date_time: The time when the last Download job was completed + (success/cancelled/failed) on the appliance. + :vartype last_completed_download_job_date_time: ~datetime.datetime + :ivar last_completed_download_job_id: JobId of the last ran download job.(Can be + success/cancelled/failed). + :vartype last_completed_download_job_id: str + :ivar last_download_job_status: JobStatus of the last ran download job. Possible values + include: "Invalid", "Running", "Succeeded", "Failed", "Canceled", "Paused", "Scheduled". + :vartype last_download_job_status: str or + ~azure.mgmt.databoxedge.v2021_02_01_preview.models.JobStatus + :ivar last_completed_install_job_date_time: The time when the last Install job was completed + (success/cancelled/failed) on the appliance. + :vartype last_completed_install_job_date_time: ~datetime.datetime + :ivar last_completed_install_job_id: JobId of the last ran install job.(Can be + success/cancelled/failed). + :vartype last_completed_install_job_id: str + :ivar last_install_job_status: JobStatus of the last ran install job. Possible values include: + "Invalid", "Running", "Succeeded", "Failed", "Canceled", "Paused", "Scheduled". + :vartype last_install_job_status: str or + ~azure.mgmt.databoxedge.v2021_02_01_preview.models.JobStatus + :ivar total_number_of_updates_available: The number of updates available for the current device + version as per the last device scan. + :vartype total_number_of_updates_available: int + :ivar total_number_of_updates_pending_download: The total number of items pending download. + :vartype total_number_of_updates_pending_download: int + :ivar total_number_of_updates_pending_install: The total number of items pending install. + :vartype total_number_of_updates_pending_install: int + :ivar reboot_behavior: Indicates if updates are available and at least one of the updates needs + a reboot. Possible values include: "NeverReboots", "RequiresReboot", "RequestReboot". + :vartype reboot_behavior: str or + ~azure.mgmt.databoxedge.v2021_02_01_preview.models.InstallRebootBehavior + :ivar ongoing_update_operation: The current update operation. Possible values include: "None", + "Scan", "Download", "Install". + :vartype ongoing_update_operation: str or + ~azure.mgmt.databoxedge.v2021_02_01_preview.models.UpdateOperation + :ivar in_progress_download_job_id: The job ID of the download job in progress. + :vartype in_progress_download_job_id: str + :ivar in_progress_install_job_id: The job ID of the install job in progress. + :vartype in_progress_install_job_id: str + :ivar in_progress_download_job_started_date_time: The time when the currently running download + (if any) started. + :vartype in_progress_download_job_started_date_time: ~datetime.datetime + :ivar in_progress_install_job_started_date_time: The time when the currently running install + (if any) started. + :vartype in_progress_install_job_started_date_time: ~datetime.datetime + :ivar update_titles: The list of updates available for install. + :vartype update_titles: list[str] + :ivar updates: The list of updates available for install. + :vartype updates: list[~azure.mgmt.databoxedge.v2021_02_01_preview.models.UpdateDetails] + :ivar total_update_size_in_bytes: The total size of updates available for download in bytes. + :vartype total_update_size_in_bytes: float + :ivar total_time_in_minutes: The total time in Minutes. + :vartype total_time_in_minutes: int + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'system_data': {'readonly': True}, + 'last_completed_download_job_date_time': {'readonly': True}, + 'last_completed_download_job_id': {'readonly': True}, + 'last_download_job_status': {'readonly': True}, + 'last_completed_install_job_date_time': {'readonly': True}, + 'last_completed_install_job_id': {'readonly': True}, + 'last_install_job_status': {'readonly': True}, + 'total_number_of_updates_available': {'readonly': True}, + 'total_number_of_updates_pending_download': {'readonly': True}, + 'total_number_of_updates_pending_install': {'readonly': True}, + 'reboot_behavior': {'readonly': True}, + 'ongoing_update_operation': {'readonly': True}, + 'in_progress_download_job_id': {'readonly': True}, + 'in_progress_install_job_id': {'readonly': True}, + 'in_progress_download_job_started_date_time': {'readonly': True}, + 'in_progress_install_job_started_date_time': {'readonly': True}, + 'update_titles': {'readonly': True}, + 'updates': {'readonly': True}, + 'total_update_size_in_bytes': {'readonly': True}, + 'total_time_in_minutes': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'device_version_number': {'key': 'properties.deviceVersionNumber', 'type': 'str'}, + 'friendly_device_version_name': {'key': 'properties.friendlyDeviceVersionName', 'type': 'str'}, + 'device_last_scanned_date_time': {'key': 'properties.deviceLastScannedDateTime', 'type': 'iso-8601'}, + 'last_completed_scan_job_date_time': {'key': 'properties.lastCompletedScanJobDateTime', 'type': 'iso-8601'}, + 'last_completed_download_job_date_time': {'key': 'properties.lastCompletedDownloadJobDateTime', 'type': 'iso-8601'}, + 'last_completed_download_job_id': {'key': 'properties.lastCompletedDownloadJobId', 'type': 'str'}, + 'last_download_job_status': {'key': 'properties.lastDownloadJobStatus', 'type': 'str'}, + 'last_completed_install_job_date_time': {'key': 'properties.lastCompletedInstallJobDateTime', 'type': 'iso-8601'}, + 'last_completed_install_job_id': {'key': 'properties.lastCompletedInstallJobId', 'type': 'str'}, + 'last_install_job_status': {'key': 'properties.lastInstallJobStatus', 'type': 'str'}, + 'total_number_of_updates_available': {'key': 'properties.totalNumberOfUpdatesAvailable', 'type': 'int'}, + 'total_number_of_updates_pending_download': {'key': 'properties.totalNumberOfUpdatesPendingDownload', 'type': 'int'}, + 'total_number_of_updates_pending_install': {'key': 'properties.totalNumberOfUpdatesPendingInstall', 'type': 'int'}, + 'reboot_behavior': {'key': 'properties.rebootBehavior', 'type': 'str'}, + 'ongoing_update_operation': {'key': 'properties.ongoingUpdateOperation', 'type': 'str'}, + 'in_progress_download_job_id': {'key': 'properties.inProgressDownloadJobId', 'type': 'str'}, + 'in_progress_install_job_id': {'key': 'properties.inProgressInstallJobId', 'type': 'str'}, + 'in_progress_download_job_started_date_time': {'key': 'properties.inProgressDownloadJobStartedDateTime', 'type': 'iso-8601'}, + 'in_progress_install_job_started_date_time': {'key': 'properties.inProgressInstallJobStartedDateTime', 'type': 'iso-8601'}, + 'update_titles': {'key': 'properties.updateTitles', 'type': '[str]'}, + 'updates': {'key': 'properties.updates', 'type': '[UpdateDetails]'}, + 'total_update_size_in_bytes': {'key': 'properties.totalUpdateSizeInBytes', 'type': 'float'}, + 'total_time_in_minutes': {'key': 'properties.totalTimeInMinutes', 'type': 'int'}, + } + + def __init__( + self, + **kwargs + ): + super(UpdateSummary, self).__init__(**kwargs) + self.system_data = None + self.device_version_number = kwargs.get('device_version_number', None) + self.friendly_device_version_name = kwargs.get('friendly_device_version_name', None) + self.device_last_scanned_date_time = kwargs.get('device_last_scanned_date_time', None) + self.last_completed_scan_job_date_time = kwargs.get('last_completed_scan_job_date_time', None) + self.last_completed_download_job_date_time = None + self.last_completed_download_job_id = None + self.last_download_job_status = None + self.last_completed_install_job_date_time = None + self.last_completed_install_job_id = None + self.last_install_job_status = None + self.total_number_of_updates_available = None + self.total_number_of_updates_pending_download = None + self.total_number_of_updates_pending_install = None + self.reboot_behavior = None + self.ongoing_update_operation = None + self.in_progress_download_job_id = None + self.in_progress_install_job_id = None + self.in_progress_download_job_started_date_time = None + self.in_progress_install_job_started_date_time = None + self.update_titles = None + self.updates = None + self.total_update_size_in_bytes = None + self.total_time_in_minutes = None + + +class UploadCertificateRequest(msrest.serialization.Model): + """The upload certificate request. + + All required parameters must be populated in order to send to Azure. + + :param authentication_type: The authentication type. Possible values include: "Invalid", + "AzureActiveDirectory". + :type authentication_type: str or + ~azure.mgmt.databoxedge.v2021_02_01_preview.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 ~azure.mgmt.databoxedge.v2021_02_01_preview.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. + + :ivar id: The path ID that uniquely identifies the object. + :vartype id: str + :ivar name: The object name. + :vartype name: str + :ivar type: The hierarchical type of the object. + :vartype type: str + :ivar system_data: User in DataBoxEdge Resource. + :vartype system_data: ~azure.mgmt.databoxedge.v2021_02_01_preview.models.SystemData + :param encrypted_password: The password details. + :type encrypted_password: + ~azure.mgmt.databoxedge.v2021_02_01_preview.models.AsymmetricEncryptedSecret + :ivar share_access_rights: List of shares that the user has rights on. This field should not be + specified during user creation. + :vartype share_access_rights: + list[~azure.mgmt.databoxedge.v2021_02_01_preview.models.ShareAccessRight] + :param user_type: Type of the user. Possible values include: "Share", "LocalManagement", "ARM". + :type user_type: str or ~azure.mgmt.databoxedge.v2021_02_01_preview.models.UserType + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'system_data': {'readonly': True}, + 'share_access_rights': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'encrypted_password': {'key': 'properties.encryptedPassword', 'type': 'AsymmetricEncryptedSecret'}, + 'share_access_rights': {'key': 'properties.shareAccessRights', 'type': '[ShareAccessRight]'}, + 'user_type': {'key': 'properties.userType', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(User, self).__init__(**kwargs) + self.system_data = None + self.encrypted_password = kwargs.get('encrypted_password', None) + self.share_access_rights = None + self.user_type = kwargs.get('user_type', None) + + +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 ~azure.mgmt.databoxedge.v2021_02_01_preview.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[~azure.mgmt.databoxedge.v2021_02_01_preview.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/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2021_02_01_preview/models/_models_py3.py b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2021_02_01_preview/models/_models_py3.py new file mode 100644 index 000000000000..646fd8f45498 --- /dev/null +++ b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2021_02_01_preview/models/_models_py3.py @@ -0,0 +1,5512 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +import datetime +from typing import Dict, List, Optional, Union + +import msrest.serialization + +from ._data_box_edge_management_client_enums import * + + +class ARMBaseModel(msrest.serialization.Model): + """Represents the base class for all object models. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: The path ID that uniquely identifies the object. + :vartype id: str + :ivar name: The object name. + :vartype name: str + :ivar type: The hierarchical type of the object. + :vartype type: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ARMBaseModel, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None + + +class Addon(ARMBaseModel): + """Role Addon. + + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: ArcAddon, IoTAddon. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: The path ID that uniquely identifies the object. + :vartype id: str + :ivar name: The object name. + :vartype name: str + :ivar type: The hierarchical type of the object. + :vartype type: str + :param kind: Required. Addon type.Constant filled by server. Possible values include: + "IotEdge", "ArcForKubernetes". + :type kind: str or ~azure.mgmt.databoxedge.v2021_02_01_preview.models.AddonType + :ivar system_data: Addon type. + :vartype system_data: ~azure.mgmt.databoxedge.v2021_02_01_preview.models.SystemData + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'kind': {'required': True}, + 'system_data': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + } + + _subtype_map = { + 'kind': {'ArcForKubernetes': 'ArcAddon', 'IotEdge': 'IoTAddon'} + } + + def __init__( + self, + **kwargs + ): + super(Addon, self).__init__(**kwargs) + self.kind = 'Addon' # type: str + self.system_data = None + + +class AddonList(msrest.serialization.Model): + """Collection of all the Role addon on the Azure Stack Edge device. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar value: The Value. + :vartype value: list[~azure.mgmt.databoxedge.v2021_02_01_preview.models.Addon] + :ivar next_link: Link to the next set of results. + :vartype next_link: str + """ + + _validation = { + 'value': {'readonly': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[Addon]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(AddonList, self).__init__(**kwargs) + self.value = None + self.next_link = None + + +class Address(msrest.serialization.Model): + """The shipping address of the customer. + + All required parameters must be populated in order to send to Azure. + + :param address_line1: The address line1. + :type address_line1: str + :param address_line2: The address line2. + :type address_line2: str + :param address_line3: The address line3. + :type address_line3: str + :param postal_code: The postal code. + :type postal_code: str + :param city: The city name. + :type city: str + :param state: The state name. + :type state: str + :param country: Required. The country name. + :type country: str + """ + + _validation = { + 'country': {'required': True}, + } + + _attribute_map = { + 'address_line1': {'key': 'addressLine1', 'type': 'str'}, + 'address_line2': {'key': 'addressLine2', 'type': 'str'}, + 'address_line3': {'key': 'addressLine3', 'type': 'str'}, + 'postal_code': {'key': 'postalCode', 'type': 'str'}, + 'city': {'key': 'city', 'type': 'str'}, + 'state': {'key': 'state', 'type': 'str'}, + 'country': {'key': 'country', 'type': 'str'}, + } + + def __init__( + self, + *, + country: str, + address_line1: Optional[str] = None, + address_line2: Optional[str] = None, + address_line3: Optional[str] = None, + postal_code: Optional[str] = None, + city: Optional[str] = None, + state: Optional[str] = None, + **kwargs + ): + super(Address, self).__init__(**kwargs) + self.address_line1 = address_line1 + self.address_line2 = address_line2 + self.address_line3 = address_line3 + self.postal_code = postal_code + self.city = city + self.state = state + self.country = country + + +class Alert(ARMBaseModel): + """Alert on the data box edge/gateway device. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: The path ID that uniquely identifies the object. + :vartype id: str + :ivar name: The object name. + :vartype name: str + :ivar type: The hierarchical type of the object. + :vartype type: str + :ivar system_data: Alert generated in the resource. + :vartype system_data: ~azure.mgmt.databoxedge.v2021_02_01_preview.models.SystemData + :ivar title: Alert title. + :vartype title: str + :ivar alert_type: Alert type. + :vartype alert_type: str + :ivar appeared_at_date_time: UTC time when the alert appeared. + :vartype appeared_at_date_time: ~datetime.datetime + :ivar recommendation: Alert recommendation. + :vartype recommendation: str + :ivar severity: Severity of the alert. Possible values include: "Informational", "Warning", + "Critical". + :vartype severity: str or ~azure.mgmt.databoxedge.v2021_02_01_preview.models.AlertSeverity + :ivar error_details: Error details of the alert. + :vartype error_details: ~azure.mgmt.databoxedge.v2021_02_01_preview.models.AlertErrorDetails + :ivar detailed_information: Alert details. + :vartype detailed_information: dict[str, str] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'system_data': {'readonly': True}, + 'title': {'readonly': True}, + 'alert_type': {'readonly': True}, + 'appeared_at_date_time': {'readonly': True}, + 'recommendation': {'readonly': True}, + 'severity': {'readonly': True}, + 'error_details': {'readonly': True}, + 'detailed_information': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'title': {'key': 'properties.title', 'type': 'str'}, + 'alert_type': {'key': 'properties.alertType', 'type': 'str'}, + 'appeared_at_date_time': {'key': 'properties.appearedAtDateTime', 'type': 'iso-8601'}, + 'recommendation': {'key': 'properties.recommendation', 'type': 'str'}, + 'severity': {'key': 'properties.severity', 'type': 'str'}, + 'error_details': {'key': 'properties.errorDetails', 'type': 'AlertErrorDetails'}, + 'detailed_information': {'key': 'properties.detailedInformation', 'type': '{str}'}, + } + + def __init__( + self, + **kwargs + ): + super(Alert, self).__init__(**kwargs) + self.system_data = None + self.title = None + self.alert_type = None + self.appeared_at_date_time = None + self.recommendation = None + self.severity = None + self.error_details = None + self.detailed_information = None + + +class AlertErrorDetails(msrest.serialization.Model): + """Error details for the alert. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar error_code: Error code. + :vartype error_code: str + :ivar error_message: Error Message. + :vartype error_message: str + :ivar occurrences: Number of occurrences. + :vartype occurrences: int + """ + + _validation = { + 'error_code': {'readonly': True}, + 'error_message': {'readonly': True}, + 'occurrences': {'readonly': True}, + } + + _attribute_map = { + 'error_code': {'key': 'errorCode', 'type': 'str'}, + 'error_message': {'key': 'errorMessage', 'type': 'str'}, + 'occurrences': {'key': 'occurrences', 'type': 'int'}, + } + + def __init__( + self, + **kwargs + ): + super(AlertErrorDetails, self).__init__(**kwargs) + self.error_code = None + self.error_message = None + self.occurrences = None + + +class AlertList(msrest.serialization.Model): + """Collection of alerts. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar value: The value. + :vartype value: list[~azure.mgmt.databoxedge.v2021_02_01_preview.models.Alert] + :ivar next_link: Link to the next set of results. + :vartype next_link: str + """ + + _validation = { + 'value': {'readonly': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[Alert]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(AlertList, self).__init__(**kwargs) + self.value = None + self.next_link = None + + +class ArcAddon(Addon): + """Arc Addon. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: The path ID that uniquely identifies the object. + :vartype id: str + :ivar name: The object name. + :vartype name: str + :ivar type: The hierarchical type of the object. + :vartype type: str + :param kind: Required. Addon type.Constant filled by server. Possible values include: + "IotEdge", "ArcForKubernetes". + :type kind: str or ~azure.mgmt.databoxedge.v2021_02_01_preview.models.AddonType + :ivar system_data: Addon type. + :vartype system_data: ~azure.mgmt.databoxedge.v2021_02_01_preview.models.SystemData + :param subscription_id: Required. Arc resource subscription Id. + :type subscription_id: str + :param resource_group_name: Required. Arc resource group name. + :type resource_group_name: str + :param resource_name: Required. Arc resource Name. + :type resource_name: str + :param resource_location: Required. Arc resource location. + :type resource_location: str + :ivar version: Arc resource version. + :vartype version: str + :ivar host_platform: Host OS supported by the Arc addon. Possible values include: "Windows", + "Linux". + :vartype host_platform: str or ~azure.mgmt.databoxedge.v2021_02_01_preview.models.PlatformType + :ivar host_platform_type: Platform where the runtime is hosted. Possible values include: + "KubernetesCluster", "LinuxVM". + :vartype host_platform_type: str or + ~azure.mgmt.databoxedge.v2021_02_01_preview.models.HostPlatformType + :ivar provisioning_state: Addon Provisioning State. Possible values include: "Invalid", + "Creating", "Created", "Updating", "Reconfiguring", "Failed", "Deleting". + :vartype provisioning_state: str or + ~azure.mgmt.databoxedge.v2021_02_01_preview.models.AddonState + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'kind': {'required': True}, + 'system_data': {'readonly': True}, + 'subscription_id': {'required': True}, + 'resource_group_name': {'required': True}, + 'resource_name': {'required': True}, + 'resource_location': {'required': True}, + 'version': {'readonly': True}, + 'host_platform': {'readonly': True}, + 'host_platform_type': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'subscription_id': {'key': 'properties.subscriptionId', 'type': 'str'}, + 'resource_group_name': {'key': 'properties.resourceGroupName', 'type': 'str'}, + 'resource_name': {'key': 'properties.resourceName', 'type': 'str'}, + 'resource_location': {'key': 'properties.resourceLocation', 'type': 'str'}, + 'version': {'key': 'properties.version', 'type': 'str'}, + 'host_platform': {'key': 'properties.hostPlatform', 'type': 'str'}, + 'host_platform_type': {'key': 'properties.hostPlatformType', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + } + + def __init__( + self, + *, + subscription_id: str, + resource_group_name: str, + resource_name: str, + resource_location: str, + **kwargs + ): + super(ArcAddon, self).__init__(**kwargs) + self.kind = 'ArcForKubernetes' # type: str + self.subscription_id = subscription_id + self.resource_group_name = resource_group_name + self.resource_name = resource_name + self.resource_location = resource_location + self.version = None + self.host_platform = None + self.host_platform_type = None + self.provisioning_state = None + + +class AsymmetricEncryptedSecret(msrest.serialization.Model): + """Represent the secrets intended for encryption with asymmetric key pair. + + All required parameters must be populated in order to send to Azure. + + :param value: Required. The value of the secret. + :type value: str + :param encryption_cert_thumbprint: Thumbprint certificate used to encrypt \"Value\". If the + value is unencrypted, it will be null. + :type encryption_cert_thumbprint: str + :param encryption_algorithm: Required. The algorithm used to encrypt "Value". Possible values + include: "None", "AES256", "RSAES_PKCS1_v_1_5". + :type encryption_algorithm: str or + ~azure.mgmt.databoxedge.v2021_02_01_preview.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: ~azure.mgmt.databoxedge.v2021_02_01_preview.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 + ~azure.mgmt.databoxedge.v2021_02_01_preview.models.AzureContainerDataFormat + """ + + _validation = { + 'storage_account_credential_id': {'required': True}, + 'container_name': {'required': True}, + 'data_format': {'required': True}, + } + + _attribute_map = { + 'storage_account_credential_id': {'key': 'storageAccountCredentialId', 'type': 'str'}, + 'container_name': {'key': 'containerName', 'type': 'str'}, + 'data_format': {'key': 'dataFormat', 'type': 'str'}, + } + + def __init__( + self, + *, + storage_account_credential_id: str, + container_name: str, + data_format: Union[str, "AzureContainerDataFormat"], + **kwargs + ): + super(AzureContainerInfo, self).__init__(**kwargs) + self.storage_account_credential_id = storage_account_credential_id + self.container_name = container_name + self.data_format = data_format + + +class BandwidthSchedule(ARMBaseModel): + """The bandwidth schedule details. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: The path ID that uniquely identifies the object. + :vartype id: str + :ivar name: The object name. + :vartype name: str + :ivar type: The hierarchical type of the object. + :vartype type: str + :ivar system_data: Bandwidth object related to ASE resource. + :vartype system_data: ~azure.mgmt.databoxedge.v2021_02_01_preview.models.SystemData + :param start: Required. The start time of the schedule in UTC. + :type start: str + :param stop: Required. The stop time of the schedule in UTC. + :type stop: str + :param rate_in_mbps: Required. The bandwidth rate in Mbps. + :type rate_in_mbps: int + :param days: Required. The days of the week when this schedule is applicable. + :type days: list[str or ~azure.mgmt.databoxedge.v2021_02_01_preview.models.DayOfWeek] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'system_data': {'readonly': True}, + 'start': {'required': True}, + 'stop': {'required': True}, + 'rate_in_mbps': {'required': True}, + 'days': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'start': {'key': 'properties.start', 'type': 'str'}, + 'stop': {'key': 'properties.stop', 'type': 'str'}, + 'rate_in_mbps': {'key': 'properties.rateInMbps', 'type': 'int'}, + 'days': {'key': 'properties.days', 'type': '[str]'}, + } + + def __init__( + self, + *, + start: str, + stop: str, + rate_in_mbps: int, + days: List[Union[str, "DayOfWeek"]], + **kwargs + ): + super(BandwidthSchedule, self).__init__(**kwargs) + self.system_data = None + self.start = start + self.stop = stop + self.rate_in_mbps = rate_in_mbps + self.days = days + + +class BandwidthSchedulesList(msrest.serialization.Model): + """The collection of bandwidth schedules. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar value: The list of bandwidth schedules. + :vartype value: list[~azure.mgmt.databoxedge.v2021_02_01_preview.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 + ~azure.mgmt.databoxedge.v2021_02_01_preview.models.ClientPermissionType + """ + + _validation = { + 'client': {'required': True}, + 'access_permission': {'required': True}, + } + + _attribute_map = { + 'client': {'key': 'client', 'type': 'str'}, + 'access_permission': {'key': 'accessPermission', 'type': 'str'}, + } + + def __init__( + self, + *, + client: str, + access_permission: Union[str, "ClientPermissionType"], + **kwargs + ): + super(ClientAccessRight, self).__init__(**kwargs) + self.client = client + self.access_permission = access_permission + + +class Role(ARMBaseModel): + """Compute role. + + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: CloudEdgeManagementRole, IoTRole, KubernetesRole, MECRole. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: The path ID that uniquely identifies the object. + :vartype id: str + :ivar name: The object name. + :vartype name: str + :ivar type: The hierarchical type of the object. + :vartype type: str + :param kind: Required. Role type.Constant filled by server. Possible values include: "IOT", + "ASA", "Functions", "Cognitive", "MEC", "CloudEdgeManagement", "Kubernetes". + :type kind: str or ~azure.mgmt.databoxedge.v2021_02_01_preview.models.RoleTypes + :ivar system_data: Role configured on ASE resource. + :vartype system_data: ~azure.mgmt.databoxedge.v2021_02_01_preview.models.SystemData + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'kind': {'required': True}, + 'system_data': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + } + + _subtype_map = { + 'kind': {'CloudEdgeManagement': 'CloudEdgeManagementRole', 'IOT': 'IoTRole', 'Kubernetes': 'KubernetesRole', 'MEC': 'MECRole'} + } + + def __init__( + self, + **kwargs + ): + super(Role, self).__init__(**kwargs) + self.kind = 'Role' # type: str + self.system_data = None + + +class CloudEdgeManagementRole(Role): + """CloudEdgeManagementRole role. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: The path ID that uniquely identifies the object. + :vartype id: str + :ivar name: The object name. + :vartype name: str + :ivar type: The hierarchical type of the object. + :vartype type: str + :param kind: Required. Role type.Constant filled by server. Possible values include: "IOT", + "ASA", "Functions", "Cognitive", "MEC", "CloudEdgeManagement", "Kubernetes". + :type kind: str or ~azure.mgmt.databoxedge.v2021_02_01_preview.models.RoleTypes + :ivar system_data: Role configured on ASE resource. + :vartype system_data: ~azure.mgmt.databoxedge.v2021_02_01_preview.models.SystemData + :ivar local_management_status: Local Edge Management Status. Possible values include: + "Enabled", "Disabled". + :vartype local_management_status: str or + ~azure.mgmt.databoxedge.v2021_02_01_preview.models.RoleStatus + :ivar edge_profile: Edge Profile of the resource. + :vartype edge_profile: ~azure.mgmt.databoxedge.v2021_02_01_preview.models.EdgeProfile + :param role_status: Role status. Possible values include: "Enabled", "Disabled". + :type role_status: str or ~azure.mgmt.databoxedge.v2021_02_01_preview.models.RoleStatus + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'kind': {'required': True}, + 'system_data': {'readonly': True}, + 'local_management_status': {'readonly': True}, + 'edge_profile': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'local_management_status': {'key': 'properties.localManagementStatus', 'type': 'str'}, + 'edge_profile': {'key': 'properties.edgeProfile', 'type': 'EdgeProfile'}, + 'role_status': {'key': 'properties.roleStatus', 'type': 'str'}, + } + + def __init__( + self, + *, + role_status: Optional[Union[str, "RoleStatus"]] = None, + **kwargs + ): + super(CloudEdgeManagementRole, self).__init__(**kwargs) + self.kind = 'CloudEdgeManagement' # type: str + self.local_management_status = None + self.edge_profile = None + self.role_status = role_status + + +class CloudErrorBody(msrest.serialization.Model): + """An error response from the service. + + :param code: An identifier for the error. Codes are invariant and are intended to be consumed + programmatically. + :type code: str + :param message: A message describing the error, intended to be suitable for display in a user + interface. + :type message: str + :param details: A list of additional details about the error. + :type details: list[~azure.mgmt.databoxedge.v2021_02_01_preview.models.CloudErrorBody] + """ + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + 'details': {'key': 'details', 'type': '[CloudErrorBody]'}, + } + + def __init__( + self, + *, + code: Optional[str] = None, + message: Optional[str] = None, + details: Optional[List["CloudErrorBody"]] = None, + **kwargs + ): + super(CloudErrorBody, self).__init__(**kwargs) + self.code = code + self.message = message + self.details = details + + +class CniConfig(msrest.serialization.Model): + """Cni configuration. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar type: Cni type. + :vartype type: str + :ivar version: Cni version. + :vartype version: str + :ivar pod_subnet: Pod Subnet. + :vartype pod_subnet: str + :ivar service_subnet: Service subnet. + :vartype service_subnet: str + """ + + _validation = { + 'type': {'readonly': True}, + 'version': {'readonly': True}, + 'pod_subnet': {'readonly': True}, + 'service_subnet': {'readonly': True}, + } + + _attribute_map = { + 'type': {'key': 'type', 'type': 'str'}, + 'version': {'key': 'version', 'type': 'str'}, + 'pod_subnet': {'key': 'podSubnet', 'type': 'str'}, + 'service_subnet': {'key': 'serviceSubnet', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(CniConfig, self).__init__(**kwargs) + self.type = None + self.version = None + self.pod_subnet = None + self.service_subnet = None + + +class ComputeResource(msrest.serialization.Model): + """Compute infrastructure Resource. + + All required parameters must be populated in order to send to Azure. + + :param processor_count: Required. Processor count. + :type processor_count: int + :param memory_in_gb: Required. Memory in GB. + :type memory_in_gb: long + """ + + _validation = { + 'processor_count': {'required': True}, + 'memory_in_gb': {'required': True}, + } + + _attribute_map = { + 'processor_count': {'key': 'processorCount', 'type': 'int'}, + 'memory_in_gb': {'key': 'memoryInGB', 'type': 'long'}, + } + + def __init__( + self, + *, + processor_count: int, + memory_in_gb: int, + **kwargs + ): + super(ComputeResource, self).__init__(**kwargs) + self.processor_count = processor_count + self.memory_in_gb = memory_in_gb + + +class ContactDetails(msrest.serialization.Model): + """Contains all the contact details of the customer. + + All required parameters must be populated in order to send to Azure. + + :param contact_person: Required. The contact person name. + :type contact_person: str + :param company_name: Required. The name of the company. + :type company_name: str + :param phone: Required. The phone number. + :type phone: str + :param email_list: Required. The email list. + :type email_list: list[str] + """ + + _validation = { + 'contact_person': {'required': True}, + 'company_name': {'required': True}, + 'phone': {'required': True}, + 'email_list': {'required': True}, + } + + _attribute_map = { + 'contact_person': {'key': 'contactPerson', 'type': 'str'}, + 'company_name': {'key': 'companyName', 'type': 'str'}, + 'phone': {'key': 'phone', 'type': 'str'}, + 'email_list': {'key': 'emailList', 'type': '[str]'}, + } + + def __init__( + self, + *, + contact_person: str, + company_name: str, + phone: str, + email_list: List[str], + **kwargs + ): + super(ContactDetails, self).__init__(**kwargs) + self.contact_person = contact_person + self.company_name = company_name + self.phone = phone + self.email_list = email_list + + +class Container(ARMBaseModel): + """Represents a container on the Data Box Edge/Gateway device. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: The path ID that uniquely identifies the object. + :vartype id: str + :ivar name: The object name. + :vartype name: str + :ivar type: The hierarchical type of the object. + :vartype type: str + :ivar system_data: Container in DataBoxEdge Resource. + :vartype system_data: ~azure.mgmt.databoxedge.v2021_02_01_preview.models.SystemData + :ivar container_status: Current status of the container. Possible values include: "OK", + "Offline", "Unknown", "Updating", "NeedsAttention". + :vartype container_status: str or + ~azure.mgmt.databoxedge.v2021_02_01_preview.models.ContainerStatus + :param data_format: Required. DataFormat for Container. Possible values include: "BlockBlob", + "PageBlob", "AzureFile". + :type data_format: str or + ~azure.mgmt.databoxedge.v2021_02_01_preview.models.AzureContainerDataFormat + :ivar refresh_details: Details of the refresh job on this container. + :vartype refresh_details: ~azure.mgmt.databoxedge.v2021_02_01_preview.models.RefreshDetails + :ivar created_date_time: The UTC time when container got created. + :vartype created_date_time: ~datetime.datetime + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'system_data': {'readonly': True}, + 'container_status': {'readonly': True}, + 'data_format': {'required': True}, + 'refresh_details': {'readonly': True}, + 'created_date_time': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'container_status': {'key': 'properties.containerStatus', 'type': 'str'}, + 'data_format': {'key': 'properties.dataFormat', 'type': 'str'}, + 'refresh_details': {'key': 'properties.refreshDetails', 'type': 'RefreshDetails'}, + 'created_date_time': {'key': 'properties.createdDateTime', 'type': 'iso-8601'}, + } + + def __init__( + self, + *, + data_format: Union[str, "AzureContainerDataFormat"], + **kwargs + ): + super(Container, self).__init__(**kwargs) + self.system_data = None + self.container_status = None + self.data_format = data_format + self.refresh_details = None + self.created_date_time = None + + +class ContainerList(msrest.serialization.Model): + """Collection of all the containers on the Data Box Edge/Gateway device. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar value: The list of containers. + :vartype value: list[~azure.mgmt.databoxedge.v2021_02_01_preview.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: ~azure.mgmt.databoxedge.v2021_02_01_preview.models.Sku + :param etag: The etag for the devices. + :type etag: str + :param identity: Msi identity of the resource. + :type identity: ~azure.mgmt.databoxedge.v2021_02_01_preview.models.ResourceIdentity + :ivar kind: The etag for the devices. Possible values include: "AzureDataBoxGateway", + "AzureStackEdge", "AzureStackHub", "AzureModularDataCentre". + :vartype kind: str or ~azure.mgmt.databoxedge.v2021_02_01_preview.models.DataBoxEdgeDeviceKind + :ivar system_data: DataBoxEdge Resource. + :vartype system_data: ~azure.mgmt.databoxedge.v2021_02_01_preview.models.SystemData + :param data_box_edge_device_status: The status of the Data Box Edge/Gateway device. Possible + values include: "ReadyToSetup", "Online", "Offline", "NeedsAttention", "Disconnected", + "PartiallyDisconnected", "Maintenance". + :type data_box_edge_device_status: str or + ~azure.mgmt.databoxedge.v2021_02_01_preview.models.DataBoxEdgeDeviceStatus + :ivar serial_number: The Serial Number of Data Box Edge/Gateway device. + :vartype serial_number: str + :ivar description: The Description of the Data Box Edge/Gateway device. + :vartype description: str + :ivar model_description: The description of the Data Box Edge/Gateway device model. + :vartype model_description: str + :ivar device_type: The type of the Data Box Edge/Gateway device. Possible values include: + "DataBoxEdgeDevice". + :vartype device_type: str or ~azure.mgmt.databoxedge.v2021_02_01_preview.models.DeviceType + :ivar friendly_name: The Data Box Edge/Gateway device name. + :vartype friendly_name: str + :ivar culture: The Data Box Edge/Gateway device culture. + :vartype culture: str + :ivar device_model: The Data Box Edge/Gateway device model. + :vartype device_model: str + :ivar device_software_version: The Data Box Edge/Gateway device software version. + :vartype device_software_version: str + :ivar device_local_capacity: The Data Box Edge/Gateway device local capacity in MB. + :vartype device_local_capacity: long + :ivar time_zone: The Data Box Edge/Gateway device timezone. + :vartype time_zone: str + :ivar device_hcs_version: The device software version number of the device (eg: 1.2.18105.6). + :vartype device_hcs_version: str + :ivar configured_role_types: Type of compute roles configured. + :vartype configured_role_types: list[str or + ~azure.mgmt.databoxedge.v2021_02_01_preview.models.RoleTypes] + :ivar node_count: The number of nodes in the cluster. + :vartype node_count: int + :ivar resource_move_details: The details of the move operation on this resource. + :vartype resource_move_details: + ~azure.mgmt.databoxedge.v2021_02_01_preview.models.ResourceMoveDetails + :ivar edge_profile: The details of Edge Profile for this resource. + :vartype edge_profile: ~azure.mgmt.databoxedge.v2021_02_01_preview.models.EdgeProfile + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': True}, + 'kind': {'readonly': True}, + 'system_data': {'readonly': True}, + 'serial_number': {'readonly': True}, + 'description': {'readonly': True}, + 'model_description': {'readonly': True}, + 'device_type': {'readonly': True}, + 'friendly_name': {'readonly': True}, + 'culture': {'readonly': True}, + 'device_model': {'readonly': True}, + 'device_software_version': {'readonly': True}, + 'device_local_capacity': {'readonly': True}, + 'time_zone': {'readonly': True}, + 'device_hcs_version': {'readonly': True}, + 'configured_role_types': {'readonly': True}, + 'node_count': {'readonly': True}, + 'resource_move_details': {'readonly': True}, + 'edge_profile': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'sku': {'key': 'sku', 'type': 'Sku'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'identity': {'key': 'identity', 'type': 'ResourceIdentity'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'data_box_edge_device_status': {'key': 'properties.dataBoxEdgeDeviceStatus', 'type': 'str'}, + 'serial_number': {'key': 'properties.serialNumber', 'type': 'str'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + 'model_description': {'key': 'properties.modelDescription', 'type': 'str'}, + 'device_type': {'key': 'properties.deviceType', 'type': 'str'}, + 'friendly_name': {'key': 'properties.friendlyName', 'type': 'str'}, + 'culture': {'key': 'properties.culture', 'type': 'str'}, + 'device_model': {'key': 'properties.deviceModel', 'type': 'str'}, + 'device_software_version': {'key': 'properties.deviceSoftwareVersion', 'type': 'str'}, + 'device_local_capacity': {'key': 'properties.deviceLocalCapacity', 'type': 'long'}, + 'time_zone': {'key': 'properties.timeZone', 'type': 'str'}, + 'device_hcs_version': {'key': 'properties.deviceHcsVersion', 'type': 'str'}, + 'configured_role_types': {'key': 'properties.configuredRoleTypes', 'type': '[str]'}, + 'node_count': {'key': 'properties.nodeCount', 'type': 'int'}, + 'resource_move_details': {'key': 'properties.resourceMoveDetails', 'type': 'ResourceMoveDetails'}, + 'edge_profile': {'key': 'properties.edgeProfile', 'type': 'EdgeProfile'}, + } + + def __init__( + self, + *, + location: str, + tags: Optional[Dict[str, str]] = None, + sku: Optional["Sku"] = None, + etag: Optional[str] = None, + identity: Optional["ResourceIdentity"] = None, + data_box_edge_device_status: Optional[Union[str, "DataBoxEdgeDeviceStatus"]] = None, + **kwargs + ): + super(DataBoxEdgeDevice, self).__init__(**kwargs) + self.location = location + self.tags = tags + self.sku = sku + self.etag = etag + self.identity = identity + self.kind = None + self.system_data = None + self.data_box_edge_device_status = data_box_edge_device_status + self.serial_number = None + self.description = None + self.model_description = None + self.device_type = None + self.friendly_name = None + self.culture = None + self.device_model = None + self.device_software_version = None + self.device_local_capacity = None + self.time_zone = None + self.device_hcs_version = None + self.configured_role_types = None + self.node_count = None + self.resource_move_details = None + self.edge_profile = None + + +class DataBoxEdgeDeviceExtendedInfo(ARMBaseModel): + """The extended Info of the Data Box Edge/Gateway device. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: The path ID that uniquely identifies the object. + :vartype id: str + :ivar name: The object name. + :vartype name: str + :ivar type: The hierarchical type of the object. + :vartype type: str + :param encryption_key_thumbprint: The digital signature of encrypted certificate. + :type encryption_key_thumbprint: str + :param encryption_key: The public part of the encryption certificate. Client uses this to + encrypt any secret. + :type encryption_key: str + :ivar resource_key: The Resource ID of the Resource. + :vartype resource_key: str + :param client_secret_store_id: The Key Vault ARM Id for client secrets. + :type client_secret_store_id: str + :param client_secret_store_url: The url to access the Client Key Vault. + :type client_secret_store_url: str + :param channel_integrity_key_name: The name of Channel Integrity Key stored in the Client Key + Vault. + :type channel_integrity_key_name: str + :param channel_integrity_key_version: The version of Channel Integrity Key stored in the Client + Key Vault. + :type channel_integrity_key_version: str + :param key_vault_sync_status: Key vault sync status. Possible values include: "KeyVaultSynced", + "KeyVaultSyncFailed", "KeyVaultNotConfigured", "KeyVaultSyncPending", "KeyVaultSyncing", + "KeyVaultNotSynced". + :type key_vault_sync_status: str or + ~azure.mgmt.databoxedge.v2021_02_01_preview.models.KeyVaultSyncStatus + :ivar device_secrets: Device secrets, will be returned only with ODataFilter + $expand=deviceSecrets. + :vartype device_secrets: dict[str, ~azure.mgmt.databoxedge.v2021_02_01_preview.models.Secret] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'resource_key': {'readonly': True}, + 'device_secrets': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'encryption_key_thumbprint': {'key': 'properties.encryptionKeyThumbprint', 'type': 'str'}, + 'encryption_key': {'key': 'properties.encryptionKey', 'type': 'str'}, + 'resource_key': {'key': 'properties.resourceKey', 'type': 'str'}, + 'client_secret_store_id': {'key': 'properties.clientSecretStoreId', 'type': 'str'}, + 'client_secret_store_url': {'key': 'properties.clientSecretStoreUrl', 'type': 'str'}, + 'channel_integrity_key_name': {'key': 'properties.channelIntegrityKeyName', 'type': 'str'}, + 'channel_integrity_key_version': {'key': 'properties.channelIntegrityKeyVersion', 'type': 'str'}, + 'key_vault_sync_status': {'key': 'properties.keyVaultSyncStatus', 'type': 'str'}, + 'device_secrets': {'key': 'properties.deviceSecrets', 'type': '{Secret}'}, + } + + def __init__( + self, + *, + encryption_key_thumbprint: Optional[str] = None, + encryption_key: Optional[str] = None, + client_secret_store_id: Optional[str] = None, + client_secret_store_url: Optional[str] = None, + channel_integrity_key_name: Optional[str] = None, + channel_integrity_key_version: Optional[str] = None, + key_vault_sync_status: Optional[Union[str, "KeyVaultSyncStatus"]] = None, + **kwargs + ): + super(DataBoxEdgeDeviceExtendedInfo, self).__init__(**kwargs) + self.encryption_key_thumbprint = encryption_key_thumbprint + self.encryption_key = encryption_key + self.resource_key = None + self.client_secret_store_id = client_secret_store_id + self.client_secret_store_url = client_secret_store_url + self.channel_integrity_key_name = channel_integrity_key_name + self.channel_integrity_key_version = channel_integrity_key_version + self.key_vault_sync_status = key_vault_sync_status + self.device_secrets = None + + +class DataBoxEdgeDeviceExtendedInfoPatch(msrest.serialization.Model): + """The Data Box Edge/Gateway device extended info patch. + + :param client_secret_store_id: The Key Vault ARM Id for client secrets. + :type client_secret_store_id: str + :param client_secret_store_url: The url to access the Client Key Vault. + :type client_secret_store_url: str + :param channel_integrity_key_name: The name for Channel Integrity Key stored in the Client Key + Vault. + :type channel_integrity_key_name: str + :param channel_integrity_key_version: The version of Channel Integrity Key stored in the Client + Key Vault. + :type channel_integrity_key_version: str + :param sync_status: For changing or to initiate the resync to key-vault set the status to + KeyVaultSyncPending, rest of the status will not be applicable. Possible values include: + "KeyVaultSynced", "KeyVaultSyncFailed", "KeyVaultNotConfigured", "KeyVaultSyncPending", + "KeyVaultSyncing", "KeyVaultNotSynced". + :type sync_status: str or ~azure.mgmt.databoxedge.v2021_02_01_preview.models.KeyVaultSyncStatus + """ + + _attribute_map = { + 'client_secret_store_id': {'key': 'clientSecretStoreId', 'type': 'str'}, + 'client_secret_store_url': {'key': 'clientSecretStoreUrl', 'type': 'str'}, + 'channel_integrity_key_name': {'key': 'channelIntegrityKeyName', 'type': 'str'}, + 'channel_integrity_key_version': {'key': 'channelIntegrityKeyVersion', 'type': 'str'}, + 'sync_status': {'key': 'syncStatus', 'type': 'str'}, + } + + def __init__( + self, + *, + client_secret_store_id: Optional[str] = None, + client_secret_store_url: Optional[str] = None, + channel_integrity_key_name: Optional[str] = None, + channel_integrity_key_version: Optional[str] = None, + sync_status: Optional[Union[str, "KeyVaultSyncStatus"]] = None, + **kwargs + ): + super(DataBoxEdgeDeviceExtendedInfoPatch, self).__init__(**kwargs) + self.client_secret_store_id = client_secret_store_id + self.client_secret_store_url = client_secret_store_url + self.channel_integrity_key_name = channel_integrity_key_name + self.channel_integrity_key_version = channel_integrity_key_version + self.sync_status = sync_status + + +class DataBoxEdgeDeviceList(msrest.serialization.Model): + """The collection of Data Box Edge/Gateway devices. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar value: The list of Data Box Edge/Gateway devices. + :vartype value: list[~azure.mgmt.databoxedge.v2021_02_01_preview.models.DataBoxEdgeDevice] + :ivar next_link: Link to the next set of results. + :vartype next_link: str + """ + + _validation = { + 'value': {'readonly': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[DataBoxEdgeDevice]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(DataBoxEdgeDeviceList, self).__init__(**kwargs) + self.value = None + self.next_link = None + + +class DataBoxEdgeDevicePatch(msrest.serialization.Model): + """The Data Box Edge/Gateway device patch. + + :param tags: A set of tags. The tags attached to the Data Box Edge/Gateway resource. + :type tags: dict[str, str] + :param identity: Msi identity of the resource. + :type identity: ~azure.mgmt.databoxedge.v2021_02_01_preview.models.ResourceIdentity + :param edge_profile: Edge Profile property of the Data Box Edge/Gateway device. + :type edge_profile: ~azure.mgmt.databoxedge.v2021_02_01_preview.models.EdgeProfilePatch + """ + + _attribute_map = { + 'tags': {'key': 'tags', 'type': '{str}'}, + 'identity': {'key': 'identity', 'type': 'ResourceIdentity'}, + 'edge_profile': {'key': 'properties.edgeProfile', 'type': 'EdgeProfilePatch'}, + } + + def __init__( + self, + *, + tags: Optional[Dict[str, str]] = None, + identity: Optional["ResourceIdentity"] = None, + edge_profile: Optional["EdgeProfilePatch"] = None, + **kwargs + ): + super(DataBoxEdgeDevicePatch, self).__init__(**kwargs) + self.tags = tags + self.identity = identity + self.edge_profile = edge_profile + + +class DataBoxEdgeMoveRequest(msrest.serialization.Model): + """Resource Move details. + + All required parameters must be populated in order to send to Azure. + + :param target_resource_group: Required. Target resource group ARMId. + :type target_resource_group: str + :param resources: Required. List of resources to be moved. + :type resources: list[str] + """ + + _validation = { + 'target_resource_group': {'required': True}, + 'resources': {'required': True}, + } + + _attribute_map = { + 'target_resource_group': {'key': 'targetResourceGroup', 'type': 'str'}, + 'resources': {'key': 'resources', 'type': '[str]'}, + } + + def __init__( + self, + *, + target_resource_group: str, + resources: List[str], + **kwargs + ): + super(DataBoxEdgeMoveRequest, self).__init__(**kwargs) + self.target_resource_group = target_resource_group + self.resources = resources + + +class DataBoxEdgeSku(msrest.serialization.Model): + """The Sku information. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar resource_type: The type of the resource. + :vartype resource_type: str + :ivar name: The Sku name. Possible values include: "Gateway", "Edge", "TEA_1Node", + "TEA_1Node_UPS", "TEA_1Node_Heater", "TEA_1Node_UPS_Heater", "TEA_4Node_Heater", + "TEA_4Node_UPS_Heater", "TMA", "TDC", "TCA_Small", "GPU", "TCA_Large", "EdgeP_Base", + "EdgeP_High", "EdgePR_Base", "EdgePR_Base_UPS", "EP2_64_1VPU_W", "EP2_128_1T4_Mx1_W", + "EP2_256_2T4_W", "EdgeMR_Mini", "RCA_Small", "RCA_Large", "RDC", "Management". + :vartype name: str or ~azure.mgmt.databoxedge.v2021_02_01_preview.models.SkuName + :ivar kind: The Sku kind. + :vartype kind: str + :ivar tier: The Sku tier. Possible values include: "Standard". + :vartype tier: str or ~azure.mgmt.databoxedge.v2021_02_01_preview.models.SkuTier + :ivar size: The Sku kind. + :vartype size: str + :ivar family: The Sku family. + :vartype family: str + :ivar locations: Availability of the Sku for the region. + :vartype locations: list[str] + :ivar api_versions: The API versions in which Sku is available. + :vartype api_versions: list[str] + :ivar location_info: Availability of the Sku for the location/zone/site. + :vartype location_info: + list[~azure.mgmt.databoxedge.v2021_02_01_preview.models.SkuLocationInfo] + :ivar costs: The pricing info of the Sku. + :vartype costs: list[~azure.mgmt.databoxedge.v2021_02_01_preview.models.SkuCost] + :ivar signup_option: Sku can be signed up by customer or not. Possible values include: "None", + "Available". + :vartype signup_option: str or + ~azure.mgmt.databoxedge.v2021_02_01_preview.models.SkuSignupOption + :ivar version: Availability of the Sku as preview/stable. Possible values include: "Stable", + "Preview". + :vartype version: str or ~azure.mgmt.databoxedge.v2021_02_01_preview.models.SkuVersion + :ivar availability: Links to the next set of results. Possible values include: "Available", + "Unavailable". + :vartype availability: str or + ~azure.mgmt.databoxedge.v2021_02_01_preview.models.SkuAvailability + :ivar shipment_types: List of Shipment Types supported by this SKU. + :vartype shipment_types: list[str or + ~azure.mgmt.databoxedge.v2021_02_01_preview.models.ShipmentType] + """ + + _validation = { + 'resource_type': {'readonly': True}, + 'name': {'readonly': True}, + 'kind': {'readonly': True}, + 'tier': {'readonly': True}, + 'size': {'readonly': True}, + 'family': {'readonly': True}, + 'locations': {'readonly': True}, + 'api_versions': {'readonly': True}, + 'location_info': {'readonly': True}, + 'costs': {'readonly': True}, + 'signup_option': {'readonly': True}, + 'version': {'readonly': True}, + 'availability': {'readonly': True}, + 'shipment_types': {'readonly': True}, + } + + _attribute_map = { + 'resource_type': {'key': 'resourceType', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'tier': {'key': 'tier', 'type': 'str'}, + 'size': {'key': 'size', 'type': 'str'}, + 'family': {'key': 'family', 'type': 'str'}, + 'locations': {'key': 'locations', 'type': '[str]'}, + 'api_versions': {'key': 'apiVersions', 'type': '[str]'}, + 'location_info': {'key': 'locationInfo', 'type': '[SkuLocationInfo]'}, + 'costs': {'key': 'costs', 'type': '[SkuCost]'}, + 'signup_option': {'key': 'signupOption', 'type': 'str'}, + 'version': {'key': 'version', 'type': 'str'}, + 'availability': {'key': 'availability', 'type': 'str'}, + 'shipment_types': {'key': 'shipmentTypes', 'type': '[str]'}, + } + + def __init__( + self, + **kwargs + ): + super(DataBoxEdgeSku, self).__init__(**kwargs) + self.resource_type = None + self.name = None + self.kind = None + self.tier = None + self.size = None + self.family = None + self.locations = None + self.api_versions = None + self.location_info = None + self.costs = None + self.signup_option = None + self.version = None + self.availability = None + self.shipment_types = None + + +class DataBoxEdgeSkuList(msrest.serialization.Model): + """List of SKU Information objects. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar value: List of ResourceType Sku. + :vartype value: list[~azure.mgmt.databoxedge.v2021_02_01_preview.models.DataBoxEdgeSku] + :ivar next_link: Links to the next set of results. + :vartype next_link: str + """ + + _validation = { + 'value': {'readonly': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[DataBoxEdgeSku]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(DataBoxEdgeSkuList, self).__init__(**kwargs) + self.value = None + self.next_link = None + + +class DCAccessCode(msrest.serialization.Model): + """DC Access code in the case of Self Managed Shipping. + + :param auth_code: DCAccess Code for the Self Managed shipment. + :type auth_code: str + """ + + _attribute_map = { + 'auth_code': {'key': 'properties.authCode', 'type': 'str'}, + } + + def __init__( + self, + *, + auth_code: Optional[str] = None, + **kwargs + ): + super(DCAccessCode, self).__init__(**kwargs) + self.auth_code = auth_code + + +class EdgeProfile(msrest.serialization.Model): + """Details about Edge Profile for the resource. + + :param subscription: Edge Profile Subscription. + :type subscription: ~azure.mgmt.databoxedge.v2021_02_01_preview.models.EdgeProfileSubscription + """ + + _attribute_map = { + 'subscription': {'key': 'subscription', 'type': 'EdgeProfileSubscription'}, + } + + def __init__( + self, + *, + subscription: Optional["EdgeProfileSubscription"] = None, + **kwargs + ): + super(EdgeProfile, self).__init__(**kwargs) + self.subscription = subscription + + +class EdgeProfilePatch(msrest.serialization.Model): + """The Data Box Edge/Gateway Edge Profile patch. + + :param subscription: The Data Box Edge/Gateway Edge Profile Subscription patch. + :type subscription: + ~azure.mgmt.databoxedge.v2021_02_01_preview.models.EdgeProfileSubscriptionPatch + """ + + _attribute_map = { + 'subscription': {'key': 'subscription', 'type': 'EdgeProfileSubscriptionPatch'}, + } + + def __init__( + self, + *, + subscription: Optional["EdgeProfileSubscriptionPatch"] = None, + **kwargs + ): + super(EdgeProfilePatch, self).__init__(**kwargs) + self.subscription = subscription + + +class EdgeProfileSubscription(msrest.serialization.Model): + """Subscription details for the Edge Profile. + + :param registration_id: Edge Subscription Registration ID. + :type registration_id: str + :param id: ARM ID of the subscription. + :type id: str + :param state: Possible values include: "Registered", "Warned", "Suspended", "Deleted", + "Unregistered". + :type state: str or ~azure.mgmt.databoxedge.v2021_02_01_preview.models.SubscriptionState + :param registration_date: + :type registration_date: str + :param subscription_id: + :type subscription_id: str + :param tenant_id: + :type tenant_id: str + :param location_placement_id: + :type location_placement_id: str + :param quota_id: + :type quota_id: str + :param serialized_details: + :type serialized_details: str + :param registered_features: + :type registered_features: + list[~azure.mgmt.databoxedge.v2021_02_01_preview.models.SubscriptionRegisteredFeatures] + """ + + _attribute_map = { + 'registration_id': {'key': 'registrationId', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + 'state': {'key': 'state', 'type': 'str'}, + 'registration_date': {'key': 'registrationDate', 'type': 'str'}, + 'subscription_id': {'key': 'subscriptionId', 'type': 'str'}, + 'tenant_id': {'key': 'properties.tenantId', 'type': 'str'}, + 'location_placement_id': {'key': 'properties.locationPlacementId', 'type': 'str'}, + 'quota_id': {'key': 'properties.quotaId', 'type': 'str'}, + 'serialized_details': {'key': 'properties.serializedDetails', 'type': 'str'}, + 'registered_features': {'key': 'properties.registeredFeatures', 'type': '[SubscriptionRegisteredFeatures]'}, + } + + def __init__( + self, + *, + registration_id: Optional[str] = None, + id: Optional[str] = None, + state: Optional[Union[str, "SubscriptionState"]] = None, + registration_date: Optional[str] = None, + subscription_id: Optional[str] = None, + tenant_id: Optional[str] = None, + location_placement_id: Optional[str] = None, + quota_id: Optional[str] = None, + serialized_details: Optional[str] = None, + registered_features: Optional[List["SubscriptionRegisteredFeatures"]] = None, + **kwargs + ): + super(EdgeProfileSubscription, self).__init__(**kwargs) + self.registration_id = registration_id + self.id = id + self.state = state + self.registration_date = registration_date + self.subscription_id = subscription_id + self.tenant_id = tenant_id + self.location_placement_id = location_placement_id + self.quota_id = quota_id + self.serialized_details = serialized_details + self.registered_features = registered_features + + +class EdgeProfileSubscriptionPatch(msrest.serialization.Model): + """The Data Box Edge/Gateway Edge Profile Subscription patch. + + :param id: The path ID that uniquely identifies the subscription of the edge profile. + :type id: str + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + } + + def __init__( + self, + *, + id: Optional[str] = None, + **kwargs + ): + super(EdgeProfileSubscriptionPatch, self).__init__(**kwargs) + self.id = id + + +class EtcdInfo(msrest.serialization.Model): + """Etcd configuration. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar type: Etcd type. + :vartype type: str + :ivar version: Etcd version. + :vartype version: str + """ + + _validation = { + 'type': {'readonly': True}, + 'version': {'readonly': True}, + } + + _attribute_map = { + 'type': {'key': 'type', 'type': 'str'}, + 'version': {'key': 'version', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(EtcdInfo, self).__init__(**kwargs) + self.type = None + self.version = None + + +class Trigger(ARMBaseModel): + """Trigger details. + + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: FileEventTrigger, PeriodicTimerEventTrigger. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: The path ID that uniquely identifies the object. + :vartype id: str + :ivar name: The object name. + :vartype name: str + :ivar type: The hierarchical type of the object. + :vartype type: str + :ivar system_data: Trigger in DataBoxEdge Resource. + :vartype system_data: ~azure.mgmt.databoxedge.v2021_02_01_preview.models.SystemData + :param kind: Required. Trigger Kind.Constant filled by server. Possible values include: + "FileEvent", "PeriodicTimerEvent". + :type kind: str or ~azure.mgmt.databoxedge.v2021_02_01_preview.models.TriggerEventType + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'system_data': {'readonly': True}, + 'kind': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'kind': {'key': 'kind', 'type': 'str'}, + } + + _subtype_map = { + 'kind': {'FileEvent': 'FileEventTrigger', 'PeriodicTimerEvent': 'PeriodicTimerEventTrigger'} + } + + def __init__( + self, + **kwargs + ): + super(Trigger, self).__init__(**kwargs) + self.system_data = None + self.kind = 'Trigger' # type: str + + +class FileEventTrigger(Trigger): + """Trigger details. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: The path ID that uniquely identifies the object. + :vartype id: str + :ivar name: The object name. + :vartype name: str + :ivar type: The hierarchical type of the object. + :vartype type: str + :ivar system_data: Trigger in DataBoxEdge Resource. + :vartype system_data: ~azure.mgmt.databoxedge.v2021_02_01_preview.models.SystemData + :param kind: Required. Trigger Kind.Constant filled by server. Possible values include: + "FileEvent", "PeriodicTimerEvent". + :type kind: str or ~azure.mgmt.databoxedge.v2021_02_01_preview.models.TriggerEventType + :param source_info: Required. File event source details. + :type source_info: ~azure.mgmt.databoxedge.v2021_02_01_preview.models.FileSourceInfo + :param sink_info: Required. Role sink info. + :type sink_info: ~azure.mgmt.databoxedge.v2021_02_01_preview.models.RoleSinkInfo + :param custom_context_tag: A custom context tag typically used to correlate the trigger against + its usage. For example, if a periodic timer trigger is intended for certain specific IoT + modules in the device, the tag can be the name or the image URL of the module. + :type custom_context_tag: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'system_data': {'readonly': True}, + 'kind': {'required': True}, + 'source_info': {'required': True}, + 'sink_info': {'required': True}, + 'custom_context_tag': {'max_length': 192, 'min_length': 0}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'source_info': {'key': 'properties.sourceInfo', 'type': 'FileSourceInfo'}, + 'sink_info': {'key': 'properties.sinkInfo', 'type': 'RoleSinkInfo'}, + 'custom_context_tag': {'key': 'properties.customContextTag', 'type': 'str'}, + } + + def __init__( + self, + *, + source_info: "FileSourceInfo", + sink_info: "RoleSinkInfo", + custom_context_tag: Optional[str] = None, + **kwargs + ): + super(FileEventTrigger, self).__init__(**kwargs) + self.kind = 'FileEvent' # type: str + self.source_info = source_info + self.sink_info = sink_info + self.custom_context_tag = custom_context_tag + + +class FileSourceInfo(msrest.serialization.Model): + """File source details. + + All required parameters must be populated in order to send to Azure. + + :param share_id: Required. File share ID. + :type share_id: str + """ + + _validation = { + 'share_id': {'required': True}, + } + + _attribute_map = { + 'share_id': {'key': 'shareId', 'type': 'str'}, + } + + def __init__( + self, + *, + share_id: str, + **kwargs + ): + super(FileSourceInfo, self).__init__(**kwargs) + self.share_id = share_id + + +class GenerateCertResponse(msrest.serialization.Model): + """Used in activation key generation flow. + + :param public_key: Gets or sets base64 encoded certificate raw data, + this is the public part needed to be uploaded to cert vault. + :type public_key: str + :param private_key: Gets or sets base64 encoded private part of the certificate, + needed to form the activation key. + :type private_key: str + :param expiry_time_in_utc: Gets or sets expiry time in UTC. + :type expiry_time_in_utc: str + """ + + _attribute_map = { + 'public_key': {'key': 'publicKey', 'type': 'str'}, + 'private_key': {'key': 'privateKey', 'type': 'str'}, + 'expiry_time_in_utc': {'key': 'expiryTimeInUTC', 'type': 'str'}, + } + + def __init__( + self, + *, + public_key: Optional[str] = None, + private_key: Optional[str] = None, + expiry_time_in_utc: Optional[str] = None, + **kwargs + ): + super(GenerateCertResponse, self).__init__(**kwargs) + self.public_key = public_key + self.private_key = private_key + self.expiry_time_in_utc = expiry_time_in_utc + + +class ImageRepositoryCredential(msrest.serialization.Model): + """Image repository credential. + + All required parameters must be populated in order to send to Azure. + + :param image_repository_url: Required. Image repository url (e.g.: mcr.microsoft.com). + :type image_repository_url: str + :param user_name: Required. Repository user name. + :type user_name: str + :param password: Repository user password. + :type password: ~azure.mgmt.databoxedge.v2021_02_01_preview.models.AsymmetricEncryptedSecret + """ + + _validation = { + 'image_repository_url': {'required': True}, + 'user_name': {'required': True}, + } + + _attribute_map = { + 'image_repository_url': {'key': 'imageRepositoryUrl', 'type': 'str'}, + 'user_name': {'key': 'userName', 'type': 'str'}, + 'password': {'key': 'password', 'type': 'AsymmetricEncryptedSecret'}, + } + + def __init__( + self, + *, + image_repository_url: str, + user_name: str, + password: Optional["AsymmetricEncryptedSecret"] = None, + **kwargs + ): + super(ImageRepositoryCredential, self).__init__(**kwargs) + self.image_repository_url = image_repository_url + self.user_name = user_name + self.password = password + + +class IoTAddon(Addon): + """IoT Addon. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: The path ID that uniquely identifies the object. + :vartype id: str + :ivar name: The object name. + :vartype name: str + :ivar type: The hierarchical type of the object. + :vartype type: str + :param kind: Required. Addon type.Constant filled by server. Possible values include: + "IotEdge", "ArcForKubernetes". + :type kind: str or ~azure.mgmt.databoxedge.v2021_02_01_preview.models.AddonType + :ivar system_data: Addon type. + :vartype system_data: ~azure.mgmt.databoxedge.v2021_02_01_preview.models.SystemData + :param io_t_device_details: Required. IoT device metadata to which appliance needs to be + connected. + :type io_t_device_details: ~azure.mgmt.databoxedge.v2021_02_01_preview.models.IoTDeviceInfo + :param io_t_edge_device_details: Required. IoT edge device to which the IoT Addon needs to be + configured. + :type io_t_edge_device_details: + ~azure.mgmt.databoxedge.v2021_02_01_preview.models.IoTDeviceInfo + :ivar version: Version of IoT running on the appliance. + :vartype version: str + :ivar host_platform: Host OS supported by the IoT addon. Possible values include: "Windows", + "Linux". + :vartype host_platform: str or ~azure.mgmt.databoxedge.v2021_02_01_preview.models.PlatformType + :ivar host_platform_type: Platform where the runtime is hosted. Possible values include: + "KubernetesCluster", "LinuxVM". + :vartype host_platform_type: str or + ~azure.mgmt.databoxedge.v2021_02_01_preview.models.HostPlatformType + :ivar provisioning_state: Addon Provisioning State. Possible values include: "Invalid", + "Creating", "Created", "Updating", "Reconfiguring", "Failed", "Deleting". + :vartype provisioning_state: str or + ~azure.mgmt.databoxedge.v2021_02_01_preview.models.AddonState + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'kind': {'required': True}, + 'system_data': {'readonly': True}, + 'io_t_device_details': {'required': True}, + 'io_t_edge_device_details': {'required': True}, + 'version': {'readonly': True}, + 'host_platform': {'readonly': True}, + 'host_platform_type': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'io_t_device_details': {'key': 'properties.ioTDeviceDetails', 'type': 'IoTDeviceInfo'}, + 'io_t_edge_device_details': {'key': 'properties.ioTEdgeDeviceDetails', 'type': 'IoTDeviceInfo'}, + 'version': {'key': 'properties.version', 'type': 'str'}, + 'host_platform': {'key': 'properties.hostPlatform', 'type': 'str'}, + 'host_platform_type': {'key': 'properties.hostPlatformType', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + } + + def __init__( + self, + *, + io_t_device_details: "IoTDeviceInfo", + io_t_edge_device_details: "IoTDeviceInfo", + **kwargs + ): + super(IoTAddon, self).__init__(**kwargs) + self.kind = 'IotEdge' # type: str + self.io_t_device_details = io_t_device_details + self.io_t_edge_device_details = io_t_edge_device_details + self.version = None + self.host_platform = None + self.host_platform_type = None + self.provisioning_state = None + + +class IoTDeviceInfo(msrest.serialization.Model): + """Metadata of IoT device/IoT Edge device to be configured. + + All required parameters must be populated in order to send to Azure. + + :param device_id: Required. ID of the IoT device/edge device. + :type device_id: str + :param io_t_host_hub: Required. Host name for the IoT hub associated to the device. + :type io_t_host_hub: str + :param io_t_host_hub_id: Id for the IoT hub associated to the device. + :type io_t_host_hub_id: str + :param authentication: Encrypted IoT device/IoT edge device connection string. + :type authentication: ~azure.mgmt.databoxedge.v2021_02_01_preview.models.Authentication + """ + + _validation = { + 'device_id': {'required': True}, + 'io_t_host_hub': {'required': True}, + } + + _attribute_map = { + 'device_id': {'key': 'deviceId', 'type': 'str'}, + 'io_t_host_hub': {'key': 'ioTHostHub', 'type': 'str'}, + 'io_t_host_hub_id': {'key': 'ioTHostHubId', 'type': 'str'}, + 'authentication': {'key': 'authentication', 'type': 'Authentication'}, + } + + def __init__( + self, + *, + device_id: str, + io_t_host_hub: str, + io_t_host_hub_id: Optional[str] = None, + authentication: Optional["Authentication"] = None, + **kwargs + ): + super(IoTDeviceInfo, self).__init__(**kwargs) + self.device_id = device_id + self.io_t_host_hub = io_t_host_hub + self.io_t_host_hub_id = io_t_host_hub_id + self.authentication = authentication + + +class IoTEdgeAgentInfo(msrest.serialization.Model): + """IoT edge agent details is optional, this will be used for download system Agent module while bootstrapping IoT Role if specified. + + All required parameters must be populated in order to send to Azure. + + :param image_name: Required. Name of the IoT edge agent image. + :type image_name: str + :param tag: Required. Image Tag. + :type tag: str + :param image_repository: Image repository details. + :type image_repository: + ~azure.mgmt.databoxedge.v2021_02_01_preview.models.ImageRepositoryCredential + """ + + _validation = { + 'image_name': {'required': True}, + 'tag': {'required': True}, + } + + _attribute_map = { + 'image_name': {'key': 'imageName', 'type': 'str'}, + 'tag': {'key': 'tag', 'type': 'str'}, + 'image_repository': {'key': 'imageRepository', 'type': 'ImageRepositoryCredential'}, + } + + def __init__( + self, + *, + image_name: str, + tag: str, + image_repository: Optional["ImageRepositoryCredential"] = None, + **kwargs + ): + super(IoTEdgeAgentInfo, self).__init__(**kwargs) + self.image_name = image_name + self.tag = tag + self.image_repository = image_repository + + +class IoTRole(Role): + """Compute role. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: The path ID that uniquely identifies the object. + :vartype id: str + :ivar name: The object name. + :vartype name: str + :ivar type: The hierarchical type of the object. + :vartype type: str + :param kind: Required. Role type.Constant filled by server. Possible values include: "IOT", + "ASA", "Functions", "Cognitive", "MEC", "CloudEdgeManagement", "Kubernetes". + :type kind: str or ~azure.mgmt.databoxedge.v2021_02_01_preview.models.RoleTypes + :ivar system_data: Role configured on ASE resource. + :vartype system_data: ~azure.mgmt.databoxedge.v2021_02_01_preview.models.SystemData + :param host_platform: Host OS supported by the IoT role. Possible values include: "Windows", + "Linux". + :type host_platform: str or ~azure.mgmt.databoxedge.v2021_02_01_preview.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: ~azure.mgmt.databoxedge.v2021_02_01_preview.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: + ~azure.mgmt.databoxedge.v2021_02_01_preview.models.IoTDeviceInfo + :param share_mappings: Mount points of shares in role(s). + :type share_mappings: list[~azure.mgmt.databoxedge.v2021_02_01_preview.models.MountPointMap] + :param io_t_edge_agent_info: Iot edge agent details to download the agent and bootstrap iot + runtime. + :type io_t_edge_agent_info: ~azure.mgmt.databoxedge.v2021_02_01_preview.models.IoTEdgeAgentInfo + :ivar host_platform_type: Platform where the Iot runtime is hosted. Possible values include: + "KubernetesCluster", "LinuxVM". + :vartype host_platform_type: str or + ~azure.mgmt.databoxedge.v2021_02_01_preview.models.HostPlatformType + :param compute_resource: Resource allocation. + :type compute_resource: ~azure.mgmt.databoxedge.v2021_02_01_preview.models.ComputeResource + :param role_status: Role status. Possible values include: "Enabled", "Disabled". + :type role_status: str or ~azure.mgmt.databoxedge.v2021_02_01_preview.models.RoleStatus + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'kind': {'required': True}, + 'system_data': {'readonly': True}, + 'host_platform_type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'host_platform': {'key': 'properties.hostPlatform', 'type': 'str'}, + 'io_t_device_details': {'key': 'properties.ioTDeviceDetails', 'type': 'IoTDeviceInfo'}, + 'io_t_edge_device_details': {'key': 'properties.ioTEdgeDeviceDetails', 'type': 'IoTDeviceInfo'}, + 'share_mappings': {'key': 'properties.shareMappings', 'type': '[MountPointMap]'}, + 'io_t_edge_agent_info': {'key': 'properties.ioTEdgeAgentInfo', 'type': 'IoTEdgeAgentInfo'}, + 'host_platform_type': {'key': 'properties.hostPlatformType', 'type': 'str'}, + 'compute_resource': {'key': 'properties.computeResource', 'type': 'ComputeResource'}, + 'role_status': {'key': 'properties.roleStatus', 'type': 'str'}, + } + + def __init__( + self, + *, + host_platform: Optional[Union[str, "PlatformType"]] = None, + io_t_device_details: Optional["IoTDeviceInfo"] = None, + io_t_edge_device_details: Optional["IoTDeviceInfo"] = None, + share_mappings: Optional[List["MountPointMap"]] = None, + io_t_edge_agent_info: Optional["IoTEdgeAgentInfo"] = None, + compute_resource: Optional["ComputeResource"] = None, + role_status: Optional[Union[str, "RoleStatus"]] = None, + **kwargs + ): + super(IoTRole, self).__init__(**kwargs) + self.kind = 'IOT' # type: str + self.host_platform = host_platform + self.io_t_device_details = io_t_device_details + self.io_t_edge_device_details = io_t_edge_device_details + self.share_mappings = share_mappings + self.io_t_edge_agent_info = io_t_edge_agent_info + self.host_platform_type = None + self.compute_resource = compute_resource + self.role_status = role_status + + +class Ipv4Config(msrest.serialization.Model): + """Details related to the IPv4 address configuration. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar ip_address: The IPv4 address of the network adapter. + :vartype ip_address: str + :ivar subnet: The IPv4 subnet of the network adapter. + :vartype subnet: str + :ivar gateway: The IPv4 gateway of the network adapter. + :vartype gateway: str + """ + + _validation = { + 'ip_address': {'readonly': True}, + 'subnet': {'readonly': True}, + 'gateway': {'readonly': True}, + } + + _attribute_map = { + 'ip_address': {'key': 'ipAddress', 'type': 'str'}, + 'subnet': {'key': 'subnet', 'type': 'str'}, + 'gateway': {'key': 'gateway', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(Ipv4Config, self).__init__(**kwargs) + self.ip_address = None + self.subnet = None + self.gateway = None + + +class Ipv6Config(msrest.serialization.Model): + """Details related to the IPv6 address configuration. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar ip_address: The IPv6 address of the network adapter. + :vartype ip_address: str + :ivar prefix_length: The IPv6 prefix of the network adapter. + :vartype prefix_length: int + :ivar gateway: The IPv6 gateway of the network adapter. + :vartype gateway: str + """ + + _validation = { + 'ip_address': {'readonly': True}, + 'prefix_length': {'readonly': True}, + 'gateway': {'readonly': True}, + } + + _attribute_map = { + 'ip_address': {'key': 'ipAddress', 'type': 'str'}, + 'prefix_length': {'key': 'prefixLength', 'type': 'int'}, + 'gateway': {'key': 'gateway', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(Ipv6Config, self).__init__(**kwargs) + self.ip_address = None + self.prefix_length = None + self.gateway = None + + +class Job(msrest.serialization.Model): + """A device job. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: The path ID that uniquely identifies the object. + :vartype id: str + :ivar name: The name of the object. + :vartype name: str + :ivar type: The hierarchical type of the object. + :vartype type: str + :ivar status: The current status of the job. Possible values include: "Invalid", "Running", + "Succeeded", "Failed", "Canceled", "Paused", "Scheduled". + :vartype status: str or ~azure.mgmt.databoxedge.v2021_02_01_preview.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: ~azure.mgmt.databoxedge.v2021_02_01_preview.models.JobErrorDetails + :ivar job_type: The type of the job. Possible values include: "Invalid", "ScanForUpdates", + "DownloadUpdates", "InstallUpdates", "RefreshShare", "RefreshContainer", "Backup", "Restore", + "TriggerSupportPackage". + :vartype job_type: str or ~azure.mgmt.databoxedge.v2021_02_01_preview.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 + ~azure.mgmt.databoxedge.v2021_02_01_preview.models.UpdateOperationStage + :ivar download_progress: The download progress. + :vartype download_progress: + ~azure.mgmt.databoxedge.v2021_02_01_preview.models.UpdateDownloadProgress + :ivar install_progress: The install progress. + :vartype install_progress: + ~azure.mgmt.databoxedge.v2021_02_01_preview.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[~azure.mgmt.databoxedge.v2021_02_01_preview.models.JobErrorItem] + :ivar code: The code intended for programmatic access. + :vartype code: str + :ivar message: The message that describes the error in detail. + :vartype message: str + """ + + _validation = { + 'error_details': {'readonly': True}, + 'code': {'readonly': True}, + 'message': {'readonly': True}, + } + + _attribute_map = { + 'error_details': {'key': 'errorDetails', 'type': '[JobErrorItem]'}, + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(JobErrorDetails, self).__init__(**kwargs) + self.error_details = None + self.code = None + self.message = None + + +class JobErrorItem(msrest.serialization.Model): + """The job error items. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar recommendations: The recommended actions. + :vartype recommendations: list[str] + :ivar code: The code intended for programmatic access. + :vartype code: str + :ivar message: The message that describes the error in detail. + :vartype message: str + """ + + _validation = { + 'recommendations': {'readonly': True}, + 'code': {'readonly': True}, + 'message': {'readonly': True}, + } + + _attribute_map = { + 'recommendations': {'key': 'recommendations', 'type': '[str]'}, + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(JobErrorItem, self).__init__(**kwargs) + self.recommendations = None + self.code = None + self.message = None + + +class KubernetesClusterInfo(msrest.serialization.Model): + """Kubernetes cluster configuration. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar etcd_info: Etcd configuration. + :vartype etcd_info: ~azure.mgmt.databoxedge.v2021_02_01_preview.models.EtcdInfo + :ivar nodes: Kubernetes cluster nodes. + :vartype nodes: list[~azure.mgmt.databoxedge.v2021_02_01_preview.models.NodeInfo] + :param version: Required. Kubernetes cluster version. + :type version: str + """ + + _validation = { + 'etcd_info': {'readonly': True}, + 'nodes': {'readonly': True}, + 'version': {'required': True}, + } + + _attribute_map = { + 'etcd_info': {'key': 'etcdInfo', 'type': 'EtcdInfo'}, + 'nodes': {'key': 'nodes', 'type': '[NodeInfo]'}, + 'version': {'key': 'version', 'type': 'str'}, + } + + def __init__( + self, + *, + version: str, + **kwargs + ): + super(KubernetesClusterInfo, self).__init__(**kwargs) + self.etcd_info = None + self.nodes = None + self.version = version + + +class KubernetesIPConfiguration(msrest.serialization.Model): + """Kubernetes node IP configuration. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar port: Port of the Kubernetes node. + :vartype port: str + :param ip_address: IP address of the Kubernetes node. + :type ip_address: str + """ + + _validation = { + 'port': {'readonly': True}, + } + + _attribute_map = { + 'port': {'key': 'port', 'type': 'str'}, + 'ip_address': {'key': 'ipAddress', 'type': 'str'}, + } + + def __init__( + self, + *, + ip_address: Optional[str] = None, + **kwargs + ): + super(KubernetesIPConfiguration, self).__init__(**kwargs) + self.port = None + self.ip_address = ip_address + + +class KubernetesRole(Role): + """Kubernetes role. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: The path ID that uniquely identifies the object. + :vartype id: str + :ivar name: The object name. + :vartype name: str + :ivar type: The hierarchical type of the object. + :vartype type: str + :param kind: Required. Role type.Constant filled by server. Possible values include: "IOT", + "ASA", "Functions", "Cognitive", "MEC", "CloudEdgeManagement", "Kubernetes". + :type kind: str or ~azure.mgmt.databoxedge.v2021_02_01_preview.models.RoleTypes + :ivar system_data: Role configured on ASE resource. + :vartype system_data: ~azure.mgmt.databoxedge.v2021_02_01_preview.models.SystemData + :param host_platform: Host OS supported by the Kubernetes role. Possible values include: + "Windows", "Linux". + :type host_platform: str or ~azure.mgmt.databoxedge.v2021_02_01_preview.models.PlatformType + :ivar provisioning_state: State of Kubernetes deployment. Possible values include: "Invalid", + "Creating", "Created", "Updating", "Reconfiguring", "Failed", "Deleting". + :vartype provisioning_state: str or + ~azure.mgmt.databoxedge.v2021_02_01_preview.models.KubernetesState + :ivar host_platform_type: Platform where the runtime is hosted. Possible values include: + "KubernetesCluster", "LinuxVM". + :vartype host_platform_type: str or + ~azure.mgmt.databoxedge.v2021_02_01_preview.models.HostPlatformType + :param kubernetes_cluster_info: Kubernetes cluster configuration. + :type kubernetes_cluster_info: + ~azure.mgmt.databoxedge.v2021_02_01_preview.models.KubernetesClusterInfo + :param kubernetes_role_resources: Kubernetes role resources. + :type kubernetes_role_resources: + ~azure.mgmt.databoxedge.v2021_02_01_preview.models.KubernetesRoleResources + :param role_status: Role status. Possible values include: "Enabled", "Disabled". + :type role_status: str or ~azure.mgmt.databoxedge.v2021_02_01_preview.models.RoleStatus + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'kind': {'required': True}, + 'system_data': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + 'host_platform_type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'host_platform': {'key': 'properties.hostPlatform', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'host_platform_type': {'key': 'properties.hostPlatformType', 'type': 'str'}, + 'kubernetes_cluster_info': {'key': 'properties.kubernetesClusterInfo', 'type': 'KubernetesClusterInfo'}, + 'kubernetes_role_resources': {'key': 'properties.kubernetesRoleResources', 'type': 'KubernetesRoleResources'}, + 'role_status': {'key': 'properties.roleStatus', 'type': 'str'}, + } + + def __init__( + self, + *, + host_platform: Optional[Union[str, "PlatformType"]] = None, + kubernetes_cluster_info: Optional["KubernetesClusterInfo"] = None, + kubernetes_role_resources: Optional["KubernetesRoleResources"] = None, + role_status: Optional[Union[str, "RoleStatus"]] = None, + **kwargs + ): + super(KubernetesRole, self).__init__(**kwargs) + self.kind = 'Kubernetes' # type: str + self.host_platform = host_platform + self.provisioning_state = None + self.host_platform_type = None + self.kubernetes_cluster_info = kubernetes_cluster_info + self.kubernetes_role_resources = kubernetes_role_resources + self.role_status = role_status + + +class KubernetesRoleCompute(msrest.serialization.Model): + """Kubernetes role compute resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :param vm_profile: Required. VM profile. + :type vm_profile: str + :ivar memory_in_bytes: Memory in bytes. + :vartype memory_in_bytes: long + :ivar processor_count: Processor count. + :vartype processor_count: int + """ + + _validation = { + 'vm_profile': {'required': True}, + 'memory_in_bytes': {'readonly': True}, + 'processor_count': {'readonly': True}, + } + + _attribute_map = { + 'vm_profile': {'key': 'vmProfile', 'type': 'str'}, + 'memory_in_bytes': {'key': 'memoryInBytes', 'type': 'long'}, + 'processor_count': {'key': 'processorCount', 'type': 'int'}, + } + + def __init__( + self, + *, + vm_profile: str, + **kwargs + ): + super(KubernetesRoleCompute, self).__init__(**kwargs) + self.vm_profile = vm_profile + self.memory_in_bytes = None + self.processor_count = None + + +class KubernetesRoleNetwork(msrest.serialization.Model): + """Kubernetes role network resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar cni_config: Cni configuration. + :vartype cni_config: ~azure.mgmt.databoxedge.v2021_02_01_preview.models.CniConfig + :ivar load_balancer_config: Load balancer configuration. + :vartype load_balancer_config: + ~azure.mgmt.databoxedge.v2021_02_01_preview.models.LoadBalancerConfig + """ + + _validation = { + 'cni_config': {'readonly': True}, + 'load_balancer_config': {'readonly': True}, + } + + _attribute_map = { + 'cni_config': {'key': 'cniConfig', 'type': 'CniConfig'}, + 'load_balancer_config': {'key': 'loadBalancerConfig', 'type': 'LoadBalancerConfig'}, + } + + def __init__( + self, + **kwargs + ): + super(KubernetesRoleNetwork, self).__init__(**kwargs) + self.cni_config = None + self.load_balancer_config = None + + +class KubernetesRoleResources(msrest.serialization.Model): + """Kubernetes role resources. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :param storage: Kubernetes role storage resource. + :type storage: ~azure.mgmt.databoxedge.v2021_02_01_preview.models.KubernetesRoleStorage + :param compute: Required. Kubernetes role compute resource. + :type compute: ~azure.mgmt.databoxedge.v2021_02_01_preview.models.KubernetesRoleCompute + :ivar network: Kubernetes role network resource. + :vartype network: ~azure.mgmt.databoxedge.v2021_02_01_preview.models.KubernetesRoleNetwork + """ + + _validation = { + 'compute': {'required': True}, + 'network': {'readonly': True}, + } + + _attribute_map = { + 'storage': {'key': 'storage', 'type': 'KubernetesRoleStorage'}, + 'compute': {'key': 'compute', 'type': 'KubernetesRoleCompute'}, + 'network': {'key': 'network', 'type': 'KubernetesRoleNetwork'}, + } + + def __init__( + self, + *, + compute: "KubernetesRoleCompute", + storage: Optional["KubernetesRoleStorage"] = None, + **kwargs + ): + super(KubernetesRoleResources, self).__init__(**kwargs) + self.storage = storage + self.compute = compute + self.network = None + + +class KubernetesRoleStorage(msrest.serialization.Model): + """Kubernetes role storage resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar storage_classes: Kubernetes storage class info. + :vartype storage_classes: + list[~azure.mgmt.databoxedge.v2021_02_01_preview.models.KubernetesRoleStorageClassInfo] + :param endpoints: Mount points of shares in role(s). + :type endpoints: list[~azure.mgmt.databoxedge.v2021_02_01_preview.models.MountPointMap] + """ + + _validation = { + 'storage_classes': {'readonly': True}, + } + + _attribute_map = { + 'storage_classes': {'key': 'storageClasses', 'type': '[KubernetesRoleStorageClassInfo]'}, + 'endpoints': {'key': 'endpoints', 'type': '[MountPointMap]'}, + } + + def __init__( + self, + *, + endpoints: Optional[List["MountPointMap"]] = None, + **kwargs + ): + super(KubernetesRoleStorage, self).__init__(**kwargs) + self.storage_classes = None + self.endpoints = endpoints + + +class KubernetesRoleStorageClassInfo(msrest.serialization.Model): + """Kubernetes storage class info. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar name: Storage class name. + :vartype name: str + :ivar type: Storage class type. + :vartype type: str + :ivar posix_compliant: If provisioned storage is posix compliant. Possible values include: + "Invalid", "Enabled", "Disabled". + :vartype posix_compliant: str or + ~azure.mgmt.databoxedge.v2021_02_01_preview.models.PosixComplianceStatus + """ + + _validation = { + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'posix_compliant': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'posix_compliant': {'key': 'posixCompliant', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(KubernetesRoleStorageClassInfo, self).__init__(**kwargs) + self.name = None + self.type = None + self.posix_compliant = None + + +class LoadBalancerConfig(msrest.serialization.Model): + """Load balancer configuration. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar type: Load balancer type. + :vartype type: str + :ivar version: Load balancer version. + :vartype version: str + """ + + _validation = { + 'type': {'readonly': True}, + 'version': {'readonly': True}, + } + + _attribute_map = { + 'type': {'key': 'type', 'type': 'str'}, + 'version': {'key': 'version', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(LoadBalancerConfig, self).__init__(**kwargs) + self.type = None + self.version = None + + +class MECRole(Role): + """MEC role. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: The path ID that uniquely identifies the object. + :vartype id: str + :ivar name: The object name. + :vartype name: str + :ivar type: The hierarchical type of the object. + :vartype type: str + :param kind: Required. Role type.Constant filled by server. Possible values include: "IOT", + "ASA", "Functions", "Cognitive", "MEC", "CloudEdgeManagement", "Kubernetes". + :type kind: str or ~azure.mgmt.databoxedge.v2021_02_01_preview.models.RoleTypes + :ivar system_data: Role configured on ASE resource. + :vartype system_data: ~azure.mgmt.databoxedge.v2021_02_01_preview.models.SystemData + :param connection_string: Activation key of the MEC. + :type connection_string: + ~azure.mgmt.databoxedge.v2021_02_01_preview.models.AsymmetricEncryptedSecret + :param controller_endpoint: Controller Endpoint. + :type controller_endpoint: str + :param resource_unique_id: Unique Id of the Resource. + :type resource_unique_id: str + :param role_status: Role status. Possible values include: "Enabled", "Disabled". + :type role_status: str or ~azure.mgmt.databoxedge.v2021_02_01_preview.models.RoleStatus + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'kind': {'required': True}, + 'system_data': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'connection_string': {'key': 'properties.connectionString', 'type': 'AsymmetricEncryptedSecret'}, + 'controller_endpoint': {'key': 'properties.controllerEndpoint', 'type': 'str'}, + 'resource_unique_id': {'key': 'properties.resourceUniqueId', 'type': 'str'}, + 'role_status': {'key': 'properties.roleStatus', 'type': 'str'}, + } + + def __init__( + self, + *, + connection_string: Optional["AsymmetricEncryptedSecret"] = None, + controller_endpoint: Optional[str] = None, + resource_unique_id: Optional[str] = None, + role_status: Optional[Union[str, "RoleStatus"]] = None, + **kwargs + ): + super(MECRole, self).__init__(**kwargs) + self.kind = 'MEC' # type: str + self.connection_string = connection_string + self.controller_endpoint = controller_endpoint + self.resource_unique_id = resource_unique_id + self.role_status = role_status + + +class MetricConfiguration(msrest.serialization.Model): + """Metric configuration. + + All required parameters must be populated in order to send to Azure. + + :param resource_id: Required. The Resource ID on which the metrics should be pushed. + :type resource_id: str + :param mdm_account: The MDM account to which the counters should be pushed. + :type mdm_account: str + :param metric_name_space: The MDM namespace to which the counters should be pushed. This is + required if MDMAccount is specified. + :type metric_name_space: str + :param counter_sets: Required. Host name for the IoT hub associated to the device. + :type counter_sets: list[~azure.mgmt.databoxedge.v2021_02_01_preview.models.MetricCounterSet] + """ + + _validation = { + 'resource_id': {'required': True}, + 'counter_sets': {'required': True}, + } + + _attribute_map = { + 'resource_id': {'key': 'resourceId', 'type': 'str'}, + 'mdm_account': {'key': 'mdmAccount', 'type': 'str'}, + 'metric_name_space': {'key': 'metricNameSpace', 'type': 'str'}, + 'counter_sets': {'key': 'counterSets', 'type': '[MetricCounterSet]'}, + } + + def __init__( + self, + *, + resource_id: str, + counter_sets: List["MetricCounterSet"], + mdm_account: Optional[str] = None, + metric_name_space: Optional[str] = None, + **kwargs + ): + super(MetricConfiguration, self).__init__(**kwargs) + self.resource_id = resource_id + self.mdm_account = mdm_account + self.metric_name_space = metric_name_space + self.counter_sets = counter_sets + + +class MetricCounter(msrest.serialization.Model): + """The metric counter. + + All required parameters must be populated in order to send to Azure. + + :param name: Required. The counter name. + :type name: str + :param instance: The instance from which counter should be collected. + :type instance: str + :param dimension_filter: The dimension filter. + :type dimension_filter: + list[~azure.mgmt.databoxedge.v2021_02_01_preview.models.MetricDimension] + :param additional_dimensions: The additional dimensions to be added to metric. + :type additional_dimensions: + list[~azure.mgmt.databoxedge.v2021_02_01_preview.models.MetricDimension] + """ + + _validation = { + 'name': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'instance': {'key': 'instance', 'type': 'str'}, + 'dimension_filter': {'key': 'dimensionFilter', 'type': '[MetricDimension]'}, + 'additional_dimensions': {'key': 'additionalDimensions', 'type': '[MetricDimension]'}, + } + + def __init__( + self, + *, + name: str, + instance: Optional[str] = None, + dimension_filter: Optional[List["MetricDimension"]] = None, + additional_dimensions: Optional[List["MetricDimension"]] = None, + **kwargs + ): + super(MetricCounter, self).__init__(**kwargs) + self.name = name + self.instance = instance + self.dimension_filter = dimension_filter + self.additional_dimensions = additional_dimensions + + +class MetricCounterSet(msrest.serialization.Model): + """The metric counter set. + + All required parameters must be populated in order to send to Azure. + + :param counters: Required. The counters that should be collected in this set. + :type counters: list[~azure.mgmt.databoxedge.v2021_02_01_preview.models.MetricCounter] + """ + + _validation = { + 'counters': {'required': True}, + } + + _attribute_map = { + 'counters': {'key': 'counters', 'type': '[MetricCounter]'}, + } + + def __init__( + self, + *, + counters: List["MetricCounter"], + **kwargs + ): + super(MetricCounterSet, self).__init__(**kwargs) + self.counters = counters + + +class MetricDimension(msrest.serialization.Model): + """The metric dimension. + + All required parameters must be populated in order to send to Azure. + + :param source_type: Required. The dimension type. + :type source_type: str + :param source_name: Required. The dimension value. + :type source_name: str + """ + + _validation = { + 'source_type': {'required': True}, + 'source_name': {'required': True}, + } + + _attribute_map = { + 'source_type': {'key': 'sourceType', 'type': 'str'}, + 'source_name': {'key': 'sourceName', 'type': 'str'}, + } + + def __init__( + self, + *, + source_type: str, + source_name: str, + **kwargs + ): + super(MetricDimension, self).__init__(**kwargs) + self.source_type = source_type + self.source_name = source_name + + +class MetricDimensionV1(msrest.serialization.Model): + """Metric Dimension v1. + + :param name: Name of the metrics dimension. + :type name: str + :param display_name: Display name of the metrics dimension. + :type display_name: str + :param to_be_exported_for_shoebox: To be exported to shoe box. + :type to_be_exported_for_shoebox: bool + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'display_name': {'key': 'displayName', 'type': 'str'}, + 'to_be_exported_for_shoebox': {'key': 'toBeExportedForShoebox', 'type': 'bool'}, + } + + def __init__( + self, + *, + name: Optional[str] = None, + display_name: Optional[str] = None, + to_be_exported_for_shoebox: Optional[bool] = None, + **kwargs + ): + super(MetricDimensionV1, self).__init__(**kwargs) + self.name = name + self.display_name = display_name + self.to_be_exported_for_shoebox = to_be_exported_for_shoebox + + +class MetricSpecificationV1(msrest.serialization.Model): + """Metric specification version 1. + + :param name: Name of the metric. + :type name: str + :param display_name: Display name of the metric. + :type display_name: str + :param display_description: Description of the metric to be displayed. + :type display_description: str + :param unit: Metric units. Possible values include: "NotSpecified", "Percent", "Count", + "Seconds", "Milliseconds", "Bytes", "BytesPerSecond", "CountPerSecond". + :type unit: str or ~azure.mgmt.databoxedge.v2021_02_01_preview.models.MetricUnit + :param aggregation_type: Metric aggregation type. Possible values include: "NotSpecified", + "None", "Average", "Minimum", "Maximum", "Total", "Count". + :type aggregation_type: str or + ~azure.mgmt.databoxedge.v2021_02_01_preview.models.MetricAggregationType + :param dimensions: Metric dimensions, other than default dimension which is resource. + :type dimensions: list[~azure.mgmt.databoxedge.v2021_02_01_preview.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 ~azure.mgmt.databoxedge.v2021_02_01_preview.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 + ~azure.mgmt.databoxedge.v2021_02_01_preview.models.TimeGrain] + :param supported_aggregation_types: Support metric aggregation type. + :type supported_aggregation_types: list[str or + ~azure.mgmt.databoxedge.v2021_02_01_preview.models.MetricAggregationType] + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'display_name': {'key': 'displayName', 'type': 'str'}, + 'display_description': {'key': 'displayDescription', 'type': 'str'}, + 'unit': {'key': 'unit', 'type': 'str'}, + 'aggregation_type': {'key': 'aggregationType', 'type': 'str'}, + 'dimensions': {'key': 'dimensions', 'type': '[MetricDimensionV1]'}, + 'fill_gap_with_zero': {'key': 'fillGapWithZero', 'type': 'bool'}, + 'category': {'key': 'category', 'type': 'str'}, + 'resource_id_dimension_name_override': {'key': 'resourceIdDimensionNameOverride', 'type': 'str'}, + 'supported_time_grain_types': {'key': 'supportedTimeGrainTypes', 'type': '[str]'}, + 'supported_aggregation_types': {'key': 'supportedAggregationTypes', 'type': '[str]'}, + } + + def __init__( + self, + *, + name: Optional[str] = None, + display_name: Optional[str] = None, + display_description: Optional[str] = None, + unit: Optional[Union[str, "MetricUnit"]] = None, + aggregation_type: Optional[Union[str, "MetricAggregationType"]] = None, + dimensions: Optional[List["MetricDimensionV1"]] = None, + fill_gap_with_zero: Optional[bool] = None, + category: Optional[Union[str, "MetricCategory"]] = None, + resource_id_dimension_name_override: Optional[str] = None, + supported_time_grain_types: Optional[List[Union[str, "TimeGrain"]]] = None, + supported_aggregation_types: Optional[List[Union[str, "MetricAggregationType"]]] = None, + **kwargs + ): + super(MetricSpecificationV1, self).__init__(**kwargs) + self.name = name + self.display_name = display_name + self.display_description = display_description + self.unit = unit + self.aggregation_type = aggregation_type + self.dimensions = dimensions + self.fill_gap_with_zero = fill_gap_with_zero + self.category = category + self.resource_id_dimension_name_override = resource_id_dimension_name_override + self.supported_time_grain_types = supported_time_grain_types + self.supported_aggregation_types = supported_aggregation_types + + +class MonitoringMetricConfiguration(ARMBaseModel): + """The metric setting details for the role. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: The path ID that uniquely identifies the object. + :vartype id: str + :ivar name: The object name. + :vartype name: str + :ivar type: The hierarchical type of the object. + :vartype type: str + :ivar system_data: MonitoringConfiguration on ASE device. + :vartype system_data: ~azure.mgmt.databoxedge.v2021_02_01_preview.models.SystemData + :param metric_configurations: Required. The metrics configuration details. + :type metric_configurations: + list[~azure.mgmt.databoxedge.v2021_02_01_preview.models.MetricConfiguration] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'system_data': {'readonly': True}, + 'metric_configurations': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'metric_configurations': {'key': 'properties.metricConfigurations', 'type': '[MetricConfiguration]'}, + } + + def __init__( + self, + *, + metric_configurations: List["MetricConfiguration"], + **kwargs + ): + super(MonitoringMetricConfiguration, self).__init__(**kwargs) + self.system_data = None + self.metric_configurations = metric_configurations + + +class MonitoringMetricConfigurationList(msrest.serialization.Model): + """Collection of metric configurations. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar value: The list of metric configurations. + :vartype value: + list[~azure.mgmt.databoxedge.v2021_02_01_preview.models.MonitoringMetricConfiguration] + :ivar next_link: Link to the next set of results. + :vartype next_link: str + """ + + _validation = { + 'value': {'readonly': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[MonitoringMetricConfiguration]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(MonitoringMetricConfigurationList, self).__init__(**kwargs) + self.value = None + self.next_link = None + + +class MountPointMap(msrest.serialization.Model): + """The share mount point. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :param share_id: Required. ID of the share mounted to the role VM. + :type share_id: str + :ivar role_id: ID of the role to which share is mounted. + :vartype role_id: str + :ivar mount_point: Mount point for the share. + :vartype mount_point: str + :ivar mount_type: Mounting type. Possible values include: "Volume", "HostPath". + :vartype mount_type: str or ~azure.mgmt.databoxedge.v2021_02_01_preview.models.MountType + :ivar role_type: Role type. Possible values include: "IOT", "ASA", "Functions", "Cognitive", + "MEC", "CloudEdgeManagement", "Kubernetes". + :vartype role_type: str or ~azure.mgmt.databoxedge.v2021_02_01_preview.models.RoleTypes + """ + + _validation = { + 'share_id': {'required': True}, + 'role_id': {'readonly': True}, + 'mount_point': {'readonly': True}, + 'mount_type': {'readonly': True}, + 'role_type': {'readonly': True}, + } + + _attribute_map = { + 'share_id': {'key': 'shareId', 'type': 'str'}, + 'role_id': {'key': 'roleId', 'type': 'str'}, + 'mount_point': {'key': 'mountPoint', 'type': 'str'}, + 'mount_type': {'key': 'mountType', 'type': 'str'}, + 'role_type': {'key': 'roleType', 'type': 'str'}, + } + + def __init__( + self, + *, + share_id: str, + **kwargs + ): + super(MountPointMap, self).__init__(**kwargs) + self.share_id = share_id + self.role_id = None + self.mount_point = None + self.mount_type = None + self.role_type = None + + +class NetworkAdapter(msrest.serialization.Model): + """Represents the networkAdapter on a device. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar adapter_id: Instance ID of network adapter. + :vartype adapter_id: str + :ivar adapter_position: Hardware position of network adapter. + :vartype adapter_position: + ~azure.mgmt.databoxedge.v2021_02_01_preview.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 ~azure.mgmt.databoxedge.v2021_02_01_preview.models.NetworkAdapterStatus + :param rdma_status: Value indicating whether this adapter is RDMA capable. Possible values + include: "Incapable", "Capable". + :type rdma_status: str or + ~azure.mgmt.databoxedge.v2021_02_01_preview.models.NetworkAdapterRDMAStatus + :param dhcp_status: Value indicating whether this adapter has DHCP enabled. Possible values + include: "Disabled", "Enabled". + :type dhcp_status: str or + ~azure.mgmt.databoxedge.v2021_02_01_preview.models.NetworkAdapterDHCPStatus + :ivar ipv4_configuration: The IPv4 configuration of the network adapter. + :vartype ipv4_configuration: ~azure.mgmt.databoxedge.v2021_02_01_preview.models.Ipv4Config + :ivar ipv6_configuration: The IPv6 configuration of the network adapter. + :vartype ipv6_configuration: ~azure.mgmt.databoxedge.v2021_02_01_preview.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 ~azure.mgmt.databoxedge.v2021_02_01_preview.models.NetworkGroup + :ivar port: The port. + :vartype port: int + """ + + _validation = { + 'network_group': {'readonly': True}, + 'port': {'readonly': True}, + } + + _attribute_map = { + 'network_group': {'key': 'networkGroup', 'type': 'str'}, + 'port': {'key': 'port', 'type': 'int'}, + } + + def __init__( + self, + **kwargs + ): + super(NetworkAdapterPosition, self).__init__(**kwargs) + self.network_group = None + self.port = None + + +class NetworkSettings(ARMBaseModel): + """The network settings of a device. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: The path ID that uniquely identifies the object. + :vartype id: str + :ivar name: The object name. + :vartype name: str + :ivar type: The hierarchical type of the object. + :vartype type: str + :ivar system_data: NetworkSettings on ASE device. + :vartype system_data: ~azure.mgmt.databoxedge.v2021_02_01_preview.models.SystemData + :ivar network_adapters: The network adapter list on the device. + :vartype network_adapters: + list[~azure.mgmt.databoxedge.v2021_02_01_preview.models.NetworkAdapter] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'system_data': {'readonly': True}, + 'network_adapters': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'network_adapters': {'key': 'properties.networkAdapters', 'type': '[NetworkAdapter]'}, + } + + def __init__( + self, + **kwargs + ): + super(NetworkSettings, self).__init__(**kwargs) + self.system_data = None + self.network_adapters = None + + +class Node(ARMBaseModel): + """Represents a single node in a Data box Edge/Gateway device +Gateway devices, standalone Edge devices and a single node cluster Edge device will all have 1 node +Multi-node Edge devices will have more than 1 nodes. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: The path ID that uniquely identifies the object. + :vartype id: str + :ivar name: The object name. + :vartype name: str + :ivar type: The hierarchical type of the object. + :vartype type: str + :ivar node_status: The current status of the individual node. Possible values include: + "Unknown", "Up", "Down", "Rebooting", "ShuttingDown". + :vartype node_status: str or ~azure.mgmt.databoxedge.v2021_02_01_preview.models.NodeStatus + :ivar node_chassis_serial_number: Serial number of the Chassis. + :vartype node_chassis_serial_number: str + :ivar node_serial_number: Serial number of the individual node. + :vartype node_serial_number: str + :ivar node_display_name: Display Name of the individual node. + :vartype node_display_name: str + :ivar node_friendly_software_version: Friendly software version name that is currently + installed on the node. + :vartype node_friendly_software_version: str + :ivar node_hcs_version: HCS version that is currently installed on the node. + :vartype node_hcs_version: str + :ivar node_instance_id: Guid instance id of the node. + :vartype node_instance_id: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'node_status': {'readonly': True}, + 'node_chassis_serial_number': {'readonly': True}, + 'node_serial_number': {'readonly': True}, + 'node_display_name': {'readonly': True}, + 'node_friendly_software_version': {'readonly': True}, + 'node_hcs_version': {'readonly': True}, + 'node_instance_id': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'node_status': {'key': 'properties.nodeStatus', 'type': 'str'}, + 'node_chassis_serial_number': {'key': 'properties.nodeChassisSerialNumber', 'type': 'str'}, + 'node_serial_number': {'key': 'properties.nodeSerialNumber', 'type': 'str'}, + 'node_display_name': {'key': 'properties.nodeDisplayName', 'type': 'str'}, + 'node_friendly_software_version': {'key': 'properties.nodeFriendlySoftwareVersion', 'type': 'str'}, + 'node_hcs_version': {'key': 'properties.nodeHcsVersion', 'type': 'str'}, + 'node_instance_id': {'key': 'properties.nodeInstanceId', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(Node, self).__init__(**kwargs) + self.node_status = None + self.node_chassis_serial_number = None + self.node_serial_number = None + self.node_display_name = None + self.node_friendly_software_version = None + self.node_hcs_version = None + self.node_instance_id = None + + +class NodeInfo(msrest.serialization.Model): + """Kubernetes node info. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar name: Node name. + :vartype name: str + :ivar type: Node type - Master/Worker. Possible values include: "Invalid", "Master", "Worker". + :vartype type: str or ~azure.mgmt.databoxedge.v2021_02_01_preview.models.KubernetesNodeType + :param ip_configuration: IP Configuration of the Kubernetes node. + :type ip_configuration: + list[~azure.mgmt.databoxedge.v2021_02_01_preview.models.KubernetesIPConfiguration] + """ + + _validation = { + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'ip_configuration': {'key': 'ipConfiguration', 'type': '[KubernetesIPConfiguration]'}, + } + + def __init__( + self, + *, + ip_configuration: Optional[List["KubernetesIPConfiguration"]] = None, + **kwargs + ): + super(NodeInfo, self).__init__(**kwargs) + self.name = None + self.type = None + self.ip_configuration = ip_configuration + + +class NodeList(msrest.serialization.Model): + """Collection of Nodes. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar value: The list of Nodes. + :vartype value: list[~azure.mgmt.databoxedge.v2021_02_01_preview.models.Node] + :param next_link: Link to the next set of results. + :type next_link: str + """ + + _validation = { + 'value': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[Node]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + next_link: Optional[str] = None, + **kwargs + ): + super(NodeList, self).__init__(**kwargs) + self.value = None + self.next_link = next_link + + +class Operation(msrest.serialization.Model): + """Operations. + + :param name: Name of the operation. + :type name: str + :param display: Properties displayed for the operation. + :type display: ~azure.mgmt.databoxedge.v2021_02_01_preview.models.OperationDisplay + :param origin: Origin of the operation. + :type origin: str + :param is_data_action: Indicates whether the operation is a data action. + :type is_data_action: bool + :param service_specification: Service specification. + :type service_specification: + ~azure.mgmt.databoxedge.v2021_02_01_preview.models.ServiceSpecification + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'display': {'key': 'display', 'type': 'OperationDisplay'}, + 'origin': {'key': 'origin', 'type': 'str'}, + 'is_data_action': {'key': 'isDataAction', 'type': 'bool'}, + 'service_specification': {'key': 'properties.serviceSpecification', 'type': 'ServiceSpecification'}, + } + + def __init__( + self, + *, + name: Optional[str] = None, + display: Optional["OperationDisplay"] = None, + origin: Optional[str] = None, + is_data_action: Optional[bool] = None, + service_specification: Optional["ServiceSpecification"] = None, + **kwargs + ): + super(Operation, self).__init__(**kwargs) + self.name = name + self.display = display + self.origin = origin + self.is_data_action = is_data_action + 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[~azure.mgmt.databoxedge.v2021_02_01_preview.models.Operation] + :param next_link: Link to the next set of results. + :type next_link: str + """ + + _validation = { + 'value': {'required': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[Operation]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + value: List["Operation"], + next_link: Optional[str] = None, + **kwargs + ): + super(OperationsList, self).__init__(**kwargs) + self.value = value + self.next_link = next_link + + +class Order(ARMBaseModel): + """The order details. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: The path ID that uniquely identifies the object. + :vartype id: str + :ivar name: The object name. + :vartype name: str + :ivar type: The hierarchical type of the object. + :vartype type: str + :ivar system_data: Order configured on ASE resource. + :vartype system_data: ~azure.mgmt.databoxedge.v2021_02_01_preview.models.SystemData + :param contact_information: The contact details. + :type contact_information: ~azure.mgmt.databoxedge.v2021_02_01_preview.models.ContactDetails + :param shipping_address: The shipping address. + :type shipping_address: ~azure.mgmt.databoxedge.v2021_02_01_preview.models.Address + :ivar current_status: Current status of the order. + :vartype current_status: ~azure.mgmt.databoxedge.v2021_02_01_preview.models.OrderStatus + :ivar order_history: List of status changes in the order. + :vartype order_history: list[~azure.mgmt.databoxedge.v2021_02_01_preview.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[~azure.mgmt.databoxedge.v2021_02_01_preview.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[~azure.mgmt.databoxedge.v2021_02_01_preview.models.TrackingInfo] + :param shipment_type: ShipmentType of the order. Possible values include: "NotApplicable", + "ShippedToCustomer", "SelfPickup". + :type shipment_type: str or ~azure.mgmt.databoxedge.v2021_02_01_preview.models.ShipmentType + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'system_data': {'readonly': True}, + 'current_status': {'readonly': True}, + 'order_history': {'readonly': True}, + 'serial_number': {'readonly': True}, + 'delivery_tracking_info': {'readonly': True}, + 'return_tracking_info': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'contact_information': {'key': 'properties.contactInformation', 'type': 'ContactDetails'}, + 'shipping_address': {'key': 'properties.shippingAddress', 'type': 'Address'}, + 'current_status': {'key': 'properties.currentStatus', 'type': 'OrderStatus'}, + 'order_history': {'key': 'properties.orderHistory', 'type': '[OrderStatus]'}, + 'serial_number': {'key': 'properties.serialNumber', 'type': 'str'}, + 'delivery_tracking_info': {'key': 'properties.deliveryTrackingInfo', 'type': '[TrackingInfo]'}, + 'return_tracking_info': {'key': 'properties.returnTrackingInfo', 'type': '[TrackingInfo]'}, + 'shipment_type': {'key': 'properties.shipmentType', 'type': 'str'}, + } + + def __init__( + self, + *, + contact_information: Optional["ContactDetails"] = None, + shipping_address: Optional["Address"] = None, + shipment_type: Optional[Union[str, "ShipmentType"]] = None, + **kwargs + ): + super(Order, self).__init__(**kwargs) + self.system_data = None + self.contact_information = contact_information + self.shipping_address = shipping_address + self.current_status = None + self.order_history = None + self.serial_number = None + self.delivery_tracking_info = None + self.return_tracking_info = None + self.shipment_type = shipment_type + + +class OrderList(msrest.serialization.Model): + """List of order entities. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar value: The list of orders. + :vartype value: list[~azure.mgmt.databoxedge.v2021_02_01_preview.models.Order] + :ivar next_link: Link to the next set of results. + :vartype next_link: str + """ + + _validation = { + 'value': {'readonly': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[Order]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(OrderList, self).__init__(**kwargs) + self.value = None + self.next_link = None + + +class OrderStatus(msrest.serialization.Model): + """Represents a single status change. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :param status: Required. Status of the order as per the allowed status types. Possible values + include: "Untracked", "AwaitingFulfillment", "AwaitingPreparation", "AwaitingShipment", + "Shipped", "Arriving", "Delivered", "ReplacementRequested", "LostDevice", "Declined", + "ReturnInitiated", "AwaitingReturnShipment", "ShippedBack", "CollectedAtMicrosoft", + "AwaitingPickup", "PickupCompleted", "AwaitingDrop". + :type status: str or ~azure.mgmt.databoxedge.v2021_02_01_preview.models.OrderState + :ivar update_date_time: Time of status update. + :vartype update_date_time: ~datetime.datetime + :param comments: Comments related to this status change. + :type comments: str + :ivar tracking_information: Tracking information related to the state in the ordering flow. + :vartype tracking_information: ~azure.mgmt.databoxedge.v2021_02_01_preview.models.TrackingInfo + :ivar additional_order_details: Dictionary to hold generic information which is not stored + by the already existing properties. + :vartype additional_order_details: dict[str, str] + """ + + _validation = { + 'status': {'required': True}, + 'update_date_time': {'readonly': True}, + 'tracking_information': {'readonly': True}, + 'additional_order_details': {'readonly': True}, + } + + _attribute_map = { + 'status': {'key': 'status', 'type': 'str'}, + 'update_date_time': {'key': 'updateDateTime', 'type': 'iso-8601'}, + 'comments': {'key': 'comments', 'type': 'str'}, + 'tracking_information': {'key': 'trackingInformation', 'type': 'TrackingInfo'}, + 'additional_order_details': {'key': 'additionalOrderDetails', 'type': '{str}'}, + } + + def __init__( + self, + *, + status: Union[str, "OrderState"], + comments: Optional[str] = None, + **kwargs + ): + super(OrderStatus, self).__init__(**kwargs) + self.status = status + self.update_date_time = None + self.comments = comments + self.tracking_information = None + self.additional_order_details = None + + +class PeriodicTimerEventTrigger(Trigger): + """Trigger details. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: The path ID that uniquely identifies the object. + :vartype id: str + :ivar name: The object name. + :vartype name: str + :ivar type: The hierarchical type of the object. + :vartype type: str + :ivar system_data: Trigger in DataBoxEdge Resource. + :vartype system_data: ~azure.mgmt.databoxedge.v2021_02_01_preview.models.SystemData + :param kind: Required. Trigger Kind.Constant filled by server. Possible values include: + "FileEvent", "PeriodicTimerEvent". + :type kind: str or ~azure.mgmt.databoxedge.v2021_02_01_preview.models.TriggerEventType + :param source_info: Required. Periodic timer details. + :type source_info: ~azure.mgmt.databoxedge.v2021_02_01_preview.models.PeriodicTimerSourceInfo + :param sink_info: Required. Role Sink information. + :type sink_info: ~azure.mgmt.databoxedge.v2021_02_01_preview.models.RoleSinkInfo + :param custom_context_tag: A custom context tag typically used to correlate the trigger against + its usage. For example, if a periodic timer trigger is intended for certain specific IoT + modules in the device, the tag can be the name or the image URL of the module. + :type custom_context_tag: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'system_data': {'readonly': True}, + 'kind': {'required': True}, + 'source_info': {'required': True}, + 'sink_info': {'required': True}, + 'custom_context_tag': {'max_length': 192, 'min_length': 0}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'source_info': {'key': 'properties.sourceInfo', 'type': 'PeriodicTimerSourceInfo'}, + 'sink_info': {'key': 'properties.sinkInfo', 'type': 'RoleSinkInfo'}, + 'custom_context_tag': {'key': 'properties.customContextTag', 'type': 'str'}, + } + + def __init__( + self, + *, + source_info: "PeriodicTimerSourceInfo", + sink_info: "RoleSinkInfo", + custom_context_tag: Optional[str] = None, + **kwargs + ): + super(PeriodicTimerEventTrigger, self).__init__(**kwargs) + self.kind = 'PeriodicTimerEvent' # type: str + self.source_info = source_info + self.sink_info = sink_info + self.custom_context_tag = custom_context_tag + + +class PeriodicTimerSourceInfo(msrest.serialization.Model): + """Periodic timer event source. + + All required parameters must be populated in order to send to Azure. + + :param start_time: Required. The time of the day that results in a valid trigger. Schedule is + computed with reference to the time specified upto seconds. If timezone is not specified the + time will considered to be in device timezone. The value will always be returned as UTC time. + :type start_time: ~datetime.datetime + :param schedule: Required. Periodic frequency at which timer event needs to be raised. Supports + daily, hourly, minutes, and seconds. + :type schedule: str + :param topic: Topic where periodic events are published to IoT device. + :type topic: str + """ + + _validation = { + 'start_time': {'required': True}, + 'schedule': {'required': True}, + } + + _attribute_map = { + 'start_time': {'key': 'startTime', 'type': 'iso-8601'}, + 'schedule': {'key': 'schedule', 'type': 'str'}, + 'topic': {'key': 'topic', 'type': 'str'}, + } + + def __init__( + self, + *, + start_time: datetime.datetime, + schedule: str, + topic: Optional[str] = None, + **kwargs + ): + super(PeriodicTimerSourceInfo, self).__init__(**kwargs) + self.start_time = start_time + self.schedule = schedule + self.topic = topic + + +class RefreshDetails(msrest.serialization.Model): + """Fields for tracking refresh job on the share or container. + + :param in_progress_refresh_job_id: If a refresh job is currently in progress on this share or + container, this field indicates the ARM resource ID of that job. The field is empty if no job + is in progress. + :type in_progress_refresh_job_id: str + :param last_completed_refresh_job_time_in_utc: Indicates the completed time for the last + refresh job on this particular share or container, if any.This could be a failed job or a + successful job. + :type last_completed_refresh_job_time_in_utc: ~datetime.datetime + :param error_manifest_file: Indicates the relative path of the error xml for the last refresh + job on this particular share or container, if any. This could be a failed job or a successful + job. + :type error_manifest_file: str + :param last_job: Indicates the id of the last refresh job on this particular share or + container,if any. This could be a failed job or a successful job. + :type last_job: str + """ + + _attribute_map = { + 'in_progress_refresh_job_id': {'key': 'inProgressRefreshJobId', 'type': 'str'}, + 'last_completed_refresh_job_time_in_utc': {'key': 'lastCompletedRefreshJobTimeInUTC', 'type': 'iso-8601'}, + 'error_manifest_file': {'key': 'errorManifestFile', 'type': 'str'}, + 'last_job': {'key': 'lastJob', 'type': 'str'}, + } + + def __init__( + self, + *, + in_progress_refresh_job_id: Optional[str] = None, + last_completed_refresh_job_time_in_utc: Optional[datetime.datetime] = None, + error_manifest_file: Optional[str] = None, + last_job: Optional[str] = None, + **kwargs + ): + super(RefreshDetails, self).__init__(**kwargs) + self.in_progress_refresh_job_id = in_progress_refresh_job_id + self.last_completed_refresh_job_time_in_utc = last_completed_refresh_job_time_in_utc + self.error_manifest_file = error_manifest_file + self.last_job = last_job + + +class ResourceIdentity(msrest.serialization.Model): + """Msi identity details of the resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param type: Identity type. Possible values include: "None", "SystemAssigned", "UserAssigned". + :type type: str or ~azure.mgmt.databoxedge.v2021_02_01_preview.models.MsiIdentityType + :ivar principal_id: Service Principal Id backing the Msi. + :vartype principal_id: str + :ivar tenant_id: Home Tenant Id. + :vartype tenant_id: str + """ + + _validation = { + 'principal_id': {'readonly': True}, + 'tenant_id': {'readonly': True}, + } + + _attribute_map = { + 'type': {'key': 'type', 'type': 'str'}, + 'principal_id': {'key': 'principalId', 'type': 'str'}, + 'tenant_id': {'key': 'tenantId', 'type': 'str'}, + } + + def __init__( + self, + *, + type: Optional[Union[str, "MsiIdentityType"]] = None, + **kwargs + ): + super(ResourceIdentity, self).__init__(**kwargs) + self.type = type + self.principal_id = None + self.tenant_id = None + + +class ResourceMoveDetails(msrest.serialization.Model): + """Fields for tracking resource move. + + :param operation_in_progress: Denotes whether move operation is in progress. Possible values + include: "None", "ResourceMoveInProgress", "ResourceMoveFailed". + :type operation_in_progress: str or + ~azure.mgmt.databoxedge.v2021_02_01_preview.models.ResourceMoveStatus + :param operation_in_progress_lock_timeout_in_utc: Denotes the timeout of the operation to + finish. + :type operation_in_progress_lock_timeout_in_utc: ~datetime.datetime + """ + + _attribute_map = { + 'operation_in_progress': {'key': 'operationInProgress', 'type': 'str'}, + 'operation_in_progress_lock_timeout_in_utc': {'key': 'operationInProgressLockTimeoutInUTC', 'type': 'iso-8601'}, + } + + def __init__( + self, + *, + operation_in_progress: Optional[Union[str, "ResourceMoveStatus"]] = None, + operation_in_progress_lock_timeout_in_utc: Optional[datetime.datetime] = None, + **kwargs + ): + super(ResourceMoveDetails, self).__init__(**kwargs) + self.operation_in_progress = operation_in_progress + self.operation_in_progress_lock_timeout_in_utc = operation_in_progress_lock_timeout_in_utc + + +class ResourceTypeSku(msrest.serialization.Model): + """Resource type Sku object. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar resource_type: The resource type. + :vartype resource_type: str + :ivar skus: The skus. + :vartype skus: list[~azure.mgmt.databoxedge.v2021_02_01_preview.models.SkuInformation] + """ + + _validation = { + 'resource_type': {'readonly': True}, + 'skus': {'readonly': True}, + } + + _attribute_map = { + 'resource_type': {'key': 'resourceType', 'type': 'str'}, + 'skus': {'key': 'skus', 'type': '[SkuInformation]'}, + } + + def __init__( + self, + **kwargs + ): + super(ResourceTypeSku, self).__init__(**kwargs) + self.resource_type = None + self.skus = None + + +class RoleList(msrest.serialization.Model): + """Collection of all the roles on the Data Box Edge device. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar value: The Value. + :vartype value: list[~azure.mgmt.databoxedge.v2021_02_01_preview.models.Role] + :ivar next_link: Link to the next set of results. + :vartype next_link: str + """ + + _validation = { + 'value': {'readonly': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[Role]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(RoleList, self).__init__(**kwargs) + self.value = None + self.next_link = None + + +class RoleSinkInfo(msrest.serialization.Model): + """Compute role against which events will be raised. + + All required parameters must be populated in order to send to Azure. + + :param role_id: Required. Compute role ID. + :type role_id: str + """ + + _validation = { + 'role_id': {'required': True}, + } + + _attribute_map = { + 'role_id': {'key': 'roleId', 'type': 'str'}, + } + + def __init__( + self, + *, + role_id: str, + **kwargs + ): + super(RoleSinkInfo, self).__init__(**kwargs) + self.role_id = role_id + + +class Secret(msrest.serialization.Model): + """Holds device secret either as a KeyVault reference or as an encrypted value. + + :param encrypted_secret: Encrypted (using device public key) secret value. + :type encrypted_secret: + ~azure.mgmt.databoxedge.v2021_02_01_preview.models.AsymmetricEncryptedSecret + :param key_vault_id: Id of the Key-Vault where secret is stored (ex: + secrets/AuthClientSecret/82ef4346187a4033a10d629cde07d740). + :type key_vault_id: str + """ + + _attribute_map = { + 'encrypted_secret': {'key': 'encryptedSecret', 'type': 'AsymmetricEncryptedSecret'}, + 'key_vault_id': {'key': 'keyVaultId', 'type': 'str'}, + } + + def __init__( + self, + *, + encrypted_secret: Optional["AsymmetricEncryptedSecret"] = None, + key_vault_id: Optional[str] = None, + **kwargs + ): + super(Secret, self).__init__(**kwargs) + self.encrypted_secret = encrypted_secret + self.key_vault_id = key_vault_id + + +class SecuritySettings(ARMBaseModel): + """The security settings of a device. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: The path ID that uniquely identifies the object. + :vartype id: str + :ivar name: The object name. + :vartype name: str + :ivar type: The hierarchical type of the object. + :vartype type: str + :param device_admin_password: Required. Device administrator password as an encrypted string + (encrypted using RSA PKCS #1) is used to sign into the local web UI of the device. The Actual + password should have at least 8 characters that are a combination of uppercase, lowercase, + numeric, and special characters. + :type device_admin_password: + ~azure.mgmt.databoxedge.v2021_02_01_preview.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[~azure.mgmt.databoxedge.v2021_02_01_preview.models.MetricSpecificationV1] + """ + + _attribute_map = { + 'metric_specifications': {'key': 'metricSpecifications', 'type': '[MetricSpecificationV1]'}, + } + + def __init__( + self, + *, + metric_specifications: Optional[List["MetricSpecificationV1"]] = None, + **kwargs + ): + super(ServiceSpecification, self).__init__(**kwargs) + self.metric_specifications = metric_specifications + + +class Share(ARMBaseModel): + """Represents a share on the Data Box Edge/Gateway device. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: The path ID that uniquely identifies the object. + :vartype id: str + :ivar name: The object name. + :vartype name: str + :ivar type: The hierarchical type of the object. + :vartype type: str + :ivar system_data: Share on ASE device. + :vartype system_data: ~azure.mgmt.databoxedge.v2021_02_01_preview.models.SystemData + :param description: Description for the share. + :type description: str + :param share_status: Required. Current status of the share. Possible values include: "Offline", + "Unknown", "OK", "Updating", "NeedsAttention". + :type share_status: str or ~azure.mgmt.databoxedge.v2021_02_01_preview.models.ShareStatus + :param monitoring_status: Required. Current monitoring status of the share. Possible values + include: "Enabled", "Disabled". + :type monitoring_status: str or + ~azure.mgmt.databoxedge.v2021_02_01_preview.models.MonitoringStatus + :param azure_container_info: Azure container mapping for the share. + :type azure_container_info: + ~azure.mgmt.databoxedge.v2021_02_01_preview.models.AzureContainerInfo + :param access_protocol: Required. Access protocol to be used by the share. Possible values + include: "SMB", "NFS". + :type access_protocol: str or + ~azure.mgmt.databoxedge.v2021_02_01_preview.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[~azure.mgmt.databoxedge.v2021_02_01_preview.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[~azure.mgmt.databoxedge.v2021_02_01_preview.models.ClientAccessRight] + :param refresh_details: Details of the refresh job on this share. + :type refresh_details: ~azure.mgmt.databoxedge.v2021_02_01_preview.models.RefreshDetails + :ivar share_mappings: Share mount point to the role. + :vartype share_mappings: list[~azure.mgmt.databoxedge.v2021_02_01_preview.models.MountPointMap] + :param data_policy: Data policy of the share. Possible values include: "Cloud", "Local". + :type data_policy: str or ~azure.mgmt.databoxedge.v2021_02_01_preview.models.DataPolicy + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'system_data': {'readonly': True}, + 'share_status': {'required': True}, + 'monitoring_status': {'required': True}, + 'access_protocol': {'required': True}, + 'share_mappings': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + 'share_status': {'key': 'properties.shareStatus', 'type': 'str'}, + 'monitoring_status': {'key': 'properties.monitoringStatus', 'type': 'str'}, + 'azure_container_info': {'key': 'properties.azureContainerInfo', 'type': 'AzureContainerInfo'}, + 'access_protocol': {'key': 'properties.accessProtocol', 'type': 'str'}, + 'user_access_rights': {'key': 'properties.userAccessRights', 'type': '[UserAccessRight]'}, + 'client_access_rights': {'key': 'properties.clientAccessRights', 'type': '[ClientAccessRight]'}, + 'refresh_details': {'key': 'properties.refreshDetails', 'type': 'RefreshDetails'}, + 'share_mappings': {'key': 'properties.shareMappings', 'type': '[MountPointMap]'}, + 'data_policy': {'key': 'properties.dataPolicy', 'type': 'str'}, + } + + def __init__( + self, + *, + share_status: Union[str, "ShareStatus"], + monitoring_status: Union[str, "MonitoringStatus"], + access_protocol: Union[str, "ShareAccessProtocol"], + description: Optional[str] = None, + azure_container_info: Optional["AzureContainerInfo"] = None, + user_access_rights: Optional[List["UserAccessRight"]] = None, + client_access_rights: Optional[List["ClientAccessRight"]] = None, + refresh_details: Optional["RefreshDetails"] = None, + data_policy: Optional[Union[str, "DataPolicy"]] = None, + **kwargs + ): + super(Share, self).__init__(**kwargs) + self.system_data = None + self.description = description + self.share_status = share_status + self.monitoring_status = monitoring_status + self.azure_container_info = azure_container_info + self.access_protocol = access_protocol + self.user_access_rights = user_access_rights + self.client_access_rights = client_access_rights + self.refresh_details = refresh_details + self.share_mappings = None + self.data_policy = data_policy + + +class ShareAccessRight(msrest.serialization.Model): + """Specifies the mapping between this particular user and the type of access he has on shares on this device. + + All required parameters must be populated in order to send to Azure. + + :param share_id: Required. The share ID. + :type share_id: str + :param access_type: Required. Type of access to be allowed on the share for this user. Possible + values include: "Change", "Read", "Custom". + :type access_type: str or ~azure.mgmt.databoxedge.v2021_02_01_preview.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[~azure.mgmt.databoxedge.v2021_02_01_preview.models.Share] + :ivar next_link: Link to the next set of results. + :vartype next_link: str + """ + + _validation = { + 'value': {'readonly': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[Share]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ShareList, self).__init__(**kwargs) + self.value = None + self.next_link = None + + +class Sku(msrest.serialization.Model): + """The SKU type. + + :param name: SKU name. Possible values include: "Gateway", "Edge", "TEA_1Node", + "TEA_1Node_UPS", "TEA_1Node_Heater", "TEA_1Node_UPS_Heater", "TEA_4Node_Heater", + "TEA_4Node_UPS_Heater", "TMA", "TDC", "TCA_Small", "GPU", "TCA_Large", "EdgeP_Base", + "EdgeP_High", "EdgePR_Base", "EdgePR_Base_UPS", "EP2_64_1VPU_W", "EP2_128_1T4_Mx1_W", + "EP2_256_2T4_W", "EdgeMR_Mini", "RCA_Small", "RCA_Large", "RDC", "Management". + :type name: str or ~azure.mgmt.databoxedge.v2021_02_01_preview.models.SkuName + :param tier: The SKU tier. This is based on the SKU name. Possible values include: "Standard". + :type tier: str or ~azure.mgmt.databoxedge.v2021_02_01_preview.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: The extended unit. + :vartype extended_unit: str + """ + + _validation = { + 'meter_id': {'readonly': True}, + 'quantity': {'readonly': True}, + 'extended_unit': {'readonly': True}, + } + + _attribute_map = { + 'meter_id': {'key': 'meterId', 'type': 'str'}, + 'quantity': {'key': 'quantity', 'type': 'long'}, + 'extended_unit': {'key': 'extendedUnit', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(SkuCost, self).__init__(**kwargs) + self.meter_id = None + self.quantity = None + self.extended_unit = None + + +class SkuInformation(msrest.serialization.Model): + """Sku information. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar name: The sku name. + :vartype name: str + :ivar tier: The sku tier. + :vartype tier: str + :ivar kind: The sku kind. + :vartype kind: str + :ivar family: The Sku family. + :vartype family: str + :ivar costs: The pricing info of the Sku. + :vartype costs: list[~azure.mgmt.databoxedge.v2021_02_01_preview.models.SkuCost] + :ivar locations: The locations where Sku is available. + :vartype locations: list[str] + :ivar location_info: The locations where Sku is available with zones and sites info. + :vartype location_info: + list[~azure.mgmt.databoxedge.v2021_02_01_preview.models.SkuLocationInfo] + :ivar required_quota_ids: The required quotaIds for the sku to be available. + :vartype required_quota_ids: list[str] + :ivar required_features: The required features for the sku to be available. + :vartype required_features: list[str] + """ + + _validation = { + 'name': {'readonly': True}, + 'tier': {'readonly': True}, + 'kind': {'readonly': True}, + 'family': {'readonly': True}, + 'costs': {'readonly': True}, + 'locations': {'readonly': True}, + 'location_info': {'readonly': True}, + 'required_quota_ids': {'readonly': True}, + 'required_features': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'tier': {'key': 'tier', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'family': {'key': 'family', 'type': 'str'}, + 'costs': {'key': 'costs', 'type': '[SkuCost]'}, + 'locations': {'key': 'locations', 'type': '[str]'}, + 'location_info': {'key': 'locationInfo', 'type': '[SkuLocationInfo]'}, + 'required_quota_ids': {'key': 'requiredQuotaIds', 'type': '[str]'}, + 'required_features': {'key': 'requiredFeatures', 'type': '[str]'}, + } + + def __init__( + self, + **kwargs + ): + super(SkuInformation, self).__init__(**kwargs) + self.name = None + self.tier = None + self.kind = None + self.family = None + self.costs = None + self.locations = None + self.location_info = None + self.required_quota_ids = None + self.required_features = None + + +class SkuInformationList(msrest.serialization.Model): + """List of SKU Information objects. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar value: List of ResourceTypeSku objects. + :vartype value: list[~azure.mgmt.databoxedge.v2021_02_01_preview.models.ResourceTypeSku] + :ivar next_link: Links to the next set of results. + :vartype next_link: str + """ + + _validation = { + 'value': {'readonly': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[ResourceTypeSku]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(SkuInformationList, self).__init__(**kwargs) + self.value = None + self.next_link = None + + +class SkuLocationInfo(msrest.serialization.Model): + """The location info. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar location: The location. + :vartype location: str + :ivar zones: The zones. + :vartype zones: list[str] + :ivar sites: The sites. + :vartype sites: list[str] + """ + + _validation = { + 'location': {'readonly': True}, + 'zones': {'readonly': True}, + 'sites': {'readonly': True}, + } + + _attribute_map = { + 'location': {'key': 'location', 'type': 'str'}, + 'zones': {'key': 'zones', 'type': '[str]'}, + 'sites': {'key': 'sites', 'type': '[str]'}, + } + + def __init__( + self, + **kwargs + ): + super(SkuLocationInfo, self).__init__(**kwargs) + self.location = None + self.zones = None + self.sites = None + + +class StorageAccount(ARMBaseModel): + """Represents a Storage Account on the Data Box Edge/Gateway device. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: The path ID that uniquely identifies the object. + :vartype id: str + :ivar name: The object name. + :vartype name: str + :ivar type: The hierarchical type of the object. + :vartype type: str + :ivar system_data: StorageAccount object on ASE device. + :vartype system_data: ~azure.mgmt.databoxedge.v2021_02_01_preview.models.SystemData + :param description: Description for the storage Account. + :type description: str + :param storage_account_status: Current status of the storage account. Possible values include: + "OK", "Offline", "Unknown", "Updating", "NeedsAttention". + :type storage_account_status: str or + ~azure.mgmt.databoxedge.v2021_02_01_preview.models.StorageAccountStatus + :param data_policy: Required. Data policy of the storage Account. Possible values include: + "Cloud", "Local". + :type data_policy: str or ~azure.mgmt.databoxedge.v2021_02_01_preview.models.DataPolicy + :param storage_account_credential_id: Storage Account Credential Id. + :type storage_account_credential_id: str + :ivar blob_endpoint: BlobEndpoint of Storage Account. + :vartype blob_endpoint: str + :ivar container_count: The Container Count. Present only for Storage Accounts with DataPolicy + set to Cloud. + :vartype container_count: int + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'system_data': {'readonly': True}, + 'data_policy': {'required': True}, + 'blob_endpoint': {'readonly': True}, + 'container_count': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + 'storage_account_status': {'key': 'properties.storageAccountStatus', 'type': 'str'}, + 'data_policy': {'key': 'properties.dataPolicy', 'type': 'str'}, + 'storage_account_credential_id': {'key': 'properties.storageAccountCredentialId', 'type': 'str'}, + 'blob_endpoint': {'key': 'properties.blobEndpoint', 'type': 'str'}, + 'container_count': {'key': 'properties.containerCount', 'type': 'int'}, + } + + def __init__( + self, + *, + data_policy: Union[str, "DataPolicy"], + description: Optional[str] = None, + storage_account_status: Optional[Union[str, "StorageAccountStatus"]] = None, + storage_account_credential_id: Optional[str] = None, + **kwargs + ): + super(StorageAccount, self).__init__(**kwargs) + self.system_data = None + self.description = description + self.storage_account_status = storage_account_status + self.data_policy = data_policy + self.storage_account_credential_id = storage_account_credential_id + self.blob_endpoint = None + self.container_count = None + + +class StorageAccountCredential(ARMBaseModel): + """The storage account credential. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: The path ID that uniquely identifies the object. + :vartype id: str + :ivar name: The object name. + :vartype name: str + :ivar type: The hierarchical type of the object. + :vartype type: str + :ivar system_data: StorageAccountCredential object. + :vartype system_data: ~azure.mgmt.databoxedge.v2021_02_01_preview.models.SystemData + :param alias: Required. Alias for the storage account. + :type alias: str + :param user_name: Username for the storage account. + :type user_name: str + :param account_key: Encrypted storage key. + :type account_key: ~azure.mgmt.databoxedge.v2021_02_01_preview.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 ~azure.mgmt.databoxedge.v2021_02_01_preview.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 ~azure.mgmt.databoxedge.v2021_02_01_preview.models.AccountType + :param storage_account_id: Id of the storage account. + :type storage_account_id: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'system_data': {'readonly': True}, + 'alias': {'required': True}, + 'ssl_status': {'required': True}, + 'account_type': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'alias': {'key': 'properties.alias', 'type': 'str'}, + 'user_name': {'key': 'properties.userName', 'type': 'str'}, + 'account_key': {'key': 'properties.accountKey', 'type': 'AsymmetricEncryptedSecret'}, + 'connection_string': {'key': 'properties.connectionString', 'type': 'str'}, + 'ssl_status': {'key': 'properties.sslStatus', 'type': 'str'}, + 'blob_domain_name': {'key': 'properties.blobDomainName', 'type': 'str'}, + 'account_type': {'key': 'properties.accountType', 'type': 'str'}, + 'storage_account_id': {'key': 'properties.storageAccountId', 'type': 'str'}, + } + + def __init__( + self, + *, + alias: str, + ssl_status: Union[str, "SSLStatus"], + account_type: Union[str, "AccountType"], + user_name: Optional[str] = None, + account_key: Optional["AsymmetricEncryptedSecret"] = None, + connection_string: Optional[str] = None, + blob_domain_name: Optional[str] = None, + storage_account_id: Optional[str] = None, + **kwargs + ): + super(StorageAccountCredential, self).__init__(**kwargs) + self.system_data = None + self.alias = alias + self.user_name = user_name + self.account_key = account_key + self.connection_string = connection_string + self.ssl_status = ssl_status + self.blob_domain_name = blob_domain_name + self.account_type = account_type + self.storage_account_id = storage_account_id + + +class StorageAccountCredentialList(msrest.serialization.Model): + """The collection of storage account credentials. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar value: The value. + :vartype value: + list[~azure.mgmt.databoxedge.v2021_02_01_preview.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[~azure.mgmt.databoxedge.v2021_02_01_preview.models.StorageAccount] + :ivar next_link: Link to the next set of results. + :vartype next_link: str + """ + + _validation = { + 'value': {'readonly': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[StorageAccount]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(StorageAccountList, self).__init__(**kwargs) + self.value = None + self.next_link = None + + +class SubscriptionRegisteredFeatures(msrest.serialization.Model): + """SubscriptionRegisteredFeatures. + + :param name: + :type name: str + :param state: + :type state: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'state': {'key': 'state', 'type': 'str'}, + } + + def __init__( + self, + *, + name: Optional[str] = None, + state: Optional[str] = None, + **kwargs + ): + super(SubscriptionRegisteredFeatures, self).__init__(**kwargs) + self.name = name + self.state = state + + +class SymmetricKey(msrest.serialization.Model): + """Symmetric key for authentication. + + :param connection_string: Connection string based on the symmetric key. + :type connection_string: + ~azure.mgmt.databoxedge.v2021_02_01_preview.models.AsymmetricEncryptedSecret + """ + + _attribute_map = { + 'connection_string': {'key': 'connectionString', 'type': 'AsymmetricEncryptedSecret'}, + } + + def __init__( + self, + *, + connection_string: Optional["AsymmetricEncryptedSecret"] = None, + **kwargs + ): + super(SymmetricKey, self).__init__(**kwargs) + self.connection_string = connection_string + + +class SystemData(msrest.serialization.Model): + """Metadata pertaining to creation and last modification of the resource. + + :param created_by: The identity that created the resource. + :type created_by: str + :param created_by_type: The type of identity that created the resource. Possible values + include: "User", "Application", "ManagedIdentity", "Key". + :type created_by_type: str or ~azure.mgmt.databoxedge.v2021_02_01_preview.models.CreatedByType + :param created_at: The timestamp of resource creation (UTC). + :type created_at: ~datetime.datetime + :param last_modified_by: The identity that last modified the resource. + :type last_modified_by: str + :param last_modified_by_type: The type of identity that last modified the resource. Possible + values include: "User", "Application", "ManagedIdentity", "Key". + :type last_modified_by_type: str or + ~azure.mgmt.databoxedge.v2021_02_01_preview.models.CreatedByType + :param last_modified_at: The type of identity that last modified the resource. + :type last_modified_at: ~datetime.datetime + """ + + _attribute_map = { + 'created_by': {'key': 'createdBy', 'type': 'str'}, + 'created_by_type': {'key': 'createdByType', 'type': 'str'}, + 'created_at': {'key': 'createdAt', 'type': 'iso-8601'}, + 'last_modified_by': {'key': 'lastModifiedBy', 'type': 'str'}, + 'last_modified_by_type': {'key': 'lastModifiedByType', 'type': 'str'}, + 'last_modified_at': {'key': 'lastModifiedAt', 'type': 'iso-8601'}, + } + + def __init__( + self, + *, + created_by: Optional[str] = None, + created_by_type: Optional[Union[str, "CreatedByType"]] = None, + created_at: Optional[datetime.datetime] = None, + last_modified_by: Optional[str] = None, + last_modified_by_type: Optional[Union[str, "CreatedByType"]] = None, + last_modified_at: Optional[datetime.datetime] = None, + **kwargs + ): + super(SystemData, self).__init__(**kwargs) + self.created_by = created_by + self.created_by_type = created_by_type + self.created_at = created_at + self.last_modified_by = last_modified_by + self.last_modified_by_type = last_modified_by_type + self.last_modified_at = last_modified_at + + +class TrackingInfo(msrest.serialization.Model): + """Tracking courier information. + + :param serial_number: Serial number of the device being tracked. + :type serial_number: str + :param carrier_name: Name of the carrier used in the delivery. + :type carrier_name: str + :param tracking_id: Tracking ID of the shipment. + :type tracking_id: str + :param tracking_url: Tracking URL of the shipment. + :type tracking_url: str + """ + + _attribute_map = { + 'serial_number': {'key': 'serialNumber', 'type': 'str'}, + 'carrier_name': {'key': 'carrierName', 'type': 'str'}, + 'tracking_id': {'key': 'trackingId', 'type': 'str'}, + 'tracking_url': {'key': 'trackingUrl', 'type': 'str'}, + } + + def __init__( + self, + *, + serial_number: Optional[str] = None, + carrier_name: Optional[str] = None, + tracking_id: Optional[str] = None, + tracking_url: Optional[str] = None, + **kwargs + ): + super(TrackingInfo, self).__init__(**kwargs) + self.serial_number = serial_number + self.carrier_name = carrier_name + self.tracking_id = tracking_id + self.tracking_url = tracking_url + + +class TriggerList(msrest.serialization.Model): + """Collection of all trigger on the data box edge device. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar value: The list of triggers. + :vartype value: list[~azure.mgmt.databoxedge.v2021_02_01_preview.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 UpdateDetails(msrest.serialization.Model): + """Update Specific attributes. + + :param update_title: Title of the Update. + :type update_title: str + :param update_size: Size of the update(In Bytes). + :type update_size: float + :param update_type: Type of the Update. Possible values include: "Software", "Kubernetes", + "Firmware". + :type update_type: str or ~azure.mgmt.databoxedge.v2021_02_01_preview.models.UpdateType + :param target_version: Target Version number. + :type target_version: str + :param estimated_install_time_in_mins: Estimated Install Time for the update. + :type estimated_install_time_in_mins: int + :param reboot_behavior: Indicates if updates are available and at least one of the updates + needs a reboot. Possible values include: "NeverReboots", "RequiresReboot", "RequestReboot". + :type reboot_behavior: str or + ~azure.mgmt.databoxedge.v2021_02_01_preview.models.InstallRebootBehavior + :param status: Status of the update. Possible values include: "DownloadPending", + "DownloadStarted", "DownloadCompleted", "InstallStarted", "InstallCompleted". + :type status: str or ~azure.mgmt.databoxedge.v2021_02_01_preview.models.UpdateStatus + """ + + _attribute_map = { + 'update_title': {'key': 'updateTitle', 'type': 'str'}, + 'update_size': {'key': 'updateSize', 'type': 'float'}, + 'update_type': {'key': 'updateType', 'type': 'str'}, + 'target_version': {'key': 'targetVersion', 'type': 'str'}, + 'estimated_install_time_in_mins': {'key': 'estimatedInstallTimeInMins', 'type': 'int'}, + 'reboot_behavior': {'key': 'rebootBehavior', 'type': 'str'}, + 'status': {'key': 'status', 'type': 'str'}, + } + + def __init__( + self, + *, + update_title: Optional[str] = None, + update_size: Optional[float] = None, + update_type: Optional[Union[str, "UpdateType"]] = None, + target_version: Optional[str] = None, + estimated_install_time_in_mins: Optional[int] = None, + reboot_behavior: Optional[Union[str, "InstallRebootBehavior"]] = None, + status: Optional[Union[str, "UpdateStatus"]] = None, + **kwargs + ): + super(UpdateDetails, self).__init__(**kwargs) + self.update_title = update_title + self.update_size = update_size + self.update_type = update_type + self.target_version = target_version + self.estimated_install_time_in_mins = estimated_install_time_in_mins + self.reboot_behavior = reboot_behavior + self.status = status + + +class UpdateDownloadProgress(msrest.serialization.Model): + """Details about the download progress of update. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar download_phase: The download phase. Possible values include: "Unknown", "Initializing", + "Downloading", "Verifying". + :vartype download_phase: str or + ~azure.mgmt.databoxedge.v2021_02_01_preview.models.DownloadPhase + :ivar percent_complete: Percentage of completion. + :vartype percent_complete: int + :ivar total_bytes_to_download: Total bytes to download. + :vartype total_bytes_to_download: float + :ivar total_bytes_downloaded: Total bytes downloaded. + :vartype total_bytes_downloaded: float + :ivar number_of_updates_to_download: Number of updates to download. + :vartype number_of_updates_to_download: int + :ivar number_of_updates_downloaded: Number of updates downloaded. + :vartype number_of_updates_downloaded: int + """ + + _validation = { + 'download_phase': {'readonly': True}, + 'percent_complete': {'readonly': True}, + 'total_bytes_to_download': {'readonly': True}, + 'total_bytes_downloaded': {'readonly': True}, + 'number_of_updates_to_download': {'readonly': True}, + 'number_of_updates_downloaded': {'readonly': True}, + } + + _attribute_map = { + 'download_phase': {'key': 'downloadPhase', 'type': 'str'}, + 'percent_complete': {'key': 'percentComplete', 'type': 'int'}, + 'total_bytes_to_download': {'key': 'totalBytesToDownload', 'type': 'float'}, + 'total_bytes_downloaded': {'key': 'totalBytesDownloaded', 'type': 'float'}, + 'number_of_updates_to_download': {'key': 'numberOfUpdatesToDownload', 'type': 'int'}, + 'number_of_updates_downloaded': {'key': 'numberOfUpdatesDownloaded', 'type': 'int'}, + } + + def __init__( + self, + **kwargs + ): + super(UpdateDownloadProgress, self).__init__(**kwargs) + self.download_phase = None + self.percent_complete = None + self.total_bytes_to_download = None + self.total_bytes_downloaded = None + self.number_of_updates_to_download = None + self.number_of_updates_downloaded = None + + +class UpdateInstallProgress(msrest.serialization.Model): + """Progress details during installation of updates. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar percent_complete: Percentage completed. + :vartype percent_complete: int + :ivar number_of_updates_to_install: Number of updates to install. + :vartype number_of_updates_to_install: int + :ivar number_of_updates_installed: Number of updates installed. + :vartype number_of_updates_installed: int + """ + + _validation = { + 'percent_complete': {'readonly': True}, + 'number_of_updates_to_install': {'readonly': True}, + 'number_of_updates_installed': {'readonly': True}, + } + + _attribute_map = { + 'percent_complete': {'key': 'percentComplete', 'type': 'int'}, + 'number_of_updates_to_install': {'key': 'numberOfUpdatesToInstall', 'type': 'int'}, + 'number_of_updates_installed': {'key': 'numberOfUpdatesInstalled', 'type': 'int'}, + } + + def __init__( + self, + **kwargs + ): + super(UpdateInstallProgress, self).__init__(**kwargs) + self.percent_complete = None + self.number_of_updates_to_install = None + self.number_of_updates_installed = None + + +class UpdateSummary(ARMBaseModel): + """Details about ongoing updates and availability of updates on the device. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: The path ID that uniquely identifies the object. + :vartype id: str + :ivar name: The object name. + :vartype name: str + :ivar type: The hierarchical type of the object. + :vartype type: str + :ivar system_data: UpdateSummary Result. + :vartype system_data: ~azure.mgmt.databoxedge.v2021_02_01_preview.models.SystemData + :param device_version_number: The current version of the device in format: 1.2.17312.13.",. + :type device_version_number: str + :param friendly_device_version_name: The current version of the device in text format. + :type friendly_device_version_name: str + :param device_last_scanned_date_time: The last time when a scan was done on the device. + :type device_last_scanned_date_time: ~datetime.datetime + :param last_completed_scan_job_date_time: The time when the last scan job was completed + (success/cancelled/failed) on the appliance. + :type last_completed_scan_job_date_time: ~datetime.datetime + :ivar last_completed_download_job_date_time: The time when the last Download job was completed + (success/cancelled/failed) on the appliance. + :vartype last_completed_download_job_date_time: ~datetime.datetime + :ivar last_completed_download_job_id: JobId of the last ran download job.(Can be + success/cancelled/failed). + :vartype last_completed_download_job_id: str + :ivar last_download_job_status: JobStatus of the last ran download job. Possible values + include: "Invalid", "Running", "Succeeded", "Failed", "Canceled", "Paused", "Scheduled". + :vartype last_download_job_status: str or + ~azure.mgmt.databoxedge.v2021_02_01_preview.models.JobStatus + :ivar last_completed_install_job_date_time: The time when the last Install job was completed + (success/cancelled/failed) on the appliance. + :vartype last_completed_install_job_date_time: ~datetime.datetime + :ivar last_completed_install_job_id: JobId of the last ran install job.(Can be + success/cancelled/failed). + :vartype last_completed_install_job_id: str + :ivar last_install_job_status: JobStatus of the last ran install job. Possible values include: + "Invalid", "Running", "Succeeded", "Failed", "Canceled", "Paused", "Scheduled". + :vartype last_install_job_status: str or + ~azure.mgmt.databoxedge.v2021_02_01_preview.models.JobStatus + :ivar total_number_of_updates_available: The number of updates available for the current device + version as per the last device scan. + :vartype total_number_of_updates_available: int + :ivar total_number_of_updates_pending_download: The total number of items pending download. + :vartype total_number_of_updates_pending_download: int + :ivar total_number_of_updates_pending_install: The total number of items pending install. + :vartype total_number_of_updates_pending_install: int + :ivar reboot_behavior: Indicates if updates are available and at least one of the updates needs + a reboot. Possible values include: "NeverReboots", "RequiresReboot", "RequestReboot". + :vartype reboot_behavior: str or + ~azure.mgmt.databoxedge.v2021_02_01_preview.models.InstallRebootBehavior + :ivar ongoing_update_operation: The current update operation. Possible values include: "None", + "Scan", "Download", "Install". + :vartype ongoing_update_operation: str or + ~azure.mgmt.databoxedge.v2021_02_01_preview.models.UpdateOperation + :ivar in_progress_download_job_id: The job ID of the download job in progress. + :vartype in_progress_download_job_id: str + :ivar in_progress_install_job_id: The job ID of the install job in progress. + :vartype in_progress_install_job_id: str + :ivar in_progress_download_job_started_date_time: The time when the currently running download + (if any) started. + :vartype in_progress_download_job_started_date_time: ~datetime.datetime + :ivar in_progress_install_job_started_date_time: The time when the currently running install + (if any) started. + :vartype in_progress_install_job_started_date_time: ~datetime.datetime + :ivar update_titles: The list of updates available for install. + :vartype update_titles: list[str] + :ivar updates: The list of updates available for install. + :vartype updates: list[~azure.mgmt.databoxedge.v2021_02_01_preview.models.UpdateDetails] + :ivar total_update_size_in_bytes: The total size of updates available for download in bytes. + :vartype total_update_size_in_bytes: float + :ivar total_time_in_minutes: The total time in Minutes. + :vartype total_time_in_minutes: int + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'system_data': {'readonly': True}, + 'last_completed_download_job_date_time': {'readonly': True}, + 'last_completed_download_job_id': {'readonly': True}, + 'last_download_job_status': {'readonly': True}, + 'last_completed_install_job_date_time': {'readonly': True}, + 'last_completed_install_job_id': {'readonly': True}, + 'last_install_job_status': {'readonly': True}, + 'total_number_of_updates_available': {'readonly': True}, + 'total_number_of_updates_pending_download': {'readonly': True}, + 'total_number_of_updates_pending_install': {'readonly': True}, + 'reboot_behavior': {'readonly': True}, + 'ongoing_update_operation': {'readonly': True}, + 'in_progress_download_job_id': {'readonly': True}, + 'in_progress_install_job_id': {'readonly': True}, + 'in_progress_download_job_started_date_time': {'readonly': True}, + 'in_progress_install_job_started_date_time': {'readonly': True}, + 'update_titles': {'readonly': True}, + 'updates': {'readonly': True}, + 'total_update_size_in_bytes': {'readonly': True}, + 'total_time_in_minutes': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'device_version_number': {'key': 'properties.deviceVersionNumber', 'type': 'str'}, + 'friendly_device_version_name': {'key': 'properties.friendlyDeviceVersionName', 'type': 'str'}, + 'device_last_scanned_date_time': {'key': 'properties.deviceLastScannedDateTime', 'type': 'iso-8601'}, + 'last_completed_scan_job_date_time': {'key': 'properties.lastCompletedScanJobDateTime', 'type': 'iso-8601'}, + 'last_completed_download_job_date_time': {'key': 'properties.lastCompletedDownloadJobDateTime', 'type': 'iso-8601'}, + 'last_completed_download_job_id': {'key': 'properties.lastCompletedDownloadJobId', 'type': 'str'}, + 'last_download_job_status': {'key': 'properties.lastDownloadJobStatus', 'type': 'str'}, + 'last_completed_install_job_date_time': {'key': 'properties.lastCompletedInstallJobDateTime', 'type': 'iso-8601'}, + 'last_completed_install_job_id': {'key': 'properties.lastCompletedInstallJobId', 'type': 'str'}, + 'last_install_job_status': {'key': 'properties.lastInstallJobStatus', 'type': 'str'}, + 'total_number_of_updates_available': {'key': 'properties.totalNumberOfUpdatesAvailable', 'type': 'int'}, + 'total_number_of_updates_pending_download': {'key': 'properties.totalNumberOfUpdatesPendingDownload', 'type': 'int'}, + 'total_number_of_updates_pending_install': {'key': 'properties.totalNumberOfUpdatesPendingInstall', 'type': 'int'}, + 'reboot_behavior': {'key': 'properties.rebootBehavior', 'type': 'str'}, + 'ongoing_update_operation': {'key': 'properties.ongoingUpdateOperation', 'type': 'str'}, + 'in_progress_download_job_id': {'key': 'properties.inProgressDownloadJobId', 'type': 'str'}, + 'in_progress_install_job_id': {'key': 'properties.inProgressInstallJobId', 'type': 'str'}, + 'in_progress_download_job_started_date_time': {'key': 'properties.inProgressDownloadJobStartedDateTime', 'type': 'iso-8601'}, + 'in_progress_install_job_started_date_time': {'key': 'properties.inProgressInstallJobStartedDateTime', 'type': 'iso-8601'}, + 'update_titles': {'key': 'properties.updateTitles', 'type': '[str]'}, + 'updates': {'key': 'properties.updates', 'type': '[UpdateDetails]'}, + 'total_update_size_in_bytes': {'key': 'properties.totalUpdateSizeInBytes', 'type': 'float'}, + 'total_time_in_minutes': {'key': 'properties.totalTimeInMinutes', 'type': 'int'}, + } + + def __init__( + self, + *, + device_version_number: Optional[str] = None, + friendly_device_version_name: Optional[str] = None, + device_last_scanned_date_time: Optional[datetime.datetime] = None, + last_completed_scan_job_date_time: Optional[datetime.datetime] = None, + **kwargs + ): + super(UpdateSummary, self).__init__(**kwargs) + self.system_data = None + self.device_version_number = device_version_number + self.friendly_device_version_name = friendly_device_version_name + self.device_last_scanned_date_time = device_last_scanned_date_time + self.last_completed_scan_job_date_time = last_completed_scan_job_date_time + self.last_completed_download_job_date_time = None + self.last_completed_download_job_id = None + self.last_download_job_status = None + self.last_completed_install_job_date_time = None + self.last_completed_install_job_id = None + self.last_install_job_status = None + self.total_number_of_updates_available = None + self.total_number_of_updates_pending_download = None + self.total_number_of_updates_pending_install = None + self.reboot_behavior = None + self.ongoing_update_operation = None + self.in_progress_download_job_id = None + self.in_progress_install_job_id = None + self.in_progress_download_job_started_date_time = None + self.in_progress_install_job_started_date_time = None + self.update_titles = None + self.updates = None + self.total_update_size_in_bytes = None + self.total_time_in_minutes = None + + +class UploadCertificateRequest(msrest.serialization.Model): + """The upload certificate request. + + All required parameters must be populated in order to send to Azure. + + :param authentication_type: The authentication type. Possible values include: "Invalid", + "AzureActiveDirectory". + :type authentication_type: str or + ~azure.mgmt.databoxedge.v2021_02_01_preview.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 ~azure.mgmt.databoxedge.v2021_02_01_preview.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. + + :ivar id: The path ID that uniquely identifies the object. + :vartype id: str + :ivar name: The object name. + :vartype name: str + :ivar type: The hierarchical type of the object. + :vartype type: str + :ivar system_data: User in DataBoxEdge Resource. + :vartype system_data: ~azure.mgmt.databoxedge.v2021_02_01_preview.models.SystemData + :param encrypted_password: The password details. + :type encrypted_password: + ~azure.mgmt.databoxedge.v2021_02_01_preview.models.AsymmetricEncryptedSecret + :ivar share_access_rights: List of shares that the user has rights on. This field should not be + specified during user creation. + :vartype share_access_rights: + list[~azure.mgmt.databoxedge.v2021_02_01_preview.models.ShareAccessRight] + :param user_type: Type of the user. Possible values include: "Share", "LocalManagement", "ARM". + :type user_type: str or ~azure.mgmt.databoxedge.v2021_02_01_preview.models.UserType + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'system_data': {'readonly': True}, + 'share_access_rights': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + '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, + *, + encrypted_password: Optional["AsymmetricEncryptedSecret"] = None, + user_type: Optional[Union[str, "UserType"]] = None, + **kwargs + ): + super(User, self).__init__(**kwargs) + self.system_data = None + self.encrypted_password = encrypted_password + self.share_access_rights = None + self.user_type = user_type + + +class UserAccessRight(msrest.serialization.Model): + """The mapping between a particular user and the access type on the SMB share. + + All required parameters must be populated in order to send to Azure. + + :param user_id: Required. User ID (already existing in the device). + :type user_id: str + :param access_type: Required. Type of access to be allowed for the user. Possible values + include: "Change", "Read", "Custom". + :type access_type: str or ~azure.mgmt.databoxedge.v2021_02_01_preview.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[~azure.mgmt.databoxedge.v2021_02_01_preview.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/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2021_02_01_preview/operations/__init__.py b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2021_02_01_preview/operations/__init__.py new file mode 100644 index 000000000000..d70057be6458 --- /dev/null +++ b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2021_02_01_preview/operations/__init__.py @@ -0,0 +1,47 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from ._operations import Operations +from ._available_skus_operations import AvailableSkusOperations +from ._devices_operations import DevicesOperations +from ._alerts_operations import AlertsOperations +from ._bandwidth_schedules_operations import BandwidthSchedulesOperations +from ._jobs_operations import JobsOperations +from ._nodes_operations import NodesOperations +from ._operations_status_operations import OperationsStatusOperations +from ._orders_operations import OrdersOperations +from ._roles_operations import RolesOperations +from ._addons_operations import AddonsOperations +from ._monitoring_config_operations import MonitoringConfigOperations +from ._shares_operations import SharesOperations +from ._storage_account_credentials_operations import StorageAccountCredentialsOperations +from ._storage_accounts_operations import StorageAccountsOperations +from ._containers_operations import ContainersOperations +from ._triggers_operations import TriggersOperations +from ._users_operations import UsersOperations + +__all__ = [ + 'Operations', + 'AvailableSkusOperations', + 'DevicesOperations', + 'AlertsOperations', + 'BandwidthSchedulesOperations', + 'JobsOperations', + 'NodesOperations', + 'OperationsStatusOperations', + 'OrdersOperations', + 'RolesOperations', + 'AddonsOperations', + 'MonitoringConfigOperations', + 'SharesOperations', + 'StorageAccountCredentialsOperations', + 'StorageAccountsOperations', + 'ContainersOperations', + 'TriggersOperations', + 'UsersOperations', +] diff --git a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2021_02_01_preview/operations/_addons_operations.py b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2021_02_01_preview/operations/_addons_operations.py new file mode 100644 index 000000000000..2c92a13640b4 --- /dev/null +++ b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2021_02_01_preview/operations/_addons_operations.py @@ -0,0 +1,460 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.core.polling import LROPoller, NoPolling, PollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.arm_polling import ARMPolling + +from .. import models as _models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class AddonsOperations(object): + """AddonsOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.databoxedge.v2021_02_01_preview.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list_by_role( + self, + device_name, # type: str + role_name, # type: str + resource_group_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.AddonList"] + """Lists all the addons configured in the role. + + :param device_name: The device name. + :type device_name: str + :param role_name: The role name. + :type role_name: str + :param resource_group_name: The resource group name. + :type resource_group_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either AddonList or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.databoxedge.v2021_02_01_preview.models.AddonList] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.AddonList"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01-preview" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_by_role.metadata['url'] # type: ignore + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'roleName': self._serialize.url("role_name", role_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('AddonList', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_by_role.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/roles/{roleName}/addons'} # type: ignore + + def get( + self, + device_name, # type: str + role_name, # type: str + addon_name, # type: str + resource_group_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.Addon" + """Gets a specific addon by name. + + :param device_name: The device name. + :type device_name: str + :param role_name: The role name. + :type role_name: str + :param addon_name: The addon name. + :type addon_name: str + :param resource_group_name: The resource group name. + :type resource_group_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: Addon, or the result of cls(response) + :rtype: ~azure.mgmt.databoxedge.v2021_02_01_preview.models.Addon + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.Addon"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01-preview" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'roleName': self._serialize.url("role_name", role_name, 'str'), + 'addonName': self._serialize.url("addon_name", addon_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('Addon', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/roles/{roleName}/addons/{addonName}'} # type: ignore + + def _create_or_update_initial( + self, + device_name, # type: str + role_name, # type: str + addon_name, # type: str + resource_group_name, # type: str + addon, # type: "_models.Addon" + **kwargs # type: Any + ): + # type: (...) -> Optional["_models.Addon"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.Addon"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01-preview" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._create_or_update_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'roleName': self._serialize.url("role_name", role_name, 'str'), + 'addonName': self._serialize.url("addon_name", addon_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(addon, 'Addon') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('Addon', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/roles/{roleName}/addons/{addonName}'} # type: ignore + + def begin_create_or_update( + self, + device_name, # type: str + role_name, # type: str + addon_name, # type: str + resource_group_name, # type: str + addon, # type: "_models.Addon" + **kwargs # type: Any + ): + # type: (...) -> LROPoller["_models.Addon"] + """Create or update a addon. + + :param device_name: The device name. + :type device_name: str + :param role_name: The role name. + :type role_name: str + :param addon_name: The addon name. + :type addon_name: str + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param addon: The addon properties. + :type addon: ~azure.mgmt.databoxedge.v2021_02_01_preview.models.Addon + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: Pass in True if you'd like the ARMPolling polling method, + False for no polling, or your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either Addon or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.databoxedge.v2021_02_01_preview.models.Addon] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Addon"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._create_or_update_initial( + device_name=device_name, + role_name=role_name, + addon_name=addon_name, + resource_group_name=resource_group_name, + addon=addon, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('Addon', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'roleName': self._serialize.url("role_name", role_name, 'str'), + 'addonName': self._serialize.url("addon_name", addon_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/roles/{roleName}/addons/{addonName}'} # type: ignore + + def _delete_initial( + self, + device_name, # type: str + role_name, # type: str + addon_name, # type: str + resource_group_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01-preview" + accept = "application/json" + + # Construct URL + url = self._delete_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'roleName': self._serialize.url("role_name", role_name, 'str'), + 'addonName': self._serialize.url("addon_name", addon_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/roles/{roleName}/addons/{addonName}'} # type: ignore + + def begin_delete( + self, + device_name, # type: str + role_name, # type: str + addon_name, # type: str + resource_group_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> LROPoller[None] + """Deletes the addon on the device. + + :param device_name: The device name. + :type device_name: str + :param role_name: The role name. + :type role_name: str + :param addon_name: The addon name. + :type addon_name: str + :param resource_group_name: The resource group name. + :type resource_group_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: Pass in True if you'd like the ARMPolling polling method, + False for no polling, or your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._delete_initial( + device_name=device_name, + role_name=role_name, + addon_name=addon_name, + resource_group_name=resource_group_name, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'roleName': self._serialize.url("role_name", role_name, 'str'), + 'addonName': self._serialize.url("addon_name", addon_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/roles/{roleName}/addons/{addonName}'} # type: ignore diff --git a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2021_02_01_preview/operations/_alerts_operations.py b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2021_02_01_preview/operations/_alerts_operations.py new file mode 100644 index 000000000000..aa5e57d65099 --- /dev/null +++ b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2021_02_01_preview/operations/_alerts_operations.py @@ -0,0 +1,186 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.mgmt.core.exceptions import ARMErrorFormat + +from .. import models as _models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class AlertsOperations(object): + """AlertsOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.databoxedge.v2021_02_01_preview.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[~azure.mgmt.databoxedge.v2021_02_01_preview.models.AlertList] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.AlertList"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01-preview" + 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: ~azure.mgmt.databoxedge.v2021_02_01_preview.models.Alert + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.Alert"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01-preview" + 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/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2021_02_01_preview/operations/_available_skus_operations.py b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2021_02_01_preview/operations/_available_skus_operations.py new file mode 100644 index 000000000000..33646794cd4a --- /dev/null +++ b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2021_02_01_preview/operations/_available_skus_operations.py @@ -0,0 +1,115 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.mgmt.core.exceptions import ARMErrorFormat + +from .. import models as _models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class AvailableSkusOperations(object): + """AvailableSkusOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.databoxedge.v2021_02_01_preview.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list( + self, + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.DataBoxEdgeSkuList"] + """List all the available Skus and information related to them. + + List all the available Skus and information related to them. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either DataBoxEdgeSkuList or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.databoxedge.v2021_02_01_preview.models.DataBoxEdgeSkuList] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.DataBoxEdgeSkuList"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01-preview" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('DataBoxEdgeSkuList', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.DataBoxEdge/availableSkus'} # type: ignore diff --git a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2021_02_01_preview/operations/_bandwidth_schedules_operations.py b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2021_02_01_preview/operations/_bandwidth_schedules_operations.py new file mode 100644 index 000000000000..3d4f49fbe32a --- /dev/null +++ b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2021_02_01_preview/operations/_bandwidth_schedules_operations.py @@ -0,0 +1,438 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.core.polling import LROPoller, NoPolling, PollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.arm_polling import ARMPolling + +from .. import models as _models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class BandwidthSchedulesOperations(object): + """BandwidthSchedulesOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.databoxedge.v2021_02_01_preview.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[~azure.mgmt.databoxedge.v2021_02_01_preview.models.BandwidthSchedulesList] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.BandwidthSchedulesList"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01-preview" + 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: ~azure.mgmt.databoxedge.v2021_02_01_preview.models.BandwidthSchedule + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.BandwidthSchedule"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01-preview" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('BandwidthSchedule', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/bandwidthSchedules/{name}'} # type: ignore + + def _create_or_update_initial( + self, + device_name, # type: str + name, # type: str + resource_group_name, # type: str + parameters, # type: "_models.BandwidthSchedule" + **kwargs # type: Any + ): + # type: (...) -> Optional["_models.BandwidthSchedule"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.BandwidthSchedule"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01-preview" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._create_or_update_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, 'BandwidthSchedule') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('BandwidthSchedule', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/bandwidthSchedules/{name}'} # type: ignore + + def begin_create_or_update( + self, + device_name, # type: str + name, # type: str + resource_group_name, # type: str + parameters, # type: "_models.BandwidthSchedule" + **kwargs # type: Any + ): + # type: (...) -> LROPoller["_models.BandwidthSchedule"] + """Creates or updates a bandwidth schedule. + + :param device_name: The device name. + :type device_name: str + :param name: The bandwidth schedule name which needs to be added/updated. + :type name: str + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param parameters: The bandwidth schedule to be added or updated. + :type parameters: ~azure.mgmt.databoxedge.v2021_02_01_preview.models.BandwidthSchedule + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: Pass in True if you'd like the ARMPolling polling method, + False for no polling, or your own initialized polling object for a 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[~azure.mgmt.databoxedge.v2021_02_01_preview.models.BandwidthSchedule] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.BandwidthSchedule"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._create_or_update_initial( + device_name=device_name, + name=name, + resource_group_name=resource_group_name, + parameters=parameters, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('BandwidthSchedule', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/bandwidthSchedules/{name}'} # type: ignore + + def _delete_initial( + self, + device_name, # type: str + name, # type: str + resource_group_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01-preview" + 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: Pass in True if you'd like the ARMPolling polling method, + False for no polling, or your own initialized polling object for a 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/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2021_02_01_preview/operations/_containers_operations.py b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2021_02_01_preview/operations/_containers_operations.py new file mode 100644 index 000000000000..82bffe37fd93 --- /dev/null +++ b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2021_02_01_preview/operations/_containers_operations.py @@ -0,0 +1,592 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.core.polling import LROPoller, NoPolling, PollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.arm_polling import ARMPolling + +from .. import models as _models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class ContainersOperations(object): + """ContainersOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.databoxedge.v2021_02_01_preview.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[~azure.mgmt.databoxedge.v2021_02_01_preview.models.ContainerList] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ContainerList"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01-preview" + 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: ~azure.mgmt.databoxedge.v2021_02_01_preview.models.Container + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.Container"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01-preview" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'storageAccountName': self._serialize.url("storage_account_name", storage_account_name, 'str'), + 'containerName': self._serialize.url("container_name", container_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('Container', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/storageAccounts/{storageAccountName}/containers/{containerName}'} # type: ignore + + def _create_or_update_initial( + self, + device_name, # type: str + storage_account_name, # type: str + container_name, # type: str + resource_group_name, # type: str + container, # type: "_models.Container" + **kwargs # type: Any + ): + # type: (...) -> Optional["_models.Container"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.Container"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01-preview" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._create_or_update_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'storageAccountName': self._serialize.url("storage_account_name", storage_account_name, 'str'), + 'containerName': self._serialize.url("container_name", container_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(container, 'Container') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('Container', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/storageAccounts/{storageAccountName}/containers/{containerName}'} # type: ignore + + def begin_create_or_update( + self, + device_name, # type: str + storage_account_name, # type: str + container_name, # type: str + resource_group_name, # type: str + container, # type: "_models.Container" + **kwargs # type: Any + ): + # type: (...) -> LROPoller["_models.Container"] + """Creates a new container or updates an existing container on the device. + + Creates a new container or updates an existing container on the device. + + :param device_name: The device name. + :type device_name: str + :param storage_account_name: The Storage Account Name. + :type storage_account_name: str + :param container_name: The container name. + :type container_name: str + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param container: The container properties. + :type container: ~azure.mgmt.databoxedge.v2021_02_01_preview.models.Container + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: Pass in True if you'd like the ARMPolling polling method, + False for no polling, or your own initialized polling object for a 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[~azure.mgmt.databoxedge.v2021_02_01_preview.models.Container] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Container"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._create_or_update_initial( + device_name=device_name, + storage_account_name=storage_account_name, + container_name=container_name, + resource_group_name=resource_group_name, + container=container, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('Container', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'storageAccountName': self._serialize.url("storage_account_name", storage_account_name, 'str'), + 'containerName': self._serialize.url("container_name", container_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/storageAccounts/{storageAccountName}/containers/{containerName}'} # type: ignore + + def _delete_initial( + self, + device_name, # type: str + storage_account_name, # type: str + container_name, # type: str + resource_group_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01-preview" + 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: Pass in True if you'd like the ARMPolling polling method, + False for no polling, or your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._delete_initial( + device_name=device_name, + storage_account_name=storage_account_name, + container_name=container_name, + resource_group_name=resource_group_name, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'storageAccountName': self._serialize.url("storage_account_name", storage_account_name, 'str'), + 'containerName': self._serialize.url("container_name", container_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/storageAccounts/{storageAccountName}/containers/{containerName}'} # type: ignore + + def _refresh_initial( + self, + device_name, # type: str + storage_account_name, # type: str + container_name, # type: str + resource_group_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01-preview" + 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: Pass in True if you'd like the ARMPolling polling method, + False for no polling, or your own initialized polling object for a 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/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2021_02_01_preview/operations/_devices_operations.py b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2021_02_01_preview/operations/_devices_operations.py new file mode 100644 index 000000000000..bbb4d75c968e --- /dev/null +++ b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2021_02_01_preview/operations/_devices_operations.py @@ -0,0 +1,1389 @@ +# 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 as _models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class DevicesOperations(object): + """DevicesOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.databoxedge.v2021_02_01_preview.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[~azure.mgmt.databoxedge.v2021_02_01_preview.models.DataBoxEdgeDeviceList] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.DataBoxEdgeDeviceList"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01-preview" + 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[~azure.mgmt.databoxedge.v2021_02_01_preview.models.DataBoxEdgeDeviceList] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.DataBoxEdgeDeviceList"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01-preview" + 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: ~azure.mgmt.databoxedge.v2021_02_01_preview.models.DataBoxEdgeDevice + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.DataBoxEdgeDevice"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01-preview" + 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 + data_box_edge_device, # type: "_models.DataBoxEdgeDevice" + **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', {})) + api_version = "2021-02-01-preview" + 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 + data_box_edge_device, # type: "_models.DataBoxEdgeDevice" + **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 data_box_edge_device: The resource object. + :type data_box_edge_device: ~azure.mgmt.databoxedge.v2021_02_01_preview.models.DataBoxEdgeDevice + :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: Pass in True if you'd like the ARMPolling polling method, + False for no polling, or your own initialized polling object for a 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[~azure.mgmt.databoxedge.v2021_02_01_preview.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, + data_box_edge_device=data_box_edge_device, + 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 = "2021-02-01-preview" + 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: Pass in True if you'd like the ARMPolling polling method, + False for no polling, or your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._delete_initial( + device_name=device_name, + resource_group_name=resource_group_name, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}'} # type: ignore + + def update( + self, + device_name, # type: str + resource_group_name, # type: str + parameters, # type: "_models.DataBoxEdgeDevicePatch" + **kwargs # type: Any + ): + # type: (...) -> "_models.DataBoxEdgeDevice" + """Modifies a Data Box Edge/Data Box Gateway resource. + + :param device_name: The device name. + :type device_name: str + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param parameters: The resource parameters. + :type parameters: ~azure.mgmt.databoxedge.v2021_02_01_preview.models.DataBoxEdgeDevicePatch + :keyword callable cls: A custom type or function that will be passed the direct response + :return: DataBoxEdgeDevice, or the result of cls(response) + :rtype: ~azure.mgmt.databoxedge.v2021_02_01_preview.models.DataBoxEdgeDevice + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.DataBoxEdgeDevice"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01-preview" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update.metadata['url'] # type: ignore + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, 'DataBoxEdgeDevicePatch') + body_content_kwargs['content'] = body_content + request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('DataBoxEdgeDevice', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}'} # type: ignore + + def _download_updates_initial( + self, + device_name, # type: str + resource_group_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01-preview" + accept = "application/json" + + # Construct URL + url = self._download_updates_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _download_updates_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/downloadUpdates'} # type: ignore + + def begin_download_updates( + self, + device_name, # type: str + resource_group_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> LROPoller[None] + """Downloads the updates on a Data Box Edge/Data Box Gateway device. + + Downloads the updates on a Data Box Edge/Data Box Gateway device. + + :param device_name: The device name. + :type device_name: str + :param resource_group_name: The resource group name. + :type resource_group_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: Pass in True if you'd like the ARMPolling polling method, + False for no polling, or your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._download_updates_initial( + device_name=device_name, + resource_group_name=resource_group_name, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_download_updates.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/downloadUpdates'} # type: ignore + + def generate_certificate( + self, + device_name, # type: str + resource_group_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.GenerateCertResponse" + """Generates certificate for activation key. + + :param device_name: The device name. + :type device_name: str + :param resource_group_name: The resource group name. + :type resource_group_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: GenerateCertResponse, or the result of cls(response) + :rtype: ~azure.mgmt.databoxedge.v2021_02_01_preview.models.GenerateCertResponse + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.GenerateCertResponse"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01-preview" + accept = "application/json" + + # Construct URL + url = self.generate_certificate.metadata['url'] # type: ignore + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('GenerateCertResponse', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + generate_certificate.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/generateCertificate'} # type: ignore + + def get_extended_information( + self, + device_name, # type: str + resource_group_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.DataBoxEdgeDeviceExtendedInfo" + """Gets additional information for the specified Azure Stack Edge/Data Box Gateway device. + + :param device_name: The device name. + :type device_name: str + :param resource_group_name: The resource group name. + :type resource_group_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: DataBoxEdgeDeviceExtendedInfo, or the result of cls(response) + :rtype: ~azure.mgmt.databoxedge.v2021_02_01_preview.models.DataBoxEdgeDeviceExtendedInfo + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.DataBoxEdgeDeviceExtendedInfo"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01-preview" + accept = "application/json" + + # Construct URL + url = self.get_extended_information.metadata['url'] # type: ignore + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('DataBoxEdgeDeviceExtendedInfo', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_extended_information.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/getExtendedInformation'} # type: ignore + + def _install_updates_initial( + self, + device_name, # type: str + resource_group_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01-preview" + accept = "application/json" + + # Construct URL + url = self._install_updates_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _install_updates_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/installUpdates'} # type: ignore + + def begin_install_updates( + self, + device_name, # type: str + resource_group_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> LROPoller[None] + """Installs the updates on the Data Box Edge/Data Box Gateway device. + + Installs the updates on the Data Box Edge/Data Box Gateway device. + + :param device_name: The device name. + :type device_name: str + :param resource_group_name: The resource group name. + :type resource_group_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: Pass in True if you'd like the ARMPolling polling method, + False for no polling, or your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._install_updates_initial( + device_name=device_name, + resource_group_name=resource_group_name, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_install_updates.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/installUpdates'} # type: ignore + + def get_network_settings( + self, + device_name, # type: str + resource_group_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.NetworkSettings" + """Gets the network settings of the specified Data Box Edge/Data Box Gateway device. + + :param device_name: The device name. + :type device_name: str + :param resource_group_name: The resource group name. + :type resource_group_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: NetworkSettings, or the result of cls(response) + :rtype: ~azure.mgmt.databoxedge.v2021_02_01_preview.models.NetworkSettings + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkSettings"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01-preview" + accept = "application/json" + + # Construct URL + url = self.get_network_settings.metadata['url'] # type: ignore + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('NetworkSettings', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_network_settings.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/networkSettings/default'} # type: ignore + + def _scan_for_updates_initial( + self, + device_name, # type: str + resource_group_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01-preview" + accept = "application/json" + + # Construct URL + url = self._scan_for_updates_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _scan_for_updates_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/scanForUpdates'} # type: ignore + + def begin_scan_for_updates( + self, + device_name, # type: str + resource_group_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> LROPoller[None] + """Scans for updates on a Data Box Edge/Data Box Gateway device. + + Scans for updates on a Data Box Edge/Data Box Gateway device. + + :param device_name: The device name. + :type device_name: str + :param resource_group_name: The resource group name. + :type resource_group_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: Pass in True if you'd like the ARMPolling polling method, + False for no polling, or your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._scan_for_updates_initial( + device_name=device_name, + resource_group_name=resource_group_name, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_scan_for_updates.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/scanForUpdates'} # type: ignore + + def _create_or_update_security_settings_initial( + self, + device_name, # type: str + resource_group_name, # type: str + security_settings, # type: "_models.SecuritySettings" + **kwargs # type: Any + ): + # type: (...) -> None + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01-preview" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._create_or_update_security_settings_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(security_settings, 'SecuritySettings') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _create_or_update_security_settings_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/securitySettings/default/update'} # type: ignore + + def begin_create_or_update_security_settings( + self, + device_name, # type: str + resource_group_name, # type: str + security_settings, # type: "_models.SecuritySettings" + **kwargs # type: Any + ): + # type: (...) -> LROPoller[None] + """Updates the security settings on a Data Box Edge/Data Box Gateway device. + + :param device_name: The device name. + :type device_name: str + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param security_settings: The security settings. + :type security_settings: ~azure.mgmt.databoxedge.v2021_02_01_preview.models.SecuritySettings + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: Pass in True if you'd like the ARMPolling polling method, + False for no polling, or your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._create_or_update_security_settings_initial( + device_name=device_name, + resource_group_name=resource_group_name, + security_settings=security_settings, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create_or_update_security_settings.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/securitySettings/default/update'} # type: ignore + + def update_extended_information( + self, + device_name, # type: str + resource_group_name, # type: str + parameters, # type: "_models.DataBoxEdgeDeviceExtendedInfoPatch" + **kwargs # type: Any + ): + # type: (...) -> "_models.DataBoxEdgeDeviceExtendedInfo" + """Gets additional information for the specified Data Box Edge/Data Box Gateway device. + + :param device_name: The device name. + :type device_name: str + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param parameters: The patch object. + :type parameters: ~azure.mgmt.databoxedge.v2021_02_01_preview.models.DataBoxEdgeDeviceExtendedInfoPatch + :keyword callable cls: A custom type or function that will be passed the direct response + :return: DataBoxEdgeDeviceExtendedInfo, or the result of cls(response) + :rtype: ~azure.mgmt.databoxedge.v2021_02_01_preview.models.DataBoxEdgeDeviceExtendedInfo + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.DataBoxEdgeDeviceExtendedInfo"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01-preview" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update_extended_information.metadata['url'] # type: ignore + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, 'DataBoxEdgeDeviceExtendedInfoPatch') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('DataBoxEdgeDeviceExtendedInfo', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update_extended_information.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/updateExtendedInformation'} # type: ignore + + def get_update_summary( + self, + device_name, # type: str + resource_group_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.UpdateSummary" + """Gets information about the availability of updates based on the last scan of the device. It also gets information about any ongoing download or install jobs on the device. + + Gets information about the availability of updates based on the last scan of the device. It + also gets information about any ongoing download or install jobs on the device. + + :param device_name: The device name. + :type device_name: str + :param resource_group_name: The resource group name. + :type resource_group_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: UpdateSummary, or the result of cls(response) + :rtype: ~azure.mgmt.databoxedge.v2021_02_01_preview.models.UpdateSummary + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.UpdateSummary"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01-preview" + accept = "application/json" + + # Construct URL + url = self.get_update_summary.metadata['url'] # type: ignore + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('UpdateSummary', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_update_summary.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/updateSummary/default'} # type: ignore + + def upload_certificate( + self, + device_name, # type: str + resource_group_name, # type: str + parameters, # type: "_models.UploadCertificateRequest" + **kwargs # type: Any + ): + # type: (...) -> "_models.UploadCertificateResponse" + """Uploads registration certificate for the device. + + :param device_name: The device name. + :type device_name: str + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param parameters: The upload certificate request. + :type parameters: ~azure.mgmt.databoxedge.v2021_02_01_preview.models.UploadCertificateRequest + :keyword callable cls: A custom type or function that will be passed the direct response + :return: UploadCertificateResponse, or the result of cls(response) + :rtype: ~azure.mgmt.databoxedge.v2021_02_01_preview.models.UploadCertificateResponse + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.UploadCertificateResponse"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01-preview" + 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/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2021_02_01_preview/operations/_jobs_operations.py b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2021_02_01_preview/operations/_jobs_operations.py new file mode 100644 index 000000000000..1fa2b0e1ad23 --- /dev/null +++ b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2021_02_01_preview/operations/_jobs_operations.py @@ -0,0 +1,110 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.mgmt.core.exceptions import ARMErrorFormat + +from .. import models as _models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Optional, TypeVar + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class JobsOperations(object): + """JobsOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.databoxedge.v2021_02_01_preview.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: ~azure.mgmt.databoxedge.v2021_02_01_preview.models.Job + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.Job"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01-preview" + 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/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2021_02_01_preview/operations/_monitoring_config_operations.py b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2021_02_01_preview/operations/_monitoring_config_operations.py new file mode 100644 index 000000000000..dc3a756ee375 --- /dev/null +++ b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2021_02_01_preview/operations/_monitoring_config_operations.py @@ -0,0 +1,450 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.core.polling import LROPoller, NoPolling, PollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.arm_polling import ARMPolling + +from .. import models as _models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class MonitoringConfigOperations(object): + """MonitoringConfigOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.databoxedge.v2021_02_01_preview.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list( + self, + device_name, # type: str + role_name, # type: str + resource_group_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.MonitoringMetricConfigurationList"] + """Lists metric configurations in a role. + + Lists metric configurations in a role. + + :param device_name: The device name. + :type device_name: str + :param role_name: The role name. + :type role_name: str + :param resource_group_name: The resource group name. + :type resource_group_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either MonitoringMetricConfigurationList or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.databoxedge.v2021_02_01_preview.models.MonitoringMetricConfigurationList] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.MonitoringMetricConfigurationList"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01-preview" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list.metadata['url'] # type: ignore + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'roleName': self._serialize.url("role_name", role_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('MonitoringMetricConfigurationList', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/roles/{roleName}/monitoringConfig'} # type: ignore + + def get( + self, + device_name, # type: str + role_name, # type: str + resource_group_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.MonitoringMetricConfiguration" + """Gets a metric configuration of a role. + + Gets a metric configuration of a role. + + :param device_name: The device name. + :type device_name: str + :param role_name: The role name. + :type role_name: str + :param resource_group_name: The resource group name. + :type resource_group_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: MonitoringMetricConfiguration, or the result of cls(response) + :rtype: ~azure.mgmt.databoxedge.v2021_02_01_preview.models.MonitoringMetricConfiguration + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.MonitoringMetricConfiguration"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01-preview" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'roleName': self._serialize.url("role_name", role_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('MonitoringMetricConfiguration', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/roles/{roleName}/monitoringConfig/default'} # type: ignore + + def _create_or_update_initial( + self, + device_name, # type: str + role_name, # type: str + resource_group_name, # type: str + monitoring_metric_configuration, # type: "_models.MonitoringMetricConfiguration" + **kwargs # type: Any + ): + # type: (...) -> Optional["_models.MonitoringMetricConfiguration"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.MonitoringMetricConfiguration"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01-preview" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._create_or_update_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'roleName': self._serialize.url("role_name", role_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(monitoring_metric_configuration, 'MonitoringMetricConfiguration') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('MonitoringMetricConfiguration', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/roles/{roleName}/monitoringConfig/default'} # type: ignore + + def begin_create_or_update( + self, + device_name, # type: str + role_name, # type: str + resource_group_name, # type: str + monitoring_metric_configuration, # type: "_models.MonitoringMetricConfiguration" + **kwargs # type: Any + ): + # type: (...) -> LROPoller["_models.MonitoringMetricConfiguration"] + """Creates a new metric configuration or updates an existing one for a role. + + Creates a new metric configuration or updates an existing one for a role. + + :param device_name: The device name. + :type device_name: str + :param role_name: The role name. + :type role_name: str + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param monitoring_metric_configuration: The metric configuration. + :type monitoring_metric_configuration: ~azure.mgmt.databoxedge.v2021_02_01_preview.models.MonitoringMetricConfiguration + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: Pass in True if you'd like the ARMPolling polling method, + False for no polling, or your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either MonitoringMetricConfiguration or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.databoxedge.v2021_02_01_preview.models.MonitoringMetricConfiguration] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.MonitoringMetricConfiguration"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._create_or_update_initial( + device_name=device_name, + role_name=role_name, + resource_group_name=resource_group_name, + monitoring_metric_configuration=monitoring_metric_configuration, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('MonitoringMetricConfiguration', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'roleName': self._serialize.url("role_name", role_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/roles/{roleName}/monitoringConfig/default'} # type: ignore + + def _delete_initial( + self, + device_name, # type: str + role_name, # type: str + resource_group_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01-preview" + accept = "application/json" + + # Construct URL + url = self._delete_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'roleName': self._serialize.url("role_name", role_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/roles/{roleName}/monitoringConfig/default'} # type: ignore + + def begin_delete( + self, + device_name, # type: str + role_name, # type: str + resource_group_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> LROPoller[None] + """deletes a new metric configuration for a role. + + deletes a new metric configuration for a role. + + :param device_name: The device name. + :type device_name: str + :param role_name: The role name. + :type role_name: str + :param resource_group_name: The resource group name. + :type resource_group_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: Pass in True if you'd like the ARMPolling polling method, + False for no polling, or your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._delete_initial( + device_name=device_name, + role_name=role_name, + resource_group_name=resource_group_name, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'roleName': self._serialize.url("role_name", role_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/roles/{roleName}/monitoringConfig/default'} # type: ignore diff --git a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2021_02_01_preview/operations/_nodes_operations.py b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2021_02_01_preview/operations/_nodes_operations.py new file mode 100644 index 000000000000..fdddca8309c8 --- /dev/null +++ b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2021_02_01_preview/operations/_nodes_operations.py @@ -0,0 +1,121 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.mgmt.core.exceptions import ARMErrorFormat + +from .. import models as _models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class NodesOperations(object): + """NodesOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.databoxedge.v2021_02_01_preview.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[~azure.mgmt.databoxedge.v2021_02_01_preview.models.NodeList] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.NodeList"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01-preview" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_by_data_box_edge_device.metadata['url'] # type: ignore + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('NodeList', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_by_data_box_edge_device.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/nodes'} # type: ignore diff --git a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2021_02_01_preview/operations/_operations.py b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2021_02_01_preview/operations/_operations.py new file mode 100644 index 000000000000..046e4bc51513 --- /dev/null +++ b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2021_02_01_preview/operations/_operations.py @@ -0,0 +1,111 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.mgmt.core.exceptions import ARMErrorFormat + +from .. import models as _models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class Operations(object): + """Operations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.databoxedge.v2021_02_01_preview.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[~azure.mgmt.databoxedge.v2021_02_01_preview.models.OperationsList] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationsList"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01-preview" + 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/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2021_02_01_preview/operations/_operations_status_operations.py b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2021_02_01_preview/operations/_operations_status_operations.py new file mode 100644 index 000000000000..e670f8a84b7d --- /dev/null +++ b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2021_02_01_preview/operations/_operations_status_operations.py @@ -0,0 +1,110 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.mgmt.core.exceptions import ARMErrorFormat + +from .. import models as _models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Optional, TypeVar + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class OperationsStatusOperations(object): + """OperationsStatusOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.databoxedge.v2021_02_01_preview.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: ~azure.mgmt.databoxedge.v2021_02_01_preview.models.Job + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.Job"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01-preview" + 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/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2021_02_01_preview/operations/_orders_operations.py b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2021_02_01_preview/operations/_orders_operations.py new file mode 100644 index 000000000000..7d118289e192 --- /dev/null +++ b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2021_02_01_preview/operations/_orders_operations.py @@ -0,0 +1,489 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.core.polling import LROPoller, NoPolling, PollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.arm_polling import ARMPolling + +from .. import models as _models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class OrdersOperations(object): + """OrdersOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.databoxedge.v2021_02_01_preview.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[~azure.mgmt.databoxedge.v2021_02_01_preview.models.OrderList] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.OrderList"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01-preview" + 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: ~azure.mgmt.databoxedge.v2021_02_01_preview.models.Order + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.Order"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01-preview" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('Order', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/orders/default'} # type: ignore + + def _create_or_update_initial( + self, + device_name, # type: str + resource_group_name, # type: str + order, # type: "_models.Order" + **kwargs # type: Any + ): + # type: (...) -> Optional["_models.Order"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.Order"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01-preview" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._create_or_update_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(order, 'Order') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('Order', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/orders/default'} # type: ignore + + def begin_create_or_update( + self, + device_name, # type: str + resource_group_name, # type: str + order, # type: "_models.Order" + **kwargs # type: Any + ): + # type: (...) -> LROPoller["_models.Order"] + """Creates or updates an order. + + Creates or updates an order. + + :param device_name: The order details of a device. + :type device_name: str + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param order: The order to be created or updated. + :type order: ~azure.mgmt.databoxedge.v2021_02_01_preview.models.Order + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: Pass in True if you'd like the ARMPolling polling method, + False for no polling, or your own initialized polling object for a 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[~azure.mgmt.databoxedge.v2021_02_01_preview.models.Order] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Order"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._create_or_update_initial( + device_name=device_name, + resource_group_name=resource_group_name, + order=order, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('Order', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/orders/default'} # type: ignore + + def _delete_initial( + self, + device_name, # type: str + resource_group_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01-preview" + 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: Pass in True if you'd like the ARMPolling polling method, + False for no polling, or your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._delete_initial( + device_name=device_name, + resource_group_name=resource_group_name, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/orders/default'} # type: ignore + + def list_dc_access_code( + self, + device_name, # type: str + resource_group_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.DCAccessCode" + """Gets the DCAccess Code. + + Gets the DCAccess Code. + + :param device_name: The device name. + :type device_name: str + :param resource_group_name: The resource group name. + :type resource_group_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: DCAccessCode, or the result of cls(response) + :rtype: ~azure.mgmt.databoxedge.v2021_02_01_preview.models.DCAccessCode + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.DCAccessCode"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01-preview" + accept = "application/json" + + # Construct URL + url = self.list_dc_access_code.metadata['url'] # type: ignore + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('DCAccessCode', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + list_dc_access_code.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/orders/default/listDCAccessCode'} # type: ignore diff --git a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2021_02_01_preview/operations/_roles_operations.py b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2021_02_01_preview/operations/_roles_operations.py new file mode 100644 index 000000000000..252a36cf677a --- /dev/null +++ b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2021_02_01_preview/operations/_roles_operations.py @@ -0,0 +1,438 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.core.polling import LROPoller, NoPolling, PollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.arm_polling import ARMPolling + +from .. import models as _models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class RolesOperations(object): + """RolesOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.databoxedge.v2021_02_01_preview.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[~azure.mgmt.databoxedge.v2021_02_01_preview.models.RoleList] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.RoleList"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01-preview" + 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: ~azure.mgmt.databoxedge.v2021_02_01_preview.models.Role + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.Role"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01-preview" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('Role', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/roles/{name}'} # type: ignore + + def _create_or_update_initial( + self, + device_name, # type: str + name, # type: str + resource_group_name, # type: str + role, # type: "_models.Role" + **kwargs # type: Any + ): + # type: (...) -> Optional["_models.Role"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.Role"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01-preview" + 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: ~azure.mgmt.databoxedge.v2021_02_01_preview.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: Pass in True if you'd like the ARMPolling polling method, + False for no polling, or your own initialized polling object for a 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[~azure.mgmt.databoxedge.v2021_02_01_preview.models.Role] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Role"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._create_or_update_initial( + device_name=device_name, + name=name, + resource_group_name=resource_group_name, + role=role, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('Role', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/roles/{name}'} # type: ignore + + def _delete_initial( + self, + device_name, # type: str + name, # type: str + resource_group_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01-preview" + 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: Pass in True if you'd like the ARMPolling polling method, + False for no polling, or your own initialized polling object for a 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/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2021_02_01_preview/operations/_shares_operations.py b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2021_02_01_preview/operations/_shares_operations.py new file mode 100644 index 000000000000..f1a4686a42d2 --- /dev/null +++ b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2021_02_01_preview/operations/_shares_operations.py @@ -0,0 +1,563 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.core.polling import LROPoller, NoPolling, PollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.arm_polling import ARMPolling + +from .. import models as _models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class SharesOperations(object): + """SharesOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.databoxedge.v2021_02_01_preview.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[~azure.mgmt.databoxedge.v2021_02_01_preview.models.ShareList] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ShareList"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01-preview" + 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: ~azure.mgmt.databoxedge.v2021_02_01_preview.models.Share + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.Share"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01-preview" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('Share', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/shares/{name}'} # type: ignore + + def _create_or_update_initial( + self, + device_name, # type: str + name, # type: str + resource_group_name, # type: str + share, # type: "_models.Share" + **kwargs # type: Any + ): + # type: (...) -> Optional["_models.Share"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.Share"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01-preview" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._create_or_update_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(share, 'Share') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('Share', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/shares/{name}'} # type: ignore + + def begin_create_or_update( + self, + device_name, # type: str + name, # type: str + resource_group_name, # type: str + share, # type: "_models.Share" + **kwargs # type: Any + ): + # type: (...) -> LROPoller["_models.Share"] + """Creates a new share or updates an existing share on the device. + + Creates a new share or updates an existing share on the device. + + :param device_name: The device name. + :type device_name: str + :param name: The share name. + :type name: str + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param share: The share properties. + :type share: ~azure.mgmt.databoxedge.v2021_02_01_preview.models.Share + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: Pass in True if you'd like the ARMPolling polling method, + False for no polling, or your own initialized polling object for a 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[~azure.mgmt.databoxedge.v2021_02_01_preview.models.Share] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Share"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._create_or_update_initial( + device_name=device_name, + name=name, + resource_group_name=resource_group_name, + share=share, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('Share', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/shares/{name}'} # type: ignore + + def _delete_initial( + self, + device_name, # type: str + name, # type: str + resource_group_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01-preview" + 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: Pass in True if you'd like the ARMPolling polling method, + False for no polling, or your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._delete_initial( + device_name=device_name, + name=name, + resource_group_name=resource_group_name, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/shares/{name}'} # type: ignore + + def _refresh_initial( + self, + device_name, # type: str + name, # type: str + resource_group_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01-preview" + 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: Pass in True if you'd like the ARMPolling polling method, + False for no polling, or your own initialized polling object for a 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/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2021_02_01_preview/operations/_storage_account_credentials_operations.py b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2021_02_01_preview/operations/_storage_account_credentials_operations.py new file mode 100644 index 000000000000..5ebf92945344 --- /dev/null +++ b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2021_02_01_preview/operations/_storage_account_credentials_operations.py @@ -0,0 +1,440 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.core.polling import LROPoller, NoPolling, PollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.arm_polling import ARMPolling + +from .. import models as _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: ~azure.mgmt.databoxedge.v2021_02_01_preview.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[~azure.mgmt.databoxedge.v2021_02_01_preview.models.StorageAccountCredentialList] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.StorageAccountCredentialList"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01-preview" + 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: ~azure.mgmt.databoxedge.v2021_02_01_preview.models.StorageAccountCredential + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.StorageAccountCredential"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01-preview" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('StorageAccountCredential', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/storageAccountCredentials/{name}'} # type: ignore + + def _create_or_update_initial( + self, + device_name, # type: str + name, # type: str + resource_group_name, # type: str + storage_account_credential, # type: "_models.StorageAccountCredential" + **kwargs # type: Any + ): + # type: (...) -> Optional["_models.StorageAccountCredential"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.StorageAccountCredential"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01-preview" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._create_or_update_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(storage_account_credential, 'StorageAccountCredential') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('StorageAccountCredential', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/storageAccountCredentials/{name}'} # type: ignore + + def begin_create_or_update( + self, + device_name, # type: str + name, # type: str + resource_group_name, # type: str + storage_account_credential, # type: "_models.StorageAccountCredential" + **kwargs # type: Any + ): + # type: (...) -> LROPoller["_models.StorageAccountCredential"] + """Creates or updates the storage account credential. + + :param device_name: The device name. + :type device_name: str + :param name: The storage account credential name. + :type name: str + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param storage_account_credential: The storage account credential. + :type storage_account_credential: ~azure.mgmt.databoxedge.v2021_02_01_preview.models.StorageAccountCredential + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: Pass in True if you'd like the ARMPolling polling method, + False for no polling, or your own initialized polling object for a 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[~azure.mgmt.databoxedge.v2021_02_01_preview.models.StorageAccountCredential] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.StorageAccountCredential"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._create_or_update_initial( + device_name=device_name, + name=name, + resource_group_name=resource_group_name, + storage_account_credential=storage_account_credential, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('StorageAccountCredential', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/storageAccountCredentials/{name}'} # type: ignore + + def _delete_initial( + self, + device_name, # type: str + name, # type: str + resource_group_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01-preview" + 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: Pass in True if you'd like the ARMPolling polling method, + False for no polling, or your own initialized polling object for a 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/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2021_02_01_preview/operations/_storage_accounts_operations.py b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2021_02_01_preview/operations/_storage_accounts_operations.py new file mode 100644 index 000000000000..e559cc8201e0 --- /dev/null +++ b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2021_02_01_preview/operations/_storage_accounts_operations.py @@ -0,0 +1,444 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.core.polling import LROPoller, NoPolling, PollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.arm_polling import ARMPolling + +from .. import models as _models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class StorageAccountsOperations(object): + """StorageAccountsOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.databoxedge.v2021_02_01_preview.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list_by_data_box_edge_device( + self, + device_name, # type: str + resource_group_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.StorageAccountList"] + """Lists all the StorageAccounts in a Data Box Edge/Data Box Gateway device. + + Lists all the StorageAccounts in a Data Box Edge/Data Box Gateway device. + + :param device_name: The device name. + :type device_name: str + :param resource_group_name: The resource group name. + :type resource_group_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either StorageAccountList or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.databoxedge.v2021_02_01_preview.models.StorageAccountList] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.StorageAccountList"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01-preview" + 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: ~azure.mgmt.databoxedge.v2021_02_01_preview.models.StorageAccount + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.StorageAccount"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01-preview" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'storageAccountName': self._serialize.url("storage_account_name", storage_account_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('StorageAccount', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/storageAccounts/{storageAccountName}'} # type: ignore + + def _create_or_update_initial( + self, + device_name, # type: str + storage_account_name, # type: str + resource_group_name, # type: str + storage_account, # type: "_models.StorageAccount" + **kwargs # type: Any + ): + # type: (...) -> Optional["_models.StorageAccount"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.StorageAccount"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01-preview" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._create_or_update_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'storageAccountName': self._serialize.url("storage_account_name", storage_account_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(storage_account, 'StorageAccount') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('StorageAccount', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/storageAccounts/{storageAccountName}'} # type: ignore + + def begin_create_or_update( + self, + device_name, # type: str + storage_account_name, # type: str + resource_group_name, # type: str + storage_account, # type: "_models.StorageAccount" + **kwargs # type: Any + ): + # type: (...) -> LROPoller["_models.StorageAccount"] + """Creates a new StorageAccount or updates an existing StorageAccount on the device. + + Creates a new StorageAccount or updates an existing StorageAccount on the device. + + :param device_name: The device name. + :type device_name: str + :param storage_account_name: The StorageAccount name. + :type storage_account_name: str + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param storage_account: The StorageAccount properties. + :type storage_account: ~azure.mgmt.databoxedge.v2021_02_01_preview.models.StorageAccount + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: Pass in True if you'd like the ARMPolling polling method, + False for no polling, or your own initialized polling object for a 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[~azure.mgmt.databoxedge.v2021_02_01_preview.models.StorageAccount] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.StorageAccount"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._create_or_update_initial( + device_name=device_name, + storage_account_name=storage_account_name, + resource_group_name=resource_group_name, + storage_account=storage_account, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('StorageAccount', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'storageAccountName': self._serialize.url("storage_account_name", storage_account_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/storageAccounts/{storageAccountName}'} # type: ignore + + def _delete_initial( + self, + device_name, # type: str + storage_account_name, # type: str + resource_group_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01-preview" + 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: Pass in True if you'd like the ARMPolling polling method, + False for no polling, or your own initialized polling object for a 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/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2021_02_01_preview/operations/_triggers_operations.py b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2021_02_01_preview/operations/_triggers_operations.py new file mode 100644 index 000000000000..d9813804152e --- /dev/null +++ b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2021_02_01_preview/operations/_triggers_operations.py @@ -0,0 +1,444 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.core.polling import LROPoller, NoPolling, PollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.arm_polling import ARMPolling + +from .. import models as _models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class TriggersOperations(object): + """TriggersOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.databoxedge.v2021_02_01_preview.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[~azure.mgmt.databoxedge.v2021_02_01_preview.models.TriggerList] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.TriggerList"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01-preview" + 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: ~azure.mgmt.databoxedge.v2021_02_01_preview.models.Trigger + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.Trigger"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01-preview" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('Trigger', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/triggers/{name}'} # type: ignore + + def _create_or_update_initial( + self, + device_name, # type: str + name, # type: str + resource_group_name, # type: str + trigger, # type: "_models.Trigger" + **kwargs # type: Any + ): + # type: (...) -> Optional["_models.Trigger"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.Trigger"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01-preview" + 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: ~azure.mgmt.databoxedge.v2021_02_01_preview.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: Pass in True if you'd like the ARMPolling polling method, + False for no polling, or your own initialized polling object for a 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[~azure.mgmt.databoxedge.v2021_02_01_preview.models.Trigger] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Trigger"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._create_or_update_initial( + device_name=device_name, + name=name, + resource_group_name=resource_group_name, + trigger=trigger, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('Trigger', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/triggers/{name}'} # type: ignore + + def _delete_initial( + self, + device_name, # type: str + name, # type: str + resource_group_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01-preview" + 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: Pass in True if you'd like the ARMPolling polling method, + False for no polling, or your own initialized polling object for a 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/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2021_02_01_preview/operations/_users_operations.py b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2021_02_01_preview/operations/_users_operations.py new file mode 100644 index 000000000000..cfcd2c6f7dcf --- /dev/null +++ b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2021_02_01_preview/operations/_users_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 as _models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class UsersOperations(object): + """UsersOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.databoxedge.v2021_02_01_preview.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 + expand=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 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 UserList or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.databoxedge.v2021_02_01_preview.models.UserList] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.UserList"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01-preview" + 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 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('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: ~azure.mgmt.databoxedge.v2021_02_01_preview.models.User + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.User"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01-preview" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('User', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/users/{name}'} # type: ignore + + def _create_or_update_initial( + self, + device_name, # type: str + name, # type: str + resource_group_name, # type: str + user, # type: "_models.User" + **kwargs # type: Any + ): + # type: (...) -> Optional["_models.User"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.User"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01-preview" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._create_or_update_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(user, 'User') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('User', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/users/{name}'} # type: ignore + + def begin_create_or_update( + self, + device_name, # type: str + name, # type: str + resource_group_name, # type: str + user, # type: "_models.User" + **kwargs # type: Any + ): + # type: (...) -> LROPoller["_models.User"] + """Creates a new user or updates an existing user's information on a Data Box Edge/Data Box + Gateway device. + + :param device_name: The device name. + :type device_name: str + :param name: The user name. + :type name: str + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param user: The user details. + :type user: ~azure.mgmt.databoxedge.v2021_02_01_preview.models.User + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: Pass in True if you'd like the ARMPolling polling method, + False for no polling, or your own initialized polling object for a 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[~azure.mgmt.databoxedge.v2021_02_01_preview.models.User] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.User"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._create_or_update_initial( + device_name=device_name, + name=name, + resource_group_name=resource_group_name, + user=user, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('User', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/users/{name}'} # type: ignore + + def _delete_initial( + self, + device_name, # type: str + name, # type: str + resource_group_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01-preview" + 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: Pass in True if you'd like the ARMPolling polling method, + False for no polling, or your own initialized polling object for a 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/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2021_02_01_preview/py.typed b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2021_02_01_preview/py.typed new file mode 100644 index 000000000000..e5aff4f83af8 --- /dev/null +++ b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2021_02_01_preview/py.typed @@ -0,0 +1 @@ +# Marker file for PEP 561. \ No newline at end of file